我封装的窗体为啥没响应? 请高手赐教!!!
在数据窗口从数据库中检索数据时,当数据量少时不会感觉到延迟,但当数据量几十万以上是就会明显地感到延迟,为不让用户感到系统好像是无响应,在检索数据之前将示忙器弹出,以示系统忙,正在运行中。但示忙器总是无法正常工作。
下面我大概说一下示忙器的工作原理。
该示忙器由12个图片不停的相互切换让用户感到好像画面是在动的,从而认为系统仍在工作中。
问题如下:每次检索开始打开示忙器和关闭示忙器的图片竟然是一样的,也就是说没有切换图片。单独测试时没问题,但放在数据窗口检索开始时就会出问题。
请教大家该如何解决。代码如下:
forward
global type w_busindicator from window
end type
type p_disc from picture within w_busindicator
end type
end forward
global type w_busindicator from window
integer width = 352
integer height = 312
boolean border = false
windowtype windowtype = child!
long backcolor = 67108864
string icon = "AppIcon!"
boolean center = true
p_disc p_disc
end type
global w_busindicator w_busindicator
type variables
private:
int mPosition = 1
constant string Folder = "image"
end variables
event timer;mPosition ++
if mPosition > 12 then mPosition = 1
p_disc.picturename = Folder + "\" + string(mPosition) + ".bmp"//图片的名称为:1.bmp, 2.bmp, 3.bmp, .....
end event
on w_busindicator.create
this.p_disc=create p_disc
this.Control[]={this.p_disc}
end on
on w_busindicator.destroy
destroy(this.p_disc)
end on
event open;P_disc.x = 0
P_disc.y = 0
this.width = p_disc.width
this.height = p_disc.height
Timer(0.05, this)
end event
type p_disc from picture within w_busindicator
integer width = 338
integer height = 296
boolean originalsize = true
string picturename = "image\1.bmp"
boolean focusrectangle = false
end type