在一个显示屏上显示一些数据,但是数据比较多。如何实现数据窗口中的数据过一段时间就自动显示下一页,到最后一页又跳到第一页,如此循环?哪位老大指点一下
------解决方案--------------------
将以下内容保存为文件uo_datawindow_autoscroll.sru , 然后导入pbl中,再通过导入的uo_datawindow_autoscroll对象来创建dw(当前默认的时间为1秒,更改dw的“滚动时间间隔”属性可以设置滚动时间间隔)
- C/C++ code
$PBExportHeader$uo_datawindow_autoscroll.sruforwardglobal type uo_datawindow_autoscroll from datawindowend typetype timing_scroll from timing within uo_datawindow_autoscrollend typeend forwardglobal type uo_datawindow_autoscroll from datawindowinteger width = 686integer height = 400string title = "none"boolean livescroll = trueborderstyle borderstyle = stylelowered!event ue_timer ( )timing_scroll timing_scrollend typeglobal uo_datawindow_autoscroll uo_datawindow_autoscrolltype variablesdec 滚动时间间隔 = 1protected:datawindow idwend variablesevent ue_timer();if Describe("evaluate('if(page() = pagecount(), 1, 0)'," + string(object.datawindow.lastrowonpage) + ")") = '1' then this.scrolltorow(1)else this.scrollnextpage( )end ifend eventon uo_datawindow_autoscroll.createthis.timing_scroll=create timing_scrollend onon uo_datawindow_autoscroll.destroydestroy(this.timing_scroll)end onevent constructor;idw = thisthis.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 eventtype timing_scroll from timing within uo_datawindow_autoscroll descriptor "pb_nvo" = "true" end typeon timing_scroll.createcall super::createTriggerEvent( this, "constructor" )end onon timing_scroll.destroyTriggerEvent( this, "destructor" )call super::destroyend onevent timer;idw.triggerevent("ue_timer")end event