为数据窗口加载数据创建等待窗口

1,建一 popup! 类型的窗口,放上你的GIF图片,存储的名称如 w_base_wait ;
2,将下面的代码另存为 n_cst_thread_basewait.sru ,再在你的 pbl 上右键 import... 得到一个名为n_cst_thread_basewait 的 Custom Class ;

$PBExportHeader$n_cst_thread_basewait.sru

$PBExportComments$打开或关闭等待窗口的线程

forward

global type n_cst_thread_basewait from nonvisualobject

end type

end forward



global type n_cst_thread_basewait from nonvisualobject

end type

global n_cst_thread_basewait n_cst_thread_basewait



type prototypes



end prototypes



type variables



end variables



forward prototypes

public function integer of_close_wait ()

public function integer of_open_wait ()

end prototypes



public function integer of_close_wait ();if isvalid(w_base_wait) then close(w_base_wait)



return 0

end function



public function integer of_open_wait ();if not isvalid(w_base_wait) then open(w_base_wait)



return 0

end function



on n_cst_thread_basewait.create

call super::create

TriggerEvent( this, "constructor" )

end on



on n_cst_thread_basewait.destroy

TriggerEvent( this, "destructor" )

call super::destroy

end on


3,在应用里定义一个全局变量 n_cst_thread_basewait gwait 并添加一个名为 of_cthread_wait 的函数,返回integer:

ErrorReturn err

err = SharedObjectRegister( "n_cst_thread_basewait", "nwait")



IF err <> Success! THEN

    messagebox('', '注册共享对象失败!  ', stopsign!)

    return -1

END IF

err = SharedObjectGet( "nwait", gwait)

if err <> Success! then

    messagebox('', '从注册的共享对象生成线程失败!  ', stopsign)

    return -1

end if

SharedObjectUnregister('nwait')



if isvalid(gwait) then

    return 0

else   

    return -1

end if

4,在应用的 open 事件 里写上:of_cthread_wait()
5,在需要打开等待窗口的地方写:gwait.post of_open_wait(), 在需要关闭的地方写:gwait.post of_close_wait()

如:在数据窗口的retrievestart事件中写:gwait.post of_open_wait(),在retrieveend事件中写gwait.post of_close_wait()

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值