PowerBuilder纯PB代码进度条效果图:
PB9代码:
创建Standard Visual ,datawindow对象,命名为:vo_hprogressbar
forward
global type vo_hprogressbar from datawindow
end type
end forward
global type vo_hprogressbar from datawindow
integer width = 2242
integer height = 202
string title = "none"
boolean border = false
boolean livescroll = true
end type
global vo_hprogressbar vo_hprogressbar
type variables
long il_backcolor = 15780518 //进度颜⾊
long il_fontcolor = 33554432 //字体颜⾊
long il_fontsize = 14 //字体⼤⼩
end variables
forward prototypes
public subroutine of_progress (long al_maxposition, long al_progress)
end prototypes
public subroutine of_progress (long al_maxposition, long al_progress);//===========================
//al_maxposition : 总进度
//al_progress : 当前进度
//===========================
long ll_width,ll_st_article_x
int li_percentage
dec ldc_article_width
string ls_text
//this.setredraw( false)
//this.object.progress.width = 0
ll_width = this.width -20
li_percentage=(100/al_maxposition) * al_progress
if al_maxposition = al_progress  then
if al_maxposition = al_progress  then
ldc_article_width = ll_width
ls_text='100%'
else
ldc_article_width = (ll_width / al_maxposition) * al_progress
ls_text=string(li_percentage)+'%'
end if
this. = ls_text
this.object.progress.width = int(ldc_article_width)
//this.setredraw( true)
this.SetPosition("number", "header", TRUE)
end subroutine
on ate
end on
on vo_hprogressbar.destroy
javascript进度条
end on
event constructor;string ls_syanx
long ll_width,ll_height
ls_syanx = 'release 9;' + &
'datawindow(units=0 timer_interval=0 color=1073741824 processing=0 HTMLDW=no print.printername="" print.documentname="" ientation = 0 print.marg 'header(height=10000 color="536870912" )' + &
'summary(height=0 color="536870912" )' + &
'footer(height=0 color="536870912" )' + &
'detail(height=0 color="536870912" )' + &
'table(column=(type=char(10) updatewhereclause=yes name=a dbname="a" )' + &
' )' + &
'text(band=header alignment="2" text="text" border="0" color="'+string(il_fontcolor)+'" x="55" y="51" height="80" width="500" html.valueishtml="0"  name=number 'text(band=header alignment="2" text="" border="0" color="255" x="0" y="0" height="90" width="995" html.valueishtml="0"  name=progress visible="1"  font.face=" 'rectangle(band=header x="22" y="13" height="125" width="1865"  name=r_border visible="1" brush.hatch="6" lor="553648127" pen. pen.width= 'htmltable(border="1" )' + &
'htmlgen(clientevents="1" clientvalidation="1" clientcomputedfields="1" clientformatting="0" clientscriptable="0" generatejavascript="1" encodeselflinkargs="1" nets 'l(headgroups="1" includewhitespace="0" metadatatype=0 savemetadata=0 )' + &
'l()' + &
'export.pdf(method=0 distill.custompostscript="0" xslfop.print="0" )'
this.Create(ls_syanx)
this. = '0%'
ll_width = long(this.object.number.width)
ll_height = long(this.object.number.height)
this.object.number.x = long((this.width - ll_width)  / 2)
this.object.number.y = long((this.height - ll_height)  / 2)
this.object.progress.x = 10
this.object.progress.y = 10
this.object.progress.width = 0
this.object.progress.height = this.height -20
this.object.r_border.x = this.object.progress.x
this.object.r_border.y = this.object.progress.y
this.object.r_border.width = this.width -20
this.object.r_border.height = this.object.progress.height
this.SetPosition("r_border", "header", false)
end event

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。