w_order_ml_pro_ch.srw 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. $PBExportHeader$w_order_ml_pro_ch.srw
  2. forward
  3. global type w_order_ml_pro_ch from w_publ_base
  4. end type
  5. type dw_1 from u_dw_rbtnfilter within w_order_ml_pro_ch
  6. end type
  7. type cb_ch from uo_imflatbutton within w_order_ml_pro_ch
  8. end type
  9. type cbx_1 from checkbox within w_order_ml_pro_ch
  10. end type
  11. type cbx_all from checkbox within w_order_ml_pro_ch
  12. end type
  13. end forward
  14. global type w_order_ml_pro_ch from w_publ_base
  15. integer width = 2761
  16. integer height = 2304
  17. string title = "计划工序选择"
  18. boolean minbox = false
  19. windowtype windowtype = response!
  20. dw_1 dw_1
  21. cb_ch cb_ch
  22. cbx_1 cbx_1
  23. cbx_all cbx_all
  24. end type
  25. global w_order_ml_pro_ch w_order_ml_pro_ch
  26. type variables
  27. s_saletaskmx s_order_open
  28. s_order_ml_workprice_array s_select
  29. Boolean if_changeselect = TRUE
  30. Int if_mlselect = 0
  31. end variables
  32. on w_order_ml_pro_ch.create
  33. int iCurrent
  34. call super::create
  35. this.dw_1=create dw_1
  36. this.cb_ch=create cb_ch
  37. this.cbx_1=create cbx_1
  38. this.cbx_all=create cbx_all
  39. iCurrent=UpperBound(this.Control)
  40. this.Control[iCurrent+1]=this.dw_1
  41. this.Control[iCurrent+2]=this.cb_ch
  42. this.Control[iCurrent+3]=this.cbx_1
  43. this.Control[iCurrent+4]=this.cbx_all
  44. end on
  45. on w_order_ml_pro_ch.destroy
  46. call super::destroy
  47. destroy(this.dw_1)
  48. destroy(this.cb_ch)
  49. destroy(this.cbx_1)
  50. destroy(this.cbx_all)
  51. end on
  52. event open;call super::open;s_order_open = Message.PowerObjectParm
  53. IF s_order_open.if_select_any = 0 THEN
  54. cbx_1.Enabled = FALSE
  55. if_mlselect = 0
  56. cbx_1.Checked = FALSE
  57. cbx_all.Enabled = FALSE
  58. ELSE
  59. cbx_1.Enabled = TRUE
  60. END IF
  61. dw_1.SetTransObject(sqlca)
  62. dw_1.Retrieve(s_order_open.scid,s_order_open.taskid,s_order_open.printid)
  63. end event
  64. event close;call super::close;CloseWithReturn(THIS,s_select)
  65. end event
  66. type cb_func from w_publ_base`cb_func within w_order_ml_pro_ch
  67. boolean visible = false
  68. integer y = 1404
  69. boolean enabled = false
  70. end type
  71. type cb_exit from w_publ_base`cb_exit within w_order_ml_pro_ch
  72. integer x = 1431
  73. integer y = 2096
  74. integer width = 302
  75. string text = "取消"
  76. end type
  77. type dw_1 from u_dw_rbtnfilter within w_order_ml_pro_ch
  78. integer width = 2738
  79. integer height = 2076
  80. boolean bringtotop = true
  81. string title = "none"
  82. string dataobject = "dw_order_ml_pro_ch"
  83. boolean hscrollbar = true
  84. boolean vscrollbar = true
  85. end type
  86. event rowfocuschanged;call super::rowfocuschanged;if if_mlselect=1 then
  87. if currentrow <=0 then return
  88. if keydown(keycontrol!) then
  89. if this.isselected(currentrow) then
  90. this.selectrow(currentrow,false)
  91. if_changeselect=false
  92. else
  93. if_changeselect=true
  94. end if
  95. else
  96. if not this.isselected(currentrow) then
  97. this.selectrow(currentrow,true)
  98. if_changeselect=false
  99. else
  100. if_changeselect=true
  101. end if
  102. end if
  103. else
  104. if dw_edit_mode then return
  105. if currentrow <=0 then return
  106. this.selectrow(0,false)
  107. this.selectrow(currentrow,true)
  108. end if
  109. end event
  110. event doubleclicked;call super::doubleclicked;cb_ch.PostEvent(Clicked!)
  111. end event
  112. event clicked;call super::clicked;if row>0 then
  113. this.setrow(row)
  114. if if_mlselect=1 then
  115. if if_changeselect then
  116. this.selectrow(row,not this.IsSelected(row))
  117. else
  118. if_changeselect=true
  119. end if
  120. else
  121. this.selectrow(0,false)
  122. this.selectrow(row,true)
  123. end if
  124. end if
  125. end event
  126. type cb_ch from uo_imflatbutton within w_order_ml_pro_ch
  127. integer x = 997
  128. integer y = 2096
  129. integer height = 96
  130. integer taborder = 20
  131. boolean bringtotop = true
  132. string text = "选择"
  133. string normalpicname = "ok.bmp"
  134. end type
  135. event clicked;call super::clicked;Long LS_ROW,ll_i,chc = 0
  136. LS_ROW = dw_1.GetRow()
  137. IF LS_ROW <= 0 THEN
  138. MessageBox('系统提示','请先选择目标行!',StopSign!)
  139. RETURN
  140. END IF
  141. FOR ll_i = 1 TO dw_1.RowCount()
  142. IF dw_1.IsSelected(ll_i) THEN
  143. chc++
  144. s_select.procode[chc] = dw_1.Object.u_orderrqwp_procode[ll_i]
  145. s_select.proname[chc] = dw_1.Object.u_orderrqwp_proname[ll_i]
  146. s_select.workprice[chc] = dw_1.Object.u_orderrqwp_workprice[ll_i]
  147. s_select.status[chc] = dw_1.Object.status[ll_i]
  148. s_select.proorder[chc] = dw_1.Object.u_orderrqwp_proorder[ll_i]
  149. s_select.proqty[chc] = dw_1.Object.u_orderrqwp_proqty[ll_i]
  150. END IF
  151. NEXT
  152. IF chc = 0 THEN
  153. MessageBox('系统提示','请至少选择一个目标行!',StopSign!)
  154. RETURN
  155. END IF
  156. Close(PARENT)
  157. end event
  158. type cbx_1 from checkbox within w_order_ml_pro_ch
  159. integer x = 27
  160. integer y = 2092
  161. integer width = 251
  162. integer height = 92
  163. boolean bringtotop = true
  164. integer textsize = -9
  165. integer weight = 400
  166. fontcharset fontcharset = gb2312charset!
  167. fontpitch fontpitch = variable!
  168. string facename = "宋体"
  169. long textcolor = 33554432
  170. long backcolor = 134217739
  171. string text = "多选"
  172. end type
  173. event clicked;if this.checked then
  174. if_mlselect=1
  175. cbx_all.enabled = true
  176. else
  177. if_mlselect=0
  178. cbx_all.enabled = false
  179. cbx_all.checked = false
  180. long li
  181. FOR li = 1 TO dw_1.RowCount()
  182. dw_1.SelectRow(li,FALSE)
  183. NEXT
  184. end if
  185. SetProfileString (sys_inifilename,dw_1.DataObject, "if_mlselect", String(if_mlselect))
  186. end event
  187. event constructor;if_mlselect=integer(ProfileString (sys_inifilename,dw_1.DATAOBJECT, "if_mlselect", '0'))
  188. if if_mlselect =0 then
  189. this.checked=false
  190. else
  191. this.checked=true
  192. cbx_all.enabled = true
  193. end if
  194. end event
  195. type cbx_all from checkbox within w_order_ml_pro_ch
  196. integer x = 233
  197. integer y = 2092
  198. integer width = 251
  199. integer height = 92
  200. boolean bringtotop = true
  201. integer textsize = -9
  202. integer weight = 400
  203. fontcharset fontcharset = gb2312charset!
  204. fontpitch fontpitch = variable!
  205. string facename = "宋体"
  206. long textcolor = 33554432
  207. long backcolor = 134217739
  208. boolean enabled = false
  209. string text = "全选"
  210. end type
  211. event clicked;IF dw_1.RowCount() <= 0 THEN RETURN
  212. Long li
  213. IF THIS.Checked THEN
  214. FOR li = 1 TO dw_1.RowCount()
  215. dw_1.SelectRow(li,TRUE)
  216. NEXT
  217. ELSE
  218. FOR li = 1 TO dw_1.RowCount()
  219. dw_1.SelectRow(li,FALSE)
  220. NEXT
  221. END IF
  222. end event