uov_price.sru 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. $PBExportHeader$uov_price.sru
  2. forward
  3. global type uov_price from userobject
  4. end type
  5. type dw_mx from u_dw_rbtnfilter within uov_price
  6. end type
  7. type st_1 from statictext within uov_price
  8. end type
  9. type dw_remind from u_dw_rbtnfilter within uov_price
  10. end type
  11. end forward
  12. global type uov_price from userobject
  13. integer width = 1755
  14. integer height = 896
  15. long backcolor = 67108864
  16. string text = "none"
  17. long tabtextcolor = 33554432
  18. long picturemaskcolor = 536870912
  19. event ue_retrieve ( )
  20. event losefocus pbm_dwnkillfocus
  21. dw_mx dw_mx
  22. st_1 st_1
  23. dw_remind dw_remind
  24. end type
  25. global uov_price uov_price
  26. type prototypes
  27. function ulong SetCapture(ulong hwnd) library "user32.dll"
  28. function boolean ReleaseCapture() library "user32.dll"
  29. function ulong GetCapture() library "user32.dll"
  30. end prototypes
  31. type variables
  32. long cur_mtrlid
  33. decimal cur_price = 6
  34. window parentwin
  35. boolean ib_Captured = false
  36. end variables
  37. forward prototypes
  38. public subroutine setmtrlid (long arg_mtrlid)
  39. public subroutine setprice (decimal arg_price)
  40. public subroutine closethis ()
  41. public subroutine wf_retrievemx (string arg_type)
  42. end prototypes
  43. event ue_retrieve();Long ll_rowcnt, i
  44. String ls_value
  45. ll_rowcnt = dw_remind.Retrieve( cur_mtrlid , cur_price)
  46. //IF cur_price > 0 THEN
  47. FOR i = 1 To ll_rowcnt
  48. IF dw_remind.Object.buy_price[i] > cur_price THEN
  49. ls_value = "bitmap ('graphics\上升_red.bmp')"
  50. ELSEIF dw_remind.Object.buy_price[i] = cur_price THEN
  51. ls_value = "bitmap ('graphics\平_dot.bmp')"
  52. ELSE
  53. ls_value = "bitmap ('graphics\下跌_green.bmp')"
  54. END IF
  55. ls_value = dw_remind.Modify('buy_pic.expression = "'+ls_value+'"')
  56. IF dw_remind.Object.bir_price[i] > cur_price THEN
  57. ls_value = "bitmap ('graphics\上升_red.bmp')"
  58. ELSEIF dw_remind.Object.bir_price[i] = cur_price THEN
  59. ls_value = "bitmap ('graphics\平_dot.bmp')"
  60. ELSE
  61. ls_value = "bitmap ('graphics\下跌_green.bmp')"
  62. END IF
  63. ls_value = dw_remind.Modify('bir_pic.expression = "'+ls_value+'"')
  64. IF dw_remind.Object.p_price[i] > cur_price THEN
  65. ls_value = "bitmap ('graphics\上升_red.bmp')"
  66. ELSEIF dw_remind.Object.p_price[i] = cur_price THEN
  67. ls_value = "bitmap ('graphics\平_dot.bmp')"
  68. ELSE
  69. ls_value = "bitmap ('graphics\下跌_green.bmp')"
  70. END IF
  71. ls_value = dw_remind.Modify('p_pic.expression = "'+ls_value+'"')
  72. IF dw_remind.Object.ipv_price[i] > cur_price THEN
  73. ls_value = "bitmap ('graphics\上升_red.bmp')"
  74. ELSEIF dw_remind.Object.ipv_price[i] = cur_price THEN
  75. ls_value = "bitmap ('graphics\平_dot.bmp')"
  76. ELSE
  77. ls_value = "bitmap ('graphics\下跌_green.bmp')"
  78. END IF
  79. ls_value = dw_remind.Modify('ipv_pic.expression = "'+ls_value+'"')
  80. NEXT
  81. //ELSE
  82. //
  83. //END IF
  84. end event
  85. public subroutine setmtrlid (long arg_mtrlid);cur_mtrlid = arg_mtrlid
  86. end subroutine
  87. public subroutine setprice (decimal arg_price);cur_price = arg_price
  88. end subroutine
  89. public subroutine closethis ();parentwin.CloseUserObject(this)
  90. return
  91. end subroutine
  92. public subroutine wf_retrievemx (string arg_type);this.height = dw_mx.y + dw_mx.height + 5
  93. CHOOSE CASE arg_type
  94. CASE "BUY"
  95. dw_mx.DataObject = 'dw_price_remind_buy'
  96. CASE "BIR"
  97. dw_mx.DataObject = 'dw_price_remind_bir'
  98. CASE ELSE
  99. END CHOOSE
  100. dw_mx.SetTransObject(sqlca)
  101. dw_mx.Retrieve(cur_mtrlid)
  102. end subroutine
  103. on uov_price.create
  104. this.dw_mx=create dw_mx
  105. this.st_1=create st_1
  106. this.dw_remind=create dw_remind
  107. this.Control[]={this.dw_mx,&
  108. this.st_1,&
  109. this.dw_remind}
  110. end on
  111. on uov_price.destroy
  112. destroy(this.dw_mx)
  113. destroy(this.st_1)
  114. destroy(this.dw_remind)
  115. end on
  116. event constructor;dw_remind.settransobject(sqlca)
  117. this.height = dw_remind.y + dw_remind.height + 5
  118. end event
  119. type dw_mx from u_dw_rbtnfilter within uov_price
  120. event mousemove pbm_mousemove
  121. integer y = 348
  122. integer width = 1760
  123. integer height = 536
  124. string dataobject = "dw_price_remind_buy"
  125. boolean hscrollbar = true
  126. boolean vscrollbar = true
  127. boolean hsplitscroll = true
  128. borderstyle borderstyle = stylebox!
  129. end type
  130. event mousemove;//st_1.Text = "X:"+String(xpos)+" Y:"+String(ypos)
  131. ////if xpos = 0 or ypos = 0 or xpos >= this.width - 5 or ypos >= this.height - 5 then
  132. //// messagebox('','超出边界了')
  133. //// CloseThis()
  134. ////end if
  135. ////
  136. ////
  137. //
  138. //If (xpos < 0 Or ypos < 0) Or (xpos >= This.Width Or ypos > This.Height) THEN //not in region
  139. // IF ib_Captured THEN //release mouse
  140. // ib_Captured = False
  141. // ReleaseCapture()
  142. // CloseThis()
  143. // END IF
  144. //ELSEIF GetCapture() <> Handle(This) THEN
  145. // SetCapture(Handle(This))
  146. // ib_Captured = True
  147. //END IF
  148. //
  149. end event
  150. event constructor;//
  151. end event
  152. event doubleclicked;call super::doubleclicked;//messagebox('', '关闭')
  153. //CloseThis()
  154. end event
  155. type st_1 from statictext within uov_price
  156. integer x = 27
  157. integer width = 869
  158. integer height = 72
  159. integer textsize = -9
  160. integer weight = 400
  161. fontcharset fontcharset = gb2312charset!
  162. fontpitch fontpitch = variable!
  163. string facename = "宋体"
  164. long textcolor = 33554432
  165. long backcolor = 67108864
  166. string text = "双击相应字段查询明细"
  167. boolean focusrectangle = false
  168. end type
  169. type dw_remind from u_dw_rbtnfilter within uov_price
  170. event mousemove pbm_mousemove
  171. integer y = 72
  172. integer width = 1760
  173. integer height = 264
  174. string dataobject = "dw_price_remind"
  175. boolean hscrollbar = true
  176. boolean vscrollbar = true
  177. boolean hsplitscroll = true
  178. borderstyle borderstyle = stylebox!
  179. end type
  180. event mousemove;//st_1.Text = "X:"+String(xpos)+" Y:"+String(ypos)
  181. If (xpos < 0 Or ypos < 0) Or (xpos >= This.Width Or ypos > This.Height) THEN //not in region
  182. IF ib_Captured THEN //release mouse
  183. ib_Captured = False
  184. ReleaseCapture()
  185. //CloseThis()
  186. END IF
  187. ELSEIF GetCapture() <> Handle(This) THEN
  188. SetCapture(Handle(This))
  189. ib_Captured = True
  190. END IF
  191. end event
  192. event doubleclicked;call super::doubleclicked;//messagebox('', '关闭')
  193. //CloseThis()
  194. CHOOSE CASE dwo.Name
  195. CASE 'buy_price', 'buy_pic'
  196. wf_retrievemx('BUY')
  197. CASE 'bir_price', 'bir_pic'
  198. wf_retrievemx('BIR')
  199. CASE ELSE
  200. END CHOOSE
  201. end event
  202. event constructor;//
  203. end event