PB数据窗口自动换下一页

将以下内容保存为文件uo_datawindow_autoscroll.sru , 然后导入pbl中,再通过导入的uo_datawindow_autoscroll对象来创建dw(当前默认的时间为1秒,更改dw的“滚动时间间隔”属性可以设置滚动时间间隔)

 

$PBExportHeader$uo_datawindow_autoscroll.sru
forward
global type uo_datawindow_autoscroll from datawindow
end type
type timing_scroll from timing within uo_datawindow_autoscroll
end type
end forward

global type uo_datawindow_autoscroll from datawindow
integer width = 686
integer height = 400
string title = "none"
boolean livescroll = true
borderstyle borderstyle = stylelowered!
event ue_timer ( )
timing_scroll timing_scroll
end type
global uo_datawindow_autoscroll uo_datawindow_autoscroll

type variables
dec 滚动时间间隔 = 1
protected:
datawindow idw
end variables
event ue_timer();if Describe("evaluate('if(page() = pagecount(), 1, 0)'," + string(object.datawindow.lastrowonpage) + ")") = '1' then
    this.scrolltorow(1)
else
    this.scrollnextpage( )
end if
end event

on uo_datawindow_autoscroll.create
this.timing_scroll=create timing_scroll
end on

on uo_datawindow_autoscroll.destroy
destroy(this.timing_scroll)
end on

event constructor;idw = this
this.modify( 'create compute(band=foreground alignment="2" expression="page() + ~'/~' + pagecount()"border="0" color="255" x="199" y="8" height="64" width="326" format="[GENERAL]" html.valueishtml="0"  name=compute_page visible="1"  font.face="宋体" font.height="-9" font.weight="700"  font.family="0" font.pitch="2" font.charset="134" background.mode="1" background.color="536870912" )' )
timing_scroll.start(滚动时间间隔)
end event

type timing_scroll from timing within uo_datawindow_autoscroll descriptor "pb_nvo" = "true" 
end type

on timing_scroll.create
call super::create
TriggerEvent( this, "constructor" )
end on

on timing_scroll.destroy
TriggerEvent( this, "destructor" )
call super::destroy
end on

event timer;idw.triggerevent("ue_timer")
end event

 

转载于:https://www.cnblogs.com/szxiaofei14/articles/3498064.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值