w_waitforwsrslt.srw 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. $PBExportHeader$w_waitforwsrslt.srw
  2. forward
  3. global type w_waitforwsrslt from window
  4. end type
  5. type p_1 from picture within w_waitforwsrslt
  6. end type
  7. type st_t from statictext within w_waitforwsrslt
  8. end type
  9. type cb_cancel from commandbutton within w_waitforwsrslt
  10. end type
  11. type st_msg from statictext within w_waitforwsrslt
  12. end type
  13. end forward
  14. global type w_waitforwsrslt from window
  15. integer x = 201
  16. integer y = 200
  17. integer width = 1815
  18. integer height = 356
  19. windowtype windowtype = response!
  20. long backcolor = 134217732
  21. string icon = "AppIcon!"
  22. string pointer = "HourGlass!"
  23. boolean center = true
  24. p_1 p_1
  25. st_t st_t
  26. cb_cancel cb_cancel
  27. st_msg st_msg
  28. end type
  29. global w_waitforwsrslt w_waitforwsrslt
  30. type variables
  31. long ins_waitsec=15 //默认等待时间
  32. decimal ins_cursec=0.1
  33. string ins_ori_title='与后台通讯中...'
  34. string ins_ori_msg//原提示消息
  35. string ins_bytes_msg//收到数据量消息
  36. long ins_bytes=0//已经接收到的数据包大小
  37. end variables
  38. forward prototypes
  39. public subroutine add_bytes (long arg_bytes)
  40. end prototypes
  41. public subroutine add_bytes (long arg_bytes);ins_bytes=ins_bytes+arg_bytes
  42. ins_bytes_msg=' 已接收到'+string(ins_bytes)+'字节'
  43. //st_msg.text=ins_ori_msg+ins_bytes_msg
  44. st_msg.text=string(ins_cursec)+' '+ins_ori_title+'~r~n'+ins_bytes_msg+' '+string(round(dec(ins_bytes/1024),1))+'k'
  45. end subroutine
  46. on w_waitforwsrslt.create
  47. this.p_1=create p_1
  48. this.st_t=create st_t
  49. this.cb_cancel=create cb_cancel
  50. this.st_msg=create st_msg
  51. this.Control[]={this.p_1,&
  52. this.st_t,&
  53. this.cb_cancel,&
  54. this.st_msg}
  55. end on
  56. on w_waitforwsrslt.destroy
  57. destroy(this.p_1)
  58. destroy(this.st_t)
  59. destroy(this.cb_cancel)
  60. destroy(this.st_msg)
  61. end on
  62. event open;s_waitforwsrslt_para s_para
  63. s_para=message.powerobjectparm
  64. if s_para.waitsecond>0 then
  65. ins_waitsec=s_para.waitsecond
  66. ins_cursec=0
  67. ins_ori_title=s_para.title
  68. ins_ori_msg=st_msg.text
  69. ins_bytes_msg=' 已接收到'+string(ins_bytes)+'字节'
  70. if s_para.if_allow_cancel=false then
  71. this.cb_cancel.enabled=false
  72. end if
  73. end if
  74. st_msg.text=string(ins_cursec)+' '+ins_ori_title+'~r~n'+ins_bytes_msg+' '+string(round(dec(ins_bytes/1024),1))+'k'
  75. timer(0.1)
  76. end event
  77. event timer;
  78. if st_t.text='>' then
  79. st_t.text=' <'
  80. else
  81. st_t.text='>'
  82. end if
  83. ins_cursec=ins_cursec+0.1
  84. st_msg.text=string(ins_cursec)+' '+ins_ori_title+'~r~n'+ins_bytes_msg+' '+string(round(dec(ins_bytes/1024),1))+'k'
  85. //IF ins_cursec >= ins_waitsec THEN
  86. // Close(THIS)
  87. //END IF
  88. IF sys_buf_new THEN
  89. // if_consuc = 1
  90. Close(THIS)
  91. ELSEIF ins_cursec >= ins_waitsec THEN
  92. // if_consuc = 0
  93. Close(THIS)
  94. END IF
  95. end event
  96. type p_1 from picture within w_waitforwsrslt
  97. integer width = 1829
  98. integer height = 160
  99. string picturename = "graphics\jdt_banner.jpg"
  100. boolean focusrectangle = false
  101. end type
  102. type st_t from statictext within w_waitforwsrslt
  103. integer x = 32
  104. integer y = 184
  105. integer width = 96
  106. integer height = 96
  107. integer textsize = -13
  108. integer weight = 700
  109. fontcharset fontcharset = ansi!
  110. fontpitch fontpitch = variable!
  111. fontfamily fontfamily = swiss!
  112. string facename = "Arial"
  113. string pointer = "HourGlass!"
  114. long textcolor = 33554432
  115. long backcolor = 134217732
  116. string text = ">"
  117. boolean focusrectangle = false
  118. end type
  119. type cb_cancel from commandbutton within w_waitforwsrslt
  120. integer x = 1527
  121. integer y = 196
  122. integer width = 251
  123. integer height = 92
  124. integer textsize = -9
  125. fontcharset fontcharset = gb2312charset!
  126. fontpitch fontpitch = variable!
  127. string facename = "宋体"
  128. string text = "取消"
  129. end type
  130. event clicked;if sys_wsc.getstate()=7 then
  131. // sys_wsc.send_cancel()
  132. // sys_wsc.triggerevent('ue_send')
  133. sys_wsc.object.senddata("[cancel]")
  134. end if
  135. close(parent)
  136. end event
  137. type st_msg from statictext within w_waitforwsrslt
  138. integer x = 137
  139. integer y = 192
  140. integer width = 1367
  141. integer height = 132
  142. integer textsize = -9
  143. integer weight = 400
  144. fontcharset fontcharset = ansi!
  145. fontpitch fontpitch = variable!
  146. fontfamily fontfamily = swiss!
  147. string facename = "Arial"
  148. string pointer = "HourGlass!"
  149. long textcolor = 33554432
  150. long backcolor = 134217732
  151. string text = "与后台通讯中..."
  152. boolean focusrectangle = false
  153. end type