PB做大屏显示滚动窗口 [转载]

前段时间接到一个同事的求助

一个客户需求做门诊已完成报告通知取单的大屏显示界面

百度了一下,其实很简单

实现方法如下

 

1.用要显示数据的sql语句做成数据窗口(datawindow);

2.在窗体(window)中嵌入window;

3.在窗体的open事件中加入timer事件;

4.在timer事件中对datawindow进行操作,用datawindow的scrolltorow方法滚动到对应行;

5.当滚动到对应行大于等于datawindow的rowcount是滚动行重新回到第一行;

 //窗口滚动的方式,如跑马灯的方式等都可以优化完美一点,但因为事件和能力的原因就不搞了

以下是一些代码

open事件

 

// Profile local_lis

 

//f_resize()

 

sqlca = create transaction

SQLCA.DBMS = ProfileString ('sf.ini',  'Database', "DBMS",   "")

SQLCA.Database = ProfileString ('sf.ini',  'Database', "Database",   "")

SQLCA.LogPass = ProfileString ('sf.ini',  'Database', "LogPassword",   "")

SQLCA.ServerName = ProfileString ('sf.ini',  'Database', "Servername",   "")

SQLCA.LogId = ProfileString ('sf.ini',  'Database', "Logid",   "")

SQLCA.AutoCommit = False

SQLCA.DBParm = ""

 

connect using sqlca;

string ls_title

int li_speed

ls_title = ProfileString ('sf.ini',  'Scroll', "title",   "")

ii_num = integer(Profilestring ('sf.ini',  'Scroll', "date_num",   ""))

li_speed = integer(Profilestring ('sf.ini',  'Scroll', "speed",   "3"))

st_2.text = ProfileString ('sf.ini',  'Scroll', "text1",   "")

st_3.text = ProfileString ('sf.ini',  'Scroll', "text2",   "")

 

it_date = relativedate(today(),ii_num)

if ls_title <>'' then st_1.text = ls_title

dw_1.settransobject(sqlca)

 

dw_1.retrieve(datetime(relativedate(today(),ii_num),time(00:00:00)))

//messagebox('',string(datetime(relativedate(today(),ii_num),time(00:00:00))))

//if dw_1.retrieve() = 

ii_i =0

timer(li_speed)

 

timer事件

int li_i
li_i = dw_1.rowcount()
int i = 0

dw_1.scrolltorow(ii_i)

ii_i = ii_i + 3

if ii_i > li_i +3 then
 ii_i = 0
 dw_1.retrieve(datetime(relativedate(today(),ii_num),time(00:00:00)))
 sleep(2)
 
   li_i = dw_1.rowcount()
end if

转载自【http://blog.sina.com.cn/s/blog_6c99d4e90102vdi0.html】

转载于:https://www.cnblogs.com/paxton/p/7814328.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
$PBExportComments$用数据窗口跑马灯 release 7; datawindow(units=1 timer_interval=10 color=15780518 processing=0 HTMLDW=no print.documentname="" print.orientation = 0 print.margin.left = 24 print.margin.right = 24 print.margin.top = 24 print.margin.bottom = 24 print.paper.source = 0 print.paper.size = 0 print.prompt=no print.buttons=no print.preview.buttons=no ) summary(height=0 color="536870912" ) footer(height=0 color="536870912" ) detail(height=87 color="536870912" ) table(column=(type=char(10) updatewhereclause=yes name=s dbname="s" ) ) text(band=header alignment="1" text="S:" border="0" color="0" x="13" y="6" height="14" width="18" name=s_t font.face="宋体" font.height="-9" font.weight="400" font.family="0" font.pitch="2" font.charset="134" background.mode="1" background.color="536870912" ) column(band=detail id=1 alignment="0" tabsequence=10 border="0" color="0" x="2" y="32" height="1" width="16" format="[general]" name=s edit.limit=0 edit.case=any edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes font.face="宋体" font.height="-9" font.weight="400" font.family="0" font.pitch="2" font.charset="134" background.mode="1" background.color="536870912" ) text(band=detail alignment="0" text="现在跑马灯可以用了!" border="0" color="8421376" x="0~t333 - (long(left(right(string(t),4),3))) /1.5" y="0" height="33" width="279" name=t_1 font.face="Arial" font.height="-20" font.weight="700" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="553648127" ) compute(band=summary alignment="0" expression="left(string(cpu()) + string(today(),'yyyymmdd'),len(string(cpu()) + string(today(),'yyyymmdd')) -8)"border="0" color="0" x="43" y="11" height="19" width="371" format="[general]" name=t visible="1~t0" font.face="Arial" font.height="-12" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" ) text(band=detail alignment="0" text="/*truncate((long(left(right(string(t),4),3)) /50),0) * 50* (rgb(255,255,255) /1000)*/rand(100)/100 * rgb(255,255,255)" border="0" color="16711935" x="1" y="44" height="14" width="1418" name=t_2 font.face="Arial" font.height="-8" font.weight="700" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="553648127" ) text(band=detail alignment="0" text="333 - (long(left(right(string(t),4),3))) /1.5" border="0" color="16711935" x="0" y="66" height="14" width="508" name=t_3 font.face="Arial" font.height="-8" font.weight="700" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="553648127" ) htmltable(border="1" ) htmlgen(clientevents="1" clientvalidation="1" clientcomputedfields="1" clientformatting="0" clientscriptable="0" generatejavascript="1" )
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值