w_aifmb_index_book.srw 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  1. $PBExportHeader$w_aifmb_index_book.srw
  2. forward
  3. global type w_aifmb_index_book from window
  4. end type
  5. type tv_1 from uo_aifmb_tv_class within w_aifmb_index_book
  6. end type
  7. type cb_exit from uo_imflatbutton within w_aifmb_index_book
  8. end type
  9. type cb_reflash from uo_imflatbutton within w_aifmb_index_book
  10. end type
  11. type cb_del from commandbutton within w_aifmb_index_book
  12. end type
  13. type cb_add from commandbutton within w_aifmb_index_book
  14. end type
  15. type dw_2 from u_dw_rbtnfilter within w_aifmb_index_book
  16. end type
  17. type dw_1 from u_dw_rbtnfilter within w_aifmb_index_book
  18. end type
  19. type cb_ok from uo_imflatbutton within w_aifmb_index_book
  20. end type
  21. type ln_bar from line within w_aifmb_index_book
  22. end type
  23. type ln_bar2 from line within w_aifmb_index_book
  24. end type
  25. type r_bar from rectangle within w_aifmb_index_book
  26. end type
  27. end forward
  28. global type w_aifmb_index_book from window
  29. integer width = 3141
  30. integer height = 1744
  31. boolean titlebar = true
  32. string title = "指数订阅"
  33. boolean controlmenu = true
  34. boolean minbox = true
  35. windowtype windowtype = popup!
  36. long backcolor = 67108864
  37. string icon = "AppIcon!"
  38. boolean center = true
  39. event ue_retrieve ( )
  40. tv_1 tv_1
  41. cb_exit cb_exit
  42. cb_reflash cb_reflash
  43. cb_del cb_del
  44. cb_add cb_add
  45. dw_2 dw_2
  46. dw_1 dw_1
  47. cb_ok cb_ok
  48. ln_bar ln_bar
  49. ln_bar2 ln_bar2
  50. r_bar r_bar
  51. end type
  52. global w_aifmb_index_book w_aifmb_index_book
  53. type variables
  54. long ins_nodeid_arr[]
  55. boolean can_retrieve = false
  56. end variables
  57. event ue_retrieve();IF UpperBound(ins_nodeid_arr) = 0 THEN
  58. ins_nodeid_arr[1] = -1
  59. END IF
  60. IF can_retrieve THEN
  61. dw_1.Retrieve(ins_nodeid_arr)
  62. END IF
  63. end event
  64. on w_aifmb_index_book.create
  65. this.tv_1=create tv_1
  66. this.cb_exit=create cb_exit
  67. this.cb_reflash=create cb_reflash
  68. this.cb_del=create cb_del
  69. this.cb_add=create cb_add
  70. this.dw_2=create dw_2
  71. this.dw_1=create dw_1
  72. this.cb_ok=create cb_ok
  73. this.ln_bar=create ln_bar
  74. this.ln_bar2=create ln_bar2
  75. this.r_bar=create r_bar
  76. this.Control[]={this.tv_1,&
  77. this.cb_exit,&
  78. this.cb_reflash,&
  79. this.cb_del,&
  80. this.cb_add,&
  81. this.dw_2,&
  82. this.dw_1,&
  83. this.cb_ok,&
  84. this.ln_bar,&
  85. this.ln_bar2,&
  86. this.r_bar}
  87. end on
  88. on w_aifmb_index_book.destroy
  89. destroy(this.tv_1)
  90. destroy(this.cb_exit)
  91. destroy(this.cb_reflash)
  92. destroy(this.cb_del)
  93. destroy(this.cb_add)
  94. destroy(this.dw_2)
  95. destroy(this.dw_1)
  96. destroy(this.cb_ok)
  97. destroy(this.ln_bar)
  98. destroy(this.ln_bar2)
  99. destroy(this.r_bar)
  100. end on
  101. event resize;ln_bar.EndX = This.Width
  102. ln_bar2.EndX = This.Width
  103. r_bar.Width = This.Width
  104. tv_1.Height = This.WorkSpaceHeight() - tv_1.Y
  105. dw_1.Width = This.WorkSpaceWidth() - dw_1.X
  106. long deltaX
  107. long deltaY
  108. deltaX = This.WorkSpaceWidth() - dw_1.X - dw_1.Width
  109. deltaY = This.WorkSpaceHeight() - dw_2.Y - dw_2.Height
  110. dw_1.Width = dw_1.Width + deltaX
  111. dw_1.Height = dw_1.Height + deltaY
  112. cb_add.X = cb_add.X + deltaX
  113. cb_add.Y = cb_add.Y + deltaY
  114. cb_del.X = cb_del.X + deltaX
  115. cb_del.Y = cb_del.Y + deltaY
  116. dw_2.Width = dw_1.Width
  117. dw_2.Y = dw_2.Y + deltaY
  118. end event
  119. event open;Int rslt = 1
  120. String arg_msg
  121. uo_aifmb lo_aifmb
  122. lo_aifmb = Create uo_aifmb
  123. dw_1.SetTransObject(sqlca)
  124. dw_2.SetTransObject(sqlca)
  125. can_retrieve = true
  126. //IF lo_aifmb.uf_sync_node(arg_msg) <> 1 THEN
  127. // rslt = 0
  128. // GOTO ext
  129. //END IF
  130. IF lo_aifmb.uf_getindexdefinelist(arg_msg) <> 1 THEN
  131. rslt = 0
  132. GOTO ext
  133. END IF
  134. //tv_1.InsertItemLast(0, '指数', 1)
  135. //cb_reflash.TriggerEvent(Clicked!)
  136. dw_2.Retrieve()
  137. triggerevent('ue_retrieve')
  138. goto ext
  139. ext:
  140. Destroy lo_aifmb
  141. IF rslt = 0 THEN
  142. MessageBox('ERROR', arg_msg)
  143. cb_exit.PostEvent(Clicked!)
  144. END IF
  145. end event
  146. type tv_1 from uo_aifmb_tv_class within w_aifmb_index_book
  147. event destroy ( )
  148. integer y = 184
  149. integer width = 827
  150. integer taborder = 40
  151. boolean uo_withindex = true
  152. end type
  153. on tv_1.destroy
  154. call uo_aifmb_tv_class::destroy
  155. end on
  156. event ue_selectionchanged;call super::ue_selectionchanged;ins_nodeid_arr = uo_nodeid_arr
  157. //IF uo_keyword <> '' THEN
  158. // sle_keyword.Text = uo_keyword
  159. //END IF
  160. parent.triggerevent('ue_retrieve')
  161. end event
  162. type cb_exit from uo_imflatbutton within w_aifmb_index_book
  163. integer x = 320
  164. integer width = 151
  165. integer height = 164
  166. integer taborder = 30
  167. string text = "退出"
  168. boolean cancel = true
  169. string normalpicname = "exit.BMP"
  170. integer picsize = 16
  171. toolbaralignment pic_align = alignattop!
  172. boolean border = false
  173. end type
  174. event clicked;call super::clicked;Close(PARENT)
  175. end event
  176. type cb_reflash from uo_imflatbutton within w_aifmb_index_book
  177. integer x = 160
  178. integer width = 151
  179. integer height = 164
  180. integer taborder = 20
  181. string text = "刷新"
  182. string normalpicname = "refresh.bmp"
  183. integer picsize = 16
  184. toolbaralignment pic_align = alignattop!
  185. boolean border = false
  186. end type
  187. event clicked;call super::clicked;tv_1.uf_build_tree()
  188. end event
  189. type cb_del from commandbutton within w_aifmb_index_book
  190. integer x = 2821
  191. integer y = 880
  192. integer width = 265
  193. integer height = 84
  194. integer taborder = 50
  195. integer textsize = -9
  196. integer weight = 400
  197. fontcharset fontcharset = gb2312charset!
  198. fontpitch fontpitch = variable!
  199. string facename = "宋体"
  200. string text = "删除"
  201. end type
  202. event clicked;Long i
  203. FOR i = dw_2.RowCount() To 1 Step -1
  204. IF dw_2.IsSelected(i) THEN
  205. dw_2.DeleteRow(i)
  206. END IF
  207. NEXT
  208. end event
  209. type cb_add from commandbutton within w_aifmb_index_book
  210. integer x = 2528
  211. integer y = 880
  212. integer width = 265
  213. integer height = 84
  214. integer taborder = 40
  215. integer textsize = -9
  216. integer weight = 400
  217. fontcharset fontcharset = gb2312charset!
  218. fontpitch fontpitch = variable!
  219. string facename = "宋体"
  220. string text = "添加"
  221. end type
  222. event clicked;Long i
  223. FOR i = 1 To dw_1.RowCount()
  224. IF dw_1.IsSelected(i) THEN
  225. IF dw_2.Find('indexid = ' + String(dw_1.Object.indexid[i]), 1, dw_2.RowCount()) > 0 THEN CONTINUE
  226. dw_1.RowsCopy(i, i, Primary!, dw_2, dw_2.RowCount() + 1, Primary!)
  227. dw_1.SelectRow(i, False)
  228. END IF
  229. NEXT
  230. end event
  231. type dw_2 from u_dw_rbtnfilter within w_aifmb_index_book
  232. integer x = 841
  233. integer y = 984
  234. integer width = 2254
  235. integer height = 664
  236. integer taborder = 40
  237. boolean bringtotop = true
  238. string dataobject = "dw_aifmb_index_book_ch"
  239. boolean hscrollbar = true
  240. boolean vscrollbar = true
  241. boolean hsplitscroll = true
  242. end type
  243. event clicked;call super::clicked;IF row > 0 THEN
  244. This.SelectRow(row, Not This.IsSelected(row))
  245. END IF
  246. end event
  247. type dw_1 from u_dw_rbtnfilter within w_aifmb_index_book
  248. integer x = 841
  249. integer y = 184
  250. integer width = 2263
  251. integer height = 664
  252. integer taborder = 30
  253. boolean bringtotop = true
  254. string dataobject = "dw_aifmb_index_book"
  255. boolean hscrollbar = true
  256. boolean vscrollbar = true
  257. boolean hsplitscroll = true
  258. end type
  259. event clicked;call super::clicked;IF row > 0 THEN
  260. This.SelectRow(row, Not This.IsSelected(row))
  261. END IF
  262. end event
  263. type cb_ok from uo_imflatbutton within w_aifmb_index_book
  264. integer width = 151
  265. integer height = 164
  266. integer taborder = 10
  267. string text = "提交"
  268. string normalpicname = "ok.bmp"
  269. integer picsize = 16
  270. toolbaralignment pic_align = alignattop!
  271. boolean border = false
  272. end type
  273. event clicked;call super::clicked;Int rslt = 1
  274. String arg_msg = ''
  275. uo_aifmb lo_aifmb
  276. lo_aifmb = Create uo_aifmb
  277. s_aifmb_indexbookinfo s_indexes[]
  278. Long i = 0
  279. FOR i = 1 To dw_2.RowCount()
  280. s_indexes[i].IndexID = dw_2.Object.IndexID[i]
  281. s_indexes[i].StartTime = dw_2.Object.bookbegindate[i]
  282. s_indexes[i].EndTime = dw_2.Object.bookenddate[i]
  283. s_indexes[i].BookType = 0
  284. NEXT
  285. IF lo_aifmb.uf_bookindexes(s_indexes, arg_msg) <> 1 THEN
  286. rslt = 0
  287. GOTO ext
  288. END IF
  289. ext:
  290. Destroy lo_aifmb
  291. IF rslt = 0 THEN
  292. MessageBox('ERROR', arg_msg)
  293. ELSE
  294. MessageBox('OK', '提交成功')
  295. Close(Parent)
  296. END IF
  297. end event
  298. type ln_bar from line within w_aifmb_index_book
  299. long linecolor = 268435456
  300. integer linethickness = 4
  301. integer beginy = 172
  302. integer endx = 2007
  303. integer endy = 172
  304. end type
  305. type ln_bar2 from line within w_aifmb_index_book
  306. long linecolor = 16777215
  307. integer linethickness = 4
  308. integer beginy = 176
  309. integer endx = 2039
  310. integer endy = 176
  311. end type
  312. type r_bar from rectangle within w_aifmb_index_book
  313. long linecolor = 16777215
  314. integer linethickness = 4
  315. long fillcolor = 1073741824
  316. integer x = 2089
  317. integer width = 146
  318. integer height = 68
  319. end type
  320. event constructor;this.fillcolor = 14215660
  321. this.linecolor = 14215660
  322. this.x = -1
  323. this.y = -1
  324. this.height = ln_bar.beginy - 5
  325. end event