w_storage_loca_ch.srw 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. $PBExportHeader$w_storage_loca_ch.srw
  2. forward
  3. global type w_storage_loca_ch from window
  4. end type
  5. type st_1 from statictext within w_storage_loca_ch
  6. end type
  7. type sle_usual_query from singlelineedit within w_storage_loca_ch
  8. end type
  9. type cb_1 from uo_imflatbutton within w_storage_loca_ch
  10. end type
  11. type r_bar from rectangle within w_storage_loca_ch
  12. end type
  13. type dw_ch from datawindow within w_storage_loca_ch
  14. end type
  15. end forward
  16. global type w_storage_loca_ch from window
  17. integer width = 1143
  18. integer height = 1208
  19. boolean titlebar = true
  20. string title = "仓位号选择"
  21. boolean controlmenu = true
  22. windowtype windowtype = response!
  23. long backcolor = 134217739
  24. string icon = "AppIcon!"
  25. event ue_usual_query_filt ( )
  26. st_1 st_1
  27. sle_usual_query sle_usual_query
  28. cb_1 cb_1
  29. r_bar r_bar
  30. dw_ch dw_ch
  31. end type
  32. global w_storage_loca_ch w_storage_loca_ch
  33. type variables
  34. String rst_str
  35. end variables
  36. event ue_usual_query_filt();String obj_expr = ''
  37. string ls_name
  38. IF Trim(sle_usual_query.Text) <> '' THEN
  39. IF Pos(Trim(sle_usual_query.Text),'%') = 0 THEN
  40. obj_expr = obj_expr+' ( locacode LIKE "%'+Trim(sle_usual_query.Text)+'%")'
  41. ELSE
  42. obj_expr = obj_expr+' ( locacode LIKE "'+Trim(sle_usual_query.Text)+'")'
  43. END IF
  44. END IF
  45. dw_ch.SetFilter(obj_expr)
  46. dw_ch.SetRedraw(FALSE)
  47. dw_ch.Filter()
  48. IF dw_ch.RowCount() >= 1 THEN
  49. dw_ch.SelectRow(0,FALSE)
  50. dw_ch.SelectRow(1,TRUE)
  51. END IF
  52. dw_ch.SetRedraw(TRUE)
  53. end event
  54. on w_storage_loca_ch.create
  55. this.st_1=create st_1
  56. this.sle_usual_query=create sle_usual_query
  57. this.cb_1=create cb_1
  58. this.r_bar=create r_bar
  59. this.dw_ch=create dw_ch
  60. this.Control[]={this.st_1,&
  61. this.sle_usual_query,&
  62. this.cb_1,&
  63. this.r_bar,&
  64. this.dw_ch}
  65. end on
  66. on w_storage_loca_ch.destroy
  67. destroy(this.st_1)
  68. destroy(this.sle_usual_query)
  69. destroy(this.cb_1)
  70. destroy(this.r_bar)
  71. destroy(this.dw_ch)
  72. end on
  73. event open;s_pzwin_open s_win
  74. s_win = Message.PowerObjectParm
  75. environment exerun_env
  76. GetEnvironment(exerun_env )
  77. THIS.X = s_win.arg_x
  78. THIS.Y = s_win.arg_y
  79. //计算窗口位置
  80. IF THIS.X + THIS.Width > PixelsToUnits(exerun_env.ScreenWidth, XPixelsToUnits!) THEN
  81. THIS.X = PixelsToUnits(exerun_env.ScreenWidth, XPixelsToUnits!) - THIS.Width
  82. END IF
  83. IF THIS.Y + THIS.Height > PixelsToUnits(exerun_env.ScreenHeight, XPixelsToUnits!) - 350 THEN
  84. THIS.Y = PixelsToUnits(exerun_env.ScreenHeight, XPixelsToUnits!) - THIS.Height - 350
  85. END IF
  86. dw_ch.SetTransObject(sqlca)
  87. dw_ch.Retrieve(s_win.arg_mtrlid)
  88. end event
  89. event close;CloseWithReturn(THIS,rst_str)
  90. end event
  91. event resize;r_bar.width = this.width
  92. end event
  93. type st_1 from statictext within w_storage_loca_ch
  94. integer x = 9
  95. integer y = 24
  96. integer width = 210
  97. integer height = 56
  98. integer textsize = -9
  99. integer weight = 400
  100. fontcharset fontcharset = gb2312charset!
  101. fontpitch fontpitch = variable!
  102. string facename = "宋体"
  103. long textcolor = 33554432
  104. long backcolor = 134217739
  105. string text = "内容含:"
  106. alignment alignment = right!
  107. boolean focusrectangle = false
  108. end type
  109. type sle_usual_query from singlelineedit within w_storage_loca_ch
  110. event keyup pbm_keyup
  111. integer x = 224
  112. integer y = 12
  113. integer width = 507
  114. integer height = 84
  115. integer taborder = 10
  116. integer textsize = -9
  117. integer weight = 400
  118. fontcharset fontcharset = gb2312charset!
  119. fontpitch fontpitch = variable!
  120. string facename = "宋体"
  121. long textcolor = 33554432
  122. borderstyle borderstyle = stylelowered!
  123. end type
  124. event keyup;PARENT.TRIGGEREVENT("ue_usual_query_filt")
  125. end event
  126. type cb_1 from uo_imflatbutton within w_storage_loca_ch
  127. integer y = 120
  128. integer width = 110
  129. integer height = 96
  130. integer taborder = 10
  131. string text = ""
  132. boolean cancel = true
  133. string normalpicname = "exit.bmp"
  134. integer picsize = 16
  135. boolean border = false
  136. end type
  137. event clicked;call super::clicked;rst_str = ''
  138. Close(PARENT)
  139. end event
  140. type r_bar from rectangle within w_storage_loca_ch
  141. boolean visible = false
  142. long linecolor = 16777215
  143. integer linethickness = 4
  144. long fillcolor = 1073741824
  145. integer x = 402
  146. integer width = 146
  147. integer height = 104
  148. end type
  149. event constructor;this.fillcolor = 14215660
  150. this.linecolor = 14215660
  151. this.x = -1
  152. this.y = -1
  153. this.height = dw_ch.y - 5
  154. end event
  155. type dw_ch from datawindow within w_storage_loca_ch
  156. event ue_mousemove pbm_dwnmousemove
  157. integer y = 104
  158. integer width = 1120
  159. integer height = 1016
  160. integer taborder = 10
  161. boolean bringtotop = true
  162. string title = "none"
  163. string dataobject = "dw_storage_loca_ch"
  164. boolean hscrollbar = true
  165. boolean vscrollbar = true
  166. boolean livescroll = true
  167. borderstyle borderstyle = stylelowered!
  168. end type
  169. event ue_mousemove;IF row > 0 THEN
  170. THIS.SelectRow(0,FALSE)
  171. THIS.SelectRow(row,TRUE)
  172. END IF
  173. end event
  174. event clicked;IF row > 0 THEN
  175. THIS.SelectRow(0,FALSE)
  176. THIS.SelectRow(row,TRUE)
  177. rst_str = dw_ch.object.locacode[row]
  178. END IF
  179. Close(PARENT)
  180. end event
  181. event constructor;f_title_change(this)
  182. end event