w_pz_ch.srw 5.4 KB

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