在MicroHelp Bar上显示时间

下面示例了在MDI的Microhelp棒的右边显示时间。它利用一个包含有一个单行
编辑控件sle_time的Pop-Up类型窗口w_popup,用SLE显示时间。

//定义MDI Frame的实例变量
INTEGER OX,OY,OH,OW // OLD X,Y AND HEIGHT, WIDTH
W_POPUP LPOP // LOCAL POPUP WHICH TRAIPES ...

//w_MDI_frame的Open事件
integer wx,wy,wh,ww // workspace extents
ox=this.x
oy=this.y
oh=this.height
ow=this.width

wx=this.workspacex ( )
wy=this.workspacey ( )
wh=this.workspaceheight ( )
ww=this.workspacewidth ( )

open(lpop)
move(lpop,wx+ww - lpop.width - 15,wy+wh - lpop.height - 22)
show(lpop)

//w_MDI_frame的Resize事件
integer wx,wy,wh,ww

wx=this.workspacex ( )
wy=this.workspacey ( )
wh=this.workspaceheight ( )
ww=this.workspacewidth ( )

if ( handle (lpop) > 0 ) then
move(lpop,wx+ww - lpop.width - 15,wy+wh - lpop.height - 22)
end if

SetFocus(this)

//w_MDI_frame的用户事件pbm_move
integer wx,wy,wh,ww

wx=this.workspacex ( )
wy=this.workspacey ( )
wh=this.workspaceheight ( )
ww=this.workspacewidth ( )

if ( handle (lpop) > 0 ) then
move(lpop,wx+ww - lpop.width - 15,wy+wh - lpop.height - 22)
end if

SetFocus(this)

//w_popup的Open事件
sle_time.weight = 300
Timer(5)
triggerevent(this,timer!)

//w_popup的Timer事件
Time t
t=now()
sle_time.hide ( ) //hide the sle

sle_time.text=space(len(sle_time.text))
sle_time.text=string(hour(t))+":"+string(Minute(t))+":"+string(Second(t))

sle_time.show ( ) //re-show the sle

阅读更多
想对作者说点什么?

博主推荐

换一批

没有更多推荐了,返回首页