u_function_panel.sru 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837
  1. $PBExportHeader$u_function_panel.sru
  2. $PBExportComments$By PBKiller v2.5.18(http://kivens.nease.net)
  3. forward
  4. global type u_function_panel from userobject
  5. end type
  6. type tv_function from treeview within u_function_panel
  7. end type
  8. type st_funcarea from statictext within u_function_panel
  9. end type
  10. type ddplb_module from dropdownpicturelistbox within u_function_panel
  11. end type
  12. end forward
  13. global type u_function_panel from userobject
  14. integer width = 997
  15. integer height = 1584
  16. long backcolor = 67108864
  17. string text = "none"
  18. long tabtextcolor = 33554432
  19. long picturemaskcolor = 536870912
  20. event ue_clickbutton ( )
  21. event ue_doubleclickfunc ( )
  22. event ue_clickfunc ( )
  23. event ue_getfindtext ( )
  24. event ue_find ( string arg_str )
  25. tv_function tv_function
  26. st_funcarea st_funcarea
  27. ddplb_module ddplb_module
  28. end type
  29. global u_function_panel u_function_panel
  30. type variables
  31. public window iw_parent
  32. public integer ii_group_height = 66
  33. public u_function_button iuo_button[]
  34. public u_function_list iuo_list[]
  35. public integer ii_usrgroup_count = 12
  36. public integer ii_curgroup = 1
  37. public LONG iL_curROWNO = 0
  38. public string is_groupclicked
  39. public string is_funcdoubleclicked
  40. public string is_funcselected
  41. public string is_selectedid
  42. public string is_displayid = "N"
  43. public string is_smallicon = "N"
  44. public string is_ddplb
  45. public string is_msg
  46. public boolean ib_sort = false
  47. public datastore ids_function
  48. public datastore ids_module
  49. public string is_groupid[]
  50. public boolean ib_panel = true
  51. public integer ii_selindex
  52. public string is_regkey
  53. public string rootid = "00"
  54. public string all_panel = '全部模块(面板)'
  55. public string all_tree = '全部模块(树)'
  56. string col_module_ogmid = 'ogmid'
  57. string col_module_ogmname = 'ogmname'
  58. string col_module_ogmpid = 'ogmpid'
  59. string col_function_ogfid = 'ogfid'
  60. string col_function_efid = 'efid'
  61. string col_function_efname = 'efname'
  62. string col_function_efuppict = 'efuppict'
  63. string col_function_efdnpict = 'efdnpict'
  64. string col_function_ogfmid = 'ogfmid'
  65. string system_path = ''
  66. private string findstr = ''
  67. end variables
  68. forward prototypes
  69. public subroutine of_buildtreeview (string v_pcode, integer v_handle, boolean v_flag)
  70. public subroutine of_changedisplay (boolean val)
  71. public function integer of_init ()
  72. public subroutine of_insertfunction (integer v_handle)
  73. public function integer of_movegroup_all ()
  74. public subroutine of_refreshlist (integer idx)
  75. public subroutine of_resettreeview ()
  76. public function integer of_resize (integer ai_width,integer ai_height)
  77. public function integer of_set_eventname (string as_groupclicked,string as_funcselected,string as_funcdoubleclicked)
  78. public subroutine of_setbkcolor ()
  79. public subroutine of_setpanelvisible (boolean val)
  80. public subroutine of_settextcolor ()
  81. public subroutine of_showhelp (integer ai_row)
  82. end prototypes
  83. event ue_clickbutton();of_movegroup_all()
  84. iw_parent.triggerevent(is_groupclicked)
  85. end event
  86. event ue_doubleclickfunc();
  87. if f_str_isnull(is_selectedid) then
  88. return
  89. end if
  90. ids_function.setfilter("")
  91. ids_function.filter()
  92. ids_function.sort()
  93. iL_curROWNO = ids_function.find(col_function_efid+"='" + is_selectedid + "'",1,ids_function.rowcount())
  94. if iL_curROWNO > 0 then
  95. iw_parent.triggerevent(is_funcdoubleclicked)
  96. end if
  97. end event
  98. event ue_clickfunc();integer li_row
  99. if f_str_isnull(is_selectedid) then
  100. return
  101. end if
  102. ids_function.setfilter("")
  103. ids_function.filter()
  104. ids_function.sort()
  105. li_row = ids_function.find(col_function_efid+"='" + is_selectedid + "'",1,ids_function.rowcount())
  106. if li_row > 0 then
  107. iw_parent.triggerevent(is_funcselected)
  108. end if
  109. end event
  110. event ue_getfindtext();OpenWithParm(w_xls_gettext,findstr)
  111. string str
  112. str = message.stringparm
  113. this.event ue_find(str)
  114. end event
  115. event ue_find(string arg_str);findstr = arg_str
  116. IF ib_panel THEN
  117. IF ii_curgroup >= 1 And ii_curgroup <= UpperBound(iuo_list) THEN
  118. IF IsValid(iuo_list[ii_curgroup]) THEN
  119. iuo_list[ii_curgroup].event ue_find(arg_str)
  120. END IF
  121. END IF
  122. ELSE
  123. tv_function.event ue_find(arg_str)
  124. END IF
  125. end event
  126. public subroutine of_buildtreeview (string v_pcode, integer v_handle, boolean v_flag);integer li_row
  127. integer l_handle
  128. integer li_cnt
  129. integer l_parent
  130. treeviewitem l_tvi
  131. string ls_code
  132. li_cnt = ids_module.rowcount()
  133. if v_handle = 0 then
  134. of_resettreeview()
  135. if v_pcode <> rootid then
  136. li_row = ids_module.find(col_module_ogmid+"='" + v_pcode + "'",1,li_cnt)
  137. if li_row > 0 then
  138. l_tvi.label = trim(ids_module.GetItemString(li_row,col_module_ogmname) )
  139. else
  140. l_tvi.label = "功能"
  141. end if
  142. l_tvi.data = v_pcode
  143. l_tvi.pictureindex = 1
  144. l_tvi.selectedpictureindex = 1
  145. if ids_function.find(col_function_ogfid+"='" + v_pcode + "'",1,ids_function.rowcount()) > 0 then
  146. l_tvi.children = true
  147. end if
  148. l_parent = tv_function.insertitemlast(v_handle,l_tvi)
  149. else
  150. l_parent = v_handle
  151. end if
  152. else
  153. l_parent = v_handle
  154. end if
  155. li_row = ids_module.find(col_module_ogmpid +"='" + v_pcode + "'",1,li_cnt)
  156. do while li_row > 0 and li_row <= li_cnt
  157. ls_code = ids_module.GetItemString(li_row,col_module_ogmid)
  158. if is_displayid = "Y" then
  159. l_tvi.label = ids_module.GetItemString(li_row,col_module_ogmid) + " " + trim(ids_module.GetItemString(li_row,col_module_ogmname))
  160. else
  161. l_tvi.label = trim(ids_module.GetItemString(li_row,col_module_ogmname))
  162. end if
  163. l_tvi.data = ls_code
  164. if l_parent = 0 then
  165. l_tvi.pictureindex = 1
  166. l_tvi.selectedpictureindex = 1
  167. else
  168. l_tvi.pictureindex = 2
  169. l_tvi.selectedpictureindex = 3
  170. end if
  171. if ids_function.find(col_function_ogfid+"='" + ls_code + "'",1,ids_function.rowcount()) > 0 then
  172. l_tvi.children = true
  173. else
  174. l_tvi.children = false
  175. end if
  176. l_tvi.selected = false
  177. l_tvi.expanded = false
  178. l_tvi.expandedonce = false
  179. l_handle = tv_function.insertitemlast(l_parent,l_tvi)
  180. if li_row = li_cnt then
  181. exit
  182. end if
  183. if l_handle > 0 then
  184. of_buildtreeview(ls_code,l_handle,v_flag)
  185. end if
  186. li_row = ids_module.find(col_module_ogmpid +"='" + v_pcode + "'",li_row + 1,li_cnt)
  187. if v_flag then
  188. tv_function.expanditem(l_handle)
  189. end if
  190. loop
  191. return
  192. end subroutine
  193. public subroutine of_changedisplay (boolean val);return
  194. end subroutine
  195. public function integer of_init ();Integer i
  196. Integer j
  197. Integer li_handle
  198. Integer li_hdl1
  199. Integer li_hdl2
  200. ddplb_module.Reset()
  201. li_handle = ddplb_module.AddItem(all_panel,1)
  202. IF li_handle > 0 THEN
  203. is_groupid[li_handle] = "ALL"
  204. END IF
  205. li_hdl1 = li_handle
  206. li_handle = ddplb_module.AddItem(all_tree,1)
  207. IF li_handle > 0 THEN
  208. is_groupid[li_handle] = rootid
  209. END IF
  210. li_hdl2 = li_handle
  211. ids_module.SetFilter(col_module_ogmpid +"='" + rootid + "'")
  212. ids_module.Filter()
  213. ids_module.Sort()
  214. IF ids_module.RowCount() < 1 THEN
  215. MessageBox("错误信息","功能模块定义错误!",stopsign!)
  216. RETURN -1
  217. END IF
  218. ii_usrgroup_count = ids_module.RowCount()
  219. FOR i = 1 To ii_usrgroup_count
  220. IF iw_parent.OpenUserObject(iuo_button[i],0,0) = -1 THEN
  221. MessageBox("错误信息","构造操作面板时出现异常错误!",stopsign!)
  222. RETURN -1
  223. END IF
  224. IF iw_parent.OpenUserObject(iuo_list[i],0,0) = -1 THEN
  225. MessageBox("错误信息","构造操作面板时出现异常错误!",stopsign!)
  226. RETURN -1
  227. END IF
  228. IF is_smallicon = "Y" THEN
  229. iuo_list[i].View = listviewsmallicon!
  230. ELSE
  231. iuo_list[i].View = listviewlargeicon!
  232. END IF
  233. iuo_button[i].SetPosition(tobottom!)
  234. iuo_button[i].iuo_parent = This
  235. iuo_button[i].is_data = ids_module.GetItemString(i,col_module_ogmid)
  236. iuo_button[i].of_settext(Trim(ids_module.GetItemString(i,col_module_ogmname)))
  237. iuo_button[i].ii_index = i
  238. iuo_list[i].iuo_parent = This
  239. li_handle = ddplb_module.AddItem(Trim(ids_module.GetItemString(i,col_module_ogmname)),1)
  240. IF li_handle > 0 THEN
  241. is_groupid[li_handle] = ids_module.GetItemString(i,col_module_ogmid)
  242. END IF
  243. of_refreshlist(i)
  244. NEXT
  245. ids_module.SetFilter("")
  246. ids_module.Filter()
  247. ids_module.Sort()
  248. ids_function.SetFilter("")
  249. ids_function.Filter()
  250. ids_function.Sort()
  251. IF ib_panel THEN
  252. ddplb_module.SelectItem(li_hdl1)
  253. ELSE
  254. ddplb_module.SelectItem(li_hdl2)
  255. ddplb_module.Event SelectionChanged(li_hdl2)
  256. END IF
  257. of_setbkcolor()
  258. of_settextcolor()
  259. ii_curgroup = 1
  260. of_resize(Width,Height)
  261. RETURN 1
  262. end function
  263. public subroutine of_insertfunction (integer v_handle);string ls_modid
  264. string ls_uppic
  265. string ls_dnpic
  266. string ls_id
  267. string ls_name
  268. integer i
  269. integer li_cnt
  270. integer li_picidx1
  271. integer li_picidx2
  272. treeviewitem l_tvi
  273. tv_function.getitem(v_handle,l_tvi)
  274. ls_modid = string(l_tvi.data)
  275. if not f_str_isnull(ls_modid) then
  276. if ids_module.find(col_module_ogmid+"='" + ls_modid + "'",1,ids_module.rowcount()) < 1 then
  277. return
  278. end if
  279. else
  280. return
  281. end if
  282. ids_function.setfilter(col_function_ogfid+"='" + ls_modid + "'")
  283. ids_function.filter()
  284. ids_function.sort()
  285. li_cnt = ids_function.rowcount()
  286. for i = 1 to li_cnt
  287. ls_id = ids_function.getitemstring( i, col_function_efid)
  288. if is_displayid = "Y" then
  289. ls_name = ids_function.getitemstring( i, col_function_efid) + " " + trim(ids_function.getitemstring( i, col_function_efname) )
  290. else
  291. ls_name = trim(ids_function.getitemstring( i, col_function_efname) )
  292. end if
  293. ls_uppic = ids_function.getitemstring( i, col_function_efuppict)
  294. ls_dnpic = ids_function.getitemstring( i, col_function_efdnpict)
  295. li_picidx1 = tv_function.addpicture(ls_uppic)
  296. li_picidx2 = tv_function.addpicture(ls_dnpic)
  297. l_tvi.label = ls_name
  298. l_tvi.data = ls_id
  299. l_tvi.pictureindex = li_picidx1
  300. l_tvi.selectedpictureindex = li_picidx2
  301. l_tvi.selected = false
  302. l_tvi.children = false
  303. tv_function.insertitemlast(v_handle,l_tvi)
  304. next
  305. ids_function.setfilter("")
  306. ids_function.filter()
  307. ids_function.sort()
  308. return
  309. end subroutine
  310. public function integer of_movegroup_all ();integer i
  311. integer li_x
  312. integer li_y
  313. integer li_height
  314. integer li_width
  315. integer li_listy
  316. li_x = unitstopixels(x + st_funcarea.x,xunitstopixels!) + 1
  317. li_y = unitstopixels(y + st_funcarea.y,yunitstopixels!) + 1
  318. li_width = unitstopixels(st_funcarea.width,xunitstopixels!) - 2
  319. li_height = unitstopixels(66,yunitstopixels!)
  320. for i = 1 to ii_curgroup
  321. if i>UpperBound(iuo_button) then exit
  322. iuo_button[i].x = pixelstounits(li_x,xpixelstounits!)
  323. iuo_button[i].y = pixelstounits(li_y,ypixelstounits!)
  324. if iuo_button[i].y + 66 <= y + st_funcarea.y + st_funcarea.height then
  325. iuo_button[i].of_resize(pixelstounits(li_width,xpixelstounits!),66)
  326. if ib_panel then
  327. iuo_button[i].show()
  328. else
  329. iuo_button[i].hide()
  330. end if
  331. else
  332. iuo_button[i].hide()
  333. end if
  334. li_y = li_y + li_height
  335. next
  336. li_listy = li_y
  337. li_y = unitstopixels(y + st_funcarea.y + st_funcarea.height,yunitstopixels!) - 1
  338. for i = ii_usrgroup_count to ii_curgroup + 1 step -1
  339. if i>UpperBound(iuo_button) then exit
  340. li_y = li_y - li_height
  341. iuo_button[i].x = pixelstounits(li_x,xpixelstounits!)
  342. iuo_button[i].y = pixelstounits(li_y,ypixelstounits!)
  343. if iuo_button[i].y >= y then
  344. iuo_button[i].of_resize(pixelstounits(li_width,xpixelstounits!),66)
  345. if ib_panel then
  346. iuo_button[i].show()
  347. else
  348. iuo_button[i].hide()
  349. end if
  350. else
  351. iuo_button[i].hide()
  352. end if
  353. next
  354. for i = 1 to ii_usrgroup_count
  355. if i>UpperBound(iuo_list) then exit
  356. if ii_curgroup <> i then
  357. iuo_list[i].hide()
  358. end if
  359. next
  360. iuo_list[ii_curgroup].move(pixelstounits(li_x + 20,xpixelstounits!),pixelstounits(li_listy,ypixelstounits!))
  361. iuo_list[ii_curgroup].resize(pixelstounits(li_width - 20,xpixelstounits!),pixelstounits(li_y - li_listy,ypixelstounits!))
  362. if ib_panel then
  363. tv_function.hide()
  364. iuo_list[ii_curgroup].show()
  365. else
  366. iuo_list[ii_curgroup].hide()
  367. end if
  368. return 1
  369. end function
  370. public subroutine of_refreshlist (integer idx);String ls_modid
  371. String ls_uppic
  372. String ls_dnpic
  373. String ls_id
  374. String ls_name
  375. Integer i
  376. Integer li_cnt
  377. Integer li_handle
  378. Integer li_picidx1
  379. Integer li_picidx2
  380. listviewitem lvi_item
  381. If ((idx < 1) Or (idx > ii_usrgroup_count)) THEN
  382. RETURN
  383. END IF
  384. If (( Not IsValid(iuo_list[idx])) Or ( Not IsValid(iuo_button[idx]))) THEN
  385. RETURN
  386. END IF
  387. // if this.is_smallicon = "Y" then
  388. // iuo_list[idx].view = listviewsmallicon!
  389. // else
  390. // iuo_list[idx].view = listviewlargeicon!
  391. // end if
  392. ls_modid = iuo_button[idx].is_data
  393. IF col_function_ogfmid = '' THEN
  394. ids_function.SetFilter(col_function_ogfid+"='" + ls_modid + "'")
  395. ELSE
  396. ids_function.SetFilter(col_function_ogfmid+"='" + ls_modid + "'")
  397. END IF
  398. ids_function.Filter()
  399. ids_function.Sort()
  400. li_cnt = ids_function.RowCount()
  401. iuo_list[idx].of_reset()
  402. FOR i = 1 To li_cnt
  403. ls_id = ids_function.GetItemString( i, col_function_efid)
  404. ls_name = Trim(ids_function.GetItemString( i, col_function_efname) )
  405. ls_uppic = ids_function.GetItemString( i, col_function_efuppict)
  406. ls_dnpic = ids_function.GetItemString( i, col_function_efdnpict)
  407. IF This.is_smallicon = "Y" THEN
  408. li_picidx1 = iuo_list[idx].AddSmallPicture(ls_uppic)
  409. ELSE
  410. li_picidx1 = iuo_list[idx].AddLargePicture(ls_uppic)
  411. END IF
  412. lvi_item.Label = ls_name
  413. lvi_item.Data = ls_id
  414. lvi_item.PictureIndex = li_picidx1
  415. iuo_list[idx].AddItem(lvi_item)
  416. NEXT
  417. RETURN
  418. end subroutine
  419. public subroutine of_resettreeview ();integer li_handle
  420. tv_function.setredraw(false)
  421. li_handle = tv_function.finditem(roottreeitem!,0)
  422. do while li_handle > 0
  423. tv_function.deleteitem(li_handle)
  424. li_handle = tv_function.finditem(roottreeitem!,0)
  425. loop
  426. tv_function.deletepictures()
  427. tv_function.deletestatepictures()
  428. tv_function.addpicture(system_path + "graphics\package.bmp")
  429. tv_function.addpicture(system_path + "graphics\fileclose.bmp")
  430. tv_function.addpicture(system_path + "graphics\fileopen.bmp")
  431. tv_function.addpicture(system_path + "graphics\program.bmp")
  432. tv_function.setredraw(true)
  433. end subroutine
  434. public function integer of_resize (integer ai_width,integer ai_height);integer i
  435. width = ai_width
  436. height = ai_height
  437. ddplb_module.move(0,0)
  438. ddplb_module.width = width
  439. st_funcarea.move(0,100)
  440. st_funcarea.width = width
  441. st_funcarea.height = height - 100
  442. tv_function.move(st_funcarea.x,st_funcarea.y)
  443. tv_function.resize(st_funcarea.width,st_funcarea.height)
  444. of_movegroup_all()
  445. return 1
  446. end function
  447. public function integer of_set_eventname (string as_groupclicked,string as_funcselected,string as_funcdoubleclicked);is_groupclicked = as_groupclicked
  448. is_funcselected = as_funcselected
  449. is_funcdoubleclicked = as_funcdoubleclicked
  450. return 0
  451. end function
  452. public subroutine of_setbkcolor ();string ls_value
  453. integer li_rtn
  454. integer i
  455. li_rtn = registryget(is_regkey,"PanelBackColor",regstring!,ls_value)
  456. if ((li_rtn <> 1) or (long(ls_value) < 0)) then
  457. ls_value = "15793151"
  458. end if
  459. for i = 1 to ii_usrgroup_count
  460. if isvalid(iuo_list[i]) then
  461. iuo_list[i].backcolor = long(ls_value)
  462. end if
  463. next
  464. tv_function.backcolor = long(ls_value)
  465. st_funcarea.backcolor = long(ls_value)
  466. end subroutine
  467. public subroutine of_setpanelvisible (boolean val);integer i
  468. for i = 1 to ii_usrgroup_count
  469. if isvalid(iuo_button[i]) then
  470. iuo_button[i].visible = val
  471. end if
  472. next
  473. if ii_curgroup >= 1 and ii_curgroup <= upperbound(iuo_list) then
  474. if isvalid(iuo_list[ii_curgroup]) then
  475. iuo_list[ii_curgroup].visible = val
  476. end if
  477. end if
  478. end subroutine
  479. public subroutine of_settextcolor ();string ls_value
  480. integer li_rtn
  481. integer i
  482. li_rtn = registryget(is_regkey,"PanelTextColor",regstring!,ls_value)
  483. if ((li_rtn <> 1) or (long(ls_value) < 0)) then
  484. ls_value = "0"
  485. end if
  486. for i = 1 to ii_usrgroup_count
  487. if isvalid(iuo_list[i]) then
  488. iuo_list[i].textcolor = long(ls_value)
  489. end if
  490. next
  491. tv_function.textcolor = long(ls_value)
  492. end subroutine
  493. public subroutine of_showhelp (integer ai_row);iw_parent.triggerevent("ue_showmicrohelp")
  494. end subroutine
  495. event constructor;iw_parent = GetParent()
  496. st_funcarea.BringToTop = False
  497. end event
  498. on u_function_panel.create
  499. this.tv_function=create tv_function
  500. this.st_funcarea=create st_funcarea
  501. this.ddplb_module=create ddplb_module
  502. this.Control[]={this.tv_function,&
  503. this.st_funcarea,&
  504. this.ddplb_module}
  505. end on
  506. on u_function_panel.destroy
  507. destroy(this.tv_function)
  508. destroy(this.st_funcarea)
  509. destroy(this.ddplb_module)
  510. end on
  511. event destructor;integer i
  512. if ii_usrgroup_count > 0 then
  513. for i = ii_usrgroup_count to 1 step -1
  514. if i > UpperBound(iuo_button) then return
  515. if i > UpperBound(iuo_list) then return
  516. if isvalid(iuo_button[i]) then
  517. iw_parent.closeuserobject(iuo_button[i])
  518. end if
  519. if isvalid(iuo_list[i]) then
  520. iw_parent.closeuserobject(iuo_list[i])
  521. end if
  522. next
  523. end if
  524. end event
  525. type tv_function from treeview within u_function_panel
  526. event ue_find ( string arg_str )
  527. integer x = 82
  528. integer y = 124
  529. integer width = 599
  530. integer height = 1252
  531. integer taborder = 30
  532. integer textsize = -9
  533. integer weight = 400
  534. fontcharset fontcharset = gb2312charset!
  535. fontpitch fontpitch = variable!
  536. string facename = "宋体"
  537. long textcolor = 33554432
  538. borderstyle borderstyle = stylelowered!
  539. boolean linesatroot = true
  540. boolean hideselection = false
  541. boolean trackselect = true
  542. string picturename[] = {"graphics\info.bmp","graphics\fileclose.bmp","graphics\fileopen.bmp","graphics\program.bmp"}
  543. integer picturewidth = 16
  544. integer pictureheight = 16
  545. long picturemaskcolor = 12632256
  546. long statepicturemaskcolor = 536870912
  547. end type
  548. event ue_find(string arg_str);long handel,handel_child
  549. long cnt = 0
  550. treeviewitem tvi
  551. this.setredraw( false)
  552. handel = this.finditem( RootTreeItem! ,0)
  553. do while handel > 0
  554. this.ExpandItem ( handel )
  555. handel_child = this.finditem(ChildTreeItem! ,handel)
  556. do while handel_child > 0
  557. if this.GetItem(handel_child, tvi) = 1 then
  558. if pos(tvi.label,arg_str )> 0 then
  559. this.SelectItem ( handel_child )
  560. this.setredraw( true)
  561. // this.setitem(handel_child,tvi)
  562. return
  563. end if
  564. end if
  565. handel_child = this.finditem(NextTreeItem! ,handel_child)
  566. loop
  567. this.CollapseItem ( handel )
  568. handel = this.finditem(NextTreeItem! ,handel)
  569. loop
  570. this.setredraw( true)
  571. return
  572. end event
  573. event doubleclicked;treeviewitem l_tvi
  574. getitem(handle,l_tvi)
  575. parent.is_selectedid = string(l_tvi.data)
  576. parent.is_msg = l_tvi.label
  577. PARENT.triggerevent("ue_doubleclickfunc")
  578. //iw_parent.triggerevent(is_funcdoubleclicked)
  579. return
  580. end event
  581. event itempopulate;parent.of_insertfunction(handle)
  582. return
  583. end event
  584. event rightclicked;m_xls_pop m_xls
  585. treeviewitem ltvi
  586. selectitem(handle)
  587. getitem(handle,ltvi)
  588. m_xls = create m_xls_pop
  589. m_xls.iuo_parent = this.getparent( )
  590. if f_str_isnull(string(ltvi.data)) = false then
  591. if parent.is_displayid = "N" then
  592. m_xls.m_panel.m_displayid.checked = false
  593. else
  594. m_xls.m_panel.m_displayid.checked = true
  595. end if
  596. m_xls.m_panel.m_smallicon.enabled = false
  597. u_function_panel u_panel
  598. u_panel = this.getparent( )
  599. m_xls.m_panel.popmenu(u_panel.x+ this.x+pointerx(),u_panel.y+this.y+pointery() )
  600. end if
  601. return
  602. end event
  603. type st_funcarea from statictext within u_function_panel
  604. integer y = 100
  605. integer width = 891
  606. integer height = 1400
  607. integer textsize = -9
  608. integer weight = 400
  609. fontcharset fontcharset = gb2312charset!
  610. fontpitch fontpitch = variable!
  611. string facename = "宋体"
  612. long textcolor = 33554432
  613. long backcolor = 15780518
  614. boolean border = true
  615. borderstyle borderstyle = stylelowered!
  616. boolean focusrectangle = false
  617. boolean disabledlook = true
  618. end type
  619. type ddplb_module from dropdownpicturelistbox within u_function_panel
  620. integer x = 5
  621. integer y = 20
  622. integer width = 681
  623. integer height = 1260
  624. integer taborder = 10
  625. boolean bringtotop = true
  626. integer textsize = -9
  627. integer weight = 400
  628. fontcharset fontcharset = gb2312charset!
  629. fontpitch fontpitch = variable!
  630. string facename = "宋体"
  631. long textcolor = 33554432
  632. string text = "none"
  633. boolean autohscroll = true
  634. boolean sorted = false
  635. boolean hscrollbar = true
  636. boolean vscrollbar = true
  637. borderstyle borderstyle = stylelowered!
  638. string picturename[] = {"xls_controlpanel.bmp"}
  639. integer picturewidth = 16
  640. integer pictureheight = 16
  641. long picturemaskcolor = 16777215
  642. end type
  643. event selectionchanged;integer li_handle
  644. if ((index < 1) or (index > upperbound(parent.is_groupid))) then
  645. return
  646. end if
  647. if parent.is_groupid[index] = "ALL" then
  648. parent.tv_function.hide()
  649. parent.of_setpanelvisible(true)
  650. parent.ib_panel = true
  651. else
  652. parent.of_buildtreeview(parent.is_groupid[index],0,false)
  653. parent.is_ddplb = parent.is_groupid[index]
  654. li_handle = parent.tv_function.finditem(roottreeitem!,0)
  655. if parent.tv_function.finditem(nexttreeitem!,li_handle) < 1 then
  656. parent.tv_function.expanditem(li_handle)
  657. end if
  658. parent.of_setpanelvisible(false)
  659. parent.tv_function.show()
  660. parent.ib_panel = false
  661. parent.ii_selindex = index
  662. end if
  663. return
  664. end event