w_props_ch.srw 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. $PBExportHeader$w_props_ch.srw
  2. forward
  3. global type w_props_ch from window
  4. end type
  5. type st_1 from statictext within w_props_ch
  6. end type
  7. type sle_usual_query from singlelineedit within w_props_ch
  8. end type
  9. type cb_1 from uo_imflatbutton within w_props_ch
  10. end type
  11. type r_bar from rectangle within w_props_ch
  12. end type
  13. type dw_ch from datawindow within w_props_ch
  14. end type
  15. end forward
  16. global type w_props_ch from window
  17. integer width = 1394
  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_props_ch w_props_ch
  32. type variables
  33. String rst_str
  34. end variables
  35. event ue_usual_query_filt();String obj_expr = ''
  36. string ls_name = 'proname'
  37. IF Trim(sle_usual_query.Text) <> '' THEN
  38. IF Pos(Trim(sle_usual_query.Text),'%') = 0 THEN
  39. obj_expr = obj_expr+' ('+ls_name+' LIKE "%'+Trim(sle_usual_query.Text)+'%")'
  40. ELSE
  41. obj_expr = obj_expr+' ('+ls_name+' LIKE "'+Trim(sle_usual_query.Text)+'")'
  42. END IF
  43. END IF
  44. dw_ch.SetFilter(obj_expr)
  45. dw_ch.SetRedraw(FALSE)
  46. dw_ch.Filter()
  47. IF dw_ch.RowCount() >= 1 THEN
  48. dw_ch.SelectRow(0,FALSE)
  49. dw_ch.SelectRow(1,TRUE)
  50. END IF
  51. dw_ch.SetRedraw(TRUE)
  52. end event
  53. on w_props_ch.create
  54. this.st_1=create st_1
  55. this.sle_usual_query=create sle_usual_query
  56. this.cb_1=create cb_1
  57. this.r_bar=create r_bar
  58. this.dw_ch=create dw_ch
  59. this.Control[]={this.st_1,&
  60. this.sle_usual_query,&
  61. this.cb_1,&
  62. this.r_bar,&
  63. this.dw_ch}
  64. end on
  65. on w_props_ch.destroy
  66. destroy(this.st_1)
  67. destroy(this.sle_usual_query)
  68. destroy(this.cb_1)
  69. destroy(this.r_bar)
  70. destroy(this.dw_ch)
  71. end on
  72. event open;s_props_openwin s_win
  73. s_win = Message.PowerObjectParm
  74. environment exerun_env
  75. GetEnvironment(exerun_env )
  76. This.X = s_win.arg_x
  77. This.Y = s_win.arg_y
  78. //计算窗口位置
  79. IF This.X + This.Width > PixelsToUnits(exerun_env.ScreenWidth, XPixelsToUnits!) THEN
  80. This.X = PixelsToUnits(exerun_env.ScreenWidth, XPixelsToUnits!) - This.Width
  81. END IF
  82. IF This.Y + This.Height > PixelsToUnits(exerun_env.ScreenHeight, XPixelsToUnits!) - 350 THEN
  83. This.Y = PixelsToUnits(exerun_env.ScreenHeight, XPixelsToUnits!) - This.Height - 350
  84. END IF
  85. String parms[], parm[]
  86. Long i, ll_row
  87. uo_strhelper uo_str
  88. uo_str = Create uo_strhelper
  89. uo_str.split(s_win.props, ";", parms)
  90. FOR i = 1 To UpperBound(parms)
  91. uo_str.split(parms[i], ":", parm)
  92. IF parm[1] <> '' THEN
  93. ll_row = dw_ch.InsertRow(0)
  94. dw_ch.Object.proname[ll_row] = parm[1]
  95. END IF
  96. NEXT
  97. dw_ch.SetFocus()
  98. SetNull(rst_str)
  99. end event
  100. event close;CloseWithReturn(THIS,rst_str)
  101. end event
  102. event resize;r_bar.width = this.width
  103. end event
  104. type st_1 from statictext within w_props_ch
  105. integer x = 9
  106. integer y = 24
  107. integer width = 210
  108. integer height = 56
  109. integer textsize = -9
  110. integer weight = 400
  111. fontcharset fontcharset = gb2312charset!
  112. fontpitch fontpitch = variable!
  113. string facename = "宋体"
  114. long textcolor = 33554432
  115. long backcolor = 134217739
  116. string text = "内容含:"
  117. alignment alignment = right!
  118. boolean focusrectangle = false
  119. end type
  120. type sle_usual_query from singlelineedit within w_props_ch
  121. event keyup pbm_keyup
  122. integer x = 224
  123. integer y = 12
  124. integer width = 507
  125. integer height = 84
  126. integer taborder = 10
  127. integer textsize = -9
  128. integer weight = 400
  129. fontcharset fontcharset = gb2312charset!
  130. fontpitch fontpitch = variable!
  131. string facename = "宋体"
  132. long textcolor = 33554432
  133. borderstyle borderstyle = stylelowered!
  134. end type
  135. event keyup;PARENT.TRIGGEREVENT("ue_usual_query_filt")
  136. end event
  137. type cb_1 from uo_imflatbutton within w_props_ch
  138. integer y = 120
  139. integer width = 110
  140. integer height = 96
  141. integer taborder = 30
  142. string text = ""
  143. boolean cancel = true
  144. string normalpicname = "exit.bmp"
  145. integer picsize = 16
  146. boolean border = false
  147. end type
  148. event clicked;call super::clicked;rst_str = ''
  149. Close(PARENT)
  150. end event
  151. type r_bar from rectangle within w_props_ch
  152. boolean visible = false
  153. long linecolor = 16777215
  154. integer linethickness = 4
  155. long fillcolor = 1073741824
  156. integer x = 402
  157. integer width = 146
  158. integer height = 104
  159. end type
  160. event constructor;this.fillcolor = 14215660
  161. this.linecolor = 14215660
  162. this.x = -1
  163. this.y = -1
  164. this.height = dw_ch.y - 5
  165. end event
  166. type dw_ch from datawindow within w_props_ch
  167. event ue_mousemove pbm_dwnmousemove
  168. event dwnkey pbm_dwnkey
  169. integer y = 104
  170. integer width = 1376
  171. integer height = 1016
  172. integer taborder = 20
  173. boolean bringtotop = true
  174. string title = "none"
  175. string dataobject = "dw_props_ch"
  176. boolean hscrollbar = true
  177. boolean vscrollbar = true
  178. boolean livescroll = true
  179. borderstyle borderstyle = stylelowered!
  180. end type
  181. event ue_mousemove;IF row > 0 THEN
  182. THIS.SelectRow(0,FALSE)
  183. THIS.SelectRow(row,TRUE)
  184. END IF
  185. end event
  186. event dwnkey;IF Key = KeyEnter! THEN
  187. Long row
  188. row = THIS.GetRow()
  189. IF row > 0 THEN
  190. THIS.SelectRow(0,FALSE)
  191. THIS.SelectRow(row,TRUE)
  192. String ls_column1_name
  193. ls_column1_name = THIS.Describe("#1.name")
  194. rst_str = THIS.GetItemString(row,ls_column1_name)
  195. Close(PARENT)
  196. END IF
  197. ELSE
  198. IF NOT KeyDown(keydownarrow!) and NOT KeyDown(keyuparrow!) THEN
  199. sle_usual_query.SetFocus()
  200. END IF
  201. END IF
  202. end event
  203. event clicked;IF row > 0 THEN
  204. THIS.SelectRow(0,FALSE)
  205. THIS.SelectRow(row,TRUE)
  206. String ls_column1_name
  207. ls_column1_name = THIS.Describe("#1.name")
  208. rst_str = THIS.GetItemString(row,ls_column1_name)
  209. END IF
  210. Close(PARENT)
  211. end event
  212. event constructor;f_title_change(this)
  213. end event
  214. event rowfocuschanged; IF currentrow <= 0 THEN RETURN
  215. THIS.SelectRow(0,FALSE)
  216. THIS.SelectRow(currentrow,TRUE)
  217. end event