w_shortcut_add.srw 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732
  1. $PBExportHeader$w_shortcut_add.srw
  2. forward
  3. global type w_shortcut_add from w_publ_base
  4. end type
  5. type tv_func from treeview within w_shortcut_add
  6. end type
  7. type lv_shortcut from listview within w_shortcut_add
  8. end type
  9. type ln_bar from line within w_shortcut_add
  10. end type
  11. type ln_bar2 from line within w_shortcut_add
  12. end type
  13. type r_bar from rectangle within w_shortcut_add
  14. end type
  15. end forward
  16. global type w_shortcut_add from w_publ_base
  17. integer width = 2880
  18. integer height = 2136
  19. string title = "添加快捷方式"
  20. boolean minbox = false
  21. windowtype windowtype = response!
  22. tv_func tv_func
  23. lv_shortcut lv_shortcut
  24. ln_bar ln_bar
  25. ln_bar2 ln_bar2
  26. r_bar r_bar
  27. end type
  28. global w_shortcut_add w_shortcut_add
  29. type variables
  30. Long deep = 0,il_handle
  31. Long ins_x,ins_y
  32. datastore ds_shortcutinfo
  33. datastore ds_shortcuttree
  34. end variables
  35. forward prototypes
  36. public function integer pf_menutreegrowth (long arg_handl, long arg_funcid, integer arg_lp)
  37. public function integer wf_build_functree ()
  38. public subroutine wf_refresh_func ()
  39. public function integer wf_refresh_shortcut ()
  40. public function integer pf_menutreegrowth_bk (long arg_handl, long arg_funcid, integer arg_lp)
  41. public function integer pf_menutreegrowth_plugins (ref s_sys_func arg_s_func[], long arg_parentid)
  42. end prototypes
  43. public function integer pf_menutreegrowth (long arg_handl, long arg_funcid, integer arg_lp);Int rslt = 1
  44. s_sys_func ls_s_func[]
  45. Long count = 0,ls_i
  46. Long handl
  47. String ls_power_str
  48. Long ll_hand
  49. treeviewitem tvi
  50. String ls_filter
  51. IF sys_if_network = 1 THEN
  52. ls_filter = 'parentid='+String(arg_funcid)+ ' and worktype <> 1 '
  53. ELSE
  54. ls_filter = 'parentid='+String(arg_funcid)+ ' and worktype <> 2 '
  55. END IF
  56. IF sys_version_type = 0 THEN
  57. ls_filter = ls_filter + 'and ( Versiontype = 0 or Versiontype = -1 )'
  58. ELSEIF sys_version_type = 1 THEN
  59. ls_filter = ls_filter + 'and ( Versiontype = 1 or Versiontype = -1 )'
  60. ELSEIF sys_version_type = 2 THEN
  61. ls_filter = ls_filter + 'and ( Versiontype = 0 or Versiontype = -1 or Versiontype = 2 )'
  62. END IF
  63. sys_ds_maininfo.SetFilter(ls_filter)
  64. sys_ds_maininfo.Filter()
  65. deep++
  66. IF deep > 1000 THEN //防止死递归
  67. RETURN 0
  68. END IF
  69. FOR ls_i = 1 To sys_ds_maininfo.RowCount( )
  70. IF sys_ds_maininfo.Object.if_use[ls_i] = 0 THEN CONTINUE
  71. IF sys_ds_maininfo.Object.functype[ls_i] < 9 THEN
  72. IF sys_ds_maininfo.Object.parentid[ls_i] = arg_funcid THEN
  73. IF Mid(sys_right,sys_ds_maininfo.Object.funcid[ls_i],1) = '1' THEN
  74. IF sys_ds_maininfo.Object.treename[ls_i] = '生产辅助' And &
  75. sys_option_hide_sc = 1 THEN
  76. CONTINUE
  77. END IF
  78. IF sys_ds_maininfo.Object.treename[ls_i] = '外协' And &
  79. sys_option_hide_wfjg = 1 THEN
  80. CONTINUE
  81. END IF
  82. IF sys_ds_maininfo.Object.treename[ls_i] = '财务' And &
  83. sys_option_hide_money = 1 THEN
  84. CONTINUE
  85. END IF
  86. count++
  87. ls_s_func[count].funcid = sys_ds_maininfo.Object.funcid[ls_i]
  88. ls_s_func[count].treename = sys_ds_maininfo.Object.treename[ls_i]
  89. ls_s_func[count].MenuName = sys_ds_maininfo.Object.MenuName[ls_i]
  90. ls_s_func[count].parentid = sys_ds_maininfo.Object.parentid[ls_i]
  91. ls_s_func[count].sortflag = sys_ds_maininfo.Object.sortflag[ls_i]
  92. ls_s_func[count].functype = sys_ds_maininfo.Object.functype[ls_i]
  93. ls_s_func[count].mainid = sys_ds_maininfo.Object.mainid[ls_i]
  94. ls_s_func[count].if_use = sys_ds_maininfo.Object.if_use[ls_i]
  95. END IF
  96. END IF
  97. END IF
  98. NEXT
  99. //IF arg_funcid = 0 THEN
  100. // //加入插件
  101. // Long ll_pluginscnt
  102. // datastore ds
  103. // ds = Create datastore
  104. // ds.DataObject = 'u_plugins_index'
  105. // ds.SetTransObject(sqlca)
  106. // ll_pluginscnt = ds.Retrieve(sys_user_plugins)
  107. // IF ll_pluginscnt > 0 THEN
  108. // count++
  109. // ls_s_func[count].funcid = 40000
  110. // ls_s_func[count].MenuName = "外挂"
  111. // ls_s_func[count].treename = "外挂"
  112. // ls_s_func[count].parentid = 0
  113. // ls_s_func[count].functype = 0
  114. // ls_s_func[count].sortflag = count
  115. // END IF
  116. // destroy ds
  117. //END IF
  118. //IF arg_funcid = 40000 THEN
  119. // pf_menutreegrowth_plugins(ls_s_func)
  120. // count = UpperBound(ls_s_func)
  121. //END IF
  122. Long ll_parentid_plugins[] = {40000,40001,40002,40003,40004,40005,40006,40007,40008,40009,40010,40011}
  123. Long ll_funcid_plugins[] = {0, 256,258,259,349,1047,260,1541,1542,1543,1046,1557}
  124. Boolean lb_plugins = False
  125. Long ll_plugins_parentid
  126. //检查是否有插件
  127. FOR ls_i = 1 To UpperBound(ll_funcid_plugins)
  128. IF ll_funcid_plugins[ls_i] = arg_funcid THEN
  129. ll_plugins_parentid = ll_parentid_plugins[ls_i]
  130. lb_plugins = True
  131. EXIT
  132. END IF
  133. NEXT
  134. IF lb_plugins THEN
  135. //加入插件
  136. Long ll_pluginscnt
  137. datastore ds
  138. ds = Create datastore
  139. ds.DataObject = 'u_plugins_index'
  140. ds.SetTransObject(sqlca)
  141. ll_pluginscnt = ds.Retrieve(sys_user_plugins, ll_plugins_parentid)
  142. // if ll_plugins_parentid = 0 then ll_plugins_parentid = 40000
  143. IF ll_pluginscnt > 0 THEN
  144. count++
  145. ls_s_func[count].funcid = ll_plugins_parentid
  146. ls_s_func[count].MenuName = "外挂"
  147. ls_s_func[count].treename = "外挂"
  148. ls_s_func[count].parentid = arg_funcid
  149. ls_s_func[count].functype = 0
  150. ls_s_func[count].sortflag = count
  151. END IF
  152. Destroy ds
  153. END IF
  154. IF arg_funcid >= 40000 THEN
  155. pf_menutreegrowth_plugins(ls_s_func, arg_funcid)
  156. count = UpperBound(ls_s_func)
  157. END IF
  158. FOR ls_i = 1 To count
  159. //build tree
  160. IF ls_s_func[ls_i].functype = 0 THEN
  161. arg_lp = 2
  162. ELSEIF ls_s_func[ls_i].functype = 8 THEN
  163. arg_lp = 3
  164. ELSEIF ls_s_func[ls_i].functype = 9 THEN
  165. arg_lp = 4
  166. END IF
  167. handl = tv_func.InsertItemLast(arg_handl,ls_s_func[ls_i].treename,arg_lp) //生成树
  168. tv_func.GetItem(handl,tvi)
  169. tvi.Data = ls_s_func[ls_i]
  170. tv_func.SetItem(handl,tvi)
  171. //build menu
  172. pf_menutreegrowth(handl,ls_s_func[ls_i].funcid,arg_lp+1) //下级生成树
  173. NEXT
  174. RETURN rslt
  175. end function
  176. public function integer wf_build_functree ();long hand,ll_getitem
  177. deep = 1
  178. s_sys_func s_sf_ls
  179. treeviewitem ltvi_item
  180. long tvi_hdl = 0
  181. do until tv_func.finditem(roottreeitem!, 0) = -1
  182. tv_func.deleteitem(tvi_hdl)
  183. loop
  184. hand = tv_func.insertitemlast(0,sys_message_title,1)
  185. ll_getitem = tv_func.getitem(hand, ltvi_item)
  186. if ll_getitem > 0 then
  187. ltvi_item.data = s_sf_ls
  188. tv_func.setitem( hand, ltvi_item)
  189. end if
  190. pf_menutreegrowth(hand,0,2)
  191. tv_func.expanditem(hand)
  192. return 1
  193. end function
  194. public subroutine wf_refresh_func ();wf_build_functree()
  195. //sys_ds_maininfo.RowsMove(1, sys_ds_maininfo.DeletedCount(), Delete!, sys_ds_maininfo, 1, Primary!)
  196. end subroutine
  197. public function integer wf_refresh_shortcut ();String str_shortcutstr,str_tmp
  198. Int rslt = 1
  199. s_sys_func ls_s_func[]
  200. Long count = 0,ls_i
  201. Long handl
  202. String ls_power_str
  203. Long ll_hand,ll_funcid
  204. treeviewitem tvi
  205. SELECT shortcutstr INTO :str_shortcutstr
  206. FROM u_user
  207. Where scid = :sys_scid And empid = :sys_empid;
  208. IF sqlca.SQLCode <> 0 THEN
  209. RETURN 0
  210. END IF
  211. sys_ds_maininfo.setfilter('')
  212. sys_ds_maininfo.filter()
  213. Long ll_fileid, ll_parentid
  214. string ls_filename
  215. IF str_shortcutstr <> '' THEN
  216. DO WHILE Pos(str_shortcutstr,',') <> 0
  217. str_tmp = Trim(Left(str_shortcutstr,Pos(str_shortcutstr,',') - 1 ))
  218. str_shortcutstr = Right(str_shortcutstr,Len(str_shortcutstr) - Pos(str_shortcutstr,','))
  219. ll_funcid = Long(str_tmp)
  220. IF ll_funcid < 40000 THEN
  221. ls_i = sys_ds_maininfo.Find('funcid = ' + String(ll_funcid), 1, sys_ds_maininfo.RowCount())
  222. IF ls_i > 0 THEN
  223. count++
  224. ls_s_func[count].funcid = sys_ds_maininfo.Object.funcid[ls_i]
  225. ls_s_func[count].treename = sys_ds_maininfo.Object.treename[ls_i]
  226. ls_s_func[count].MenuName = sys_ds_maininfo.Object.MenuName[ls_i]
  227. ls_s_func[count].parentid = sys_ds_maininfo.Object.parentid[ls_i]
  228. ls_s_func[count].sortflag = sys_ds_maininfo.Object.sortflag[ls_i]
  229. ls_s_func[count].functype = sys_ds_maininfo.Object.functype[ls_i]
  230. ls_s_func[count].mainid = sys_ds_maininfo.Object.mainid[ls_i]
  231. END IF
  232. ELSE
  233. ll_fileid = ll_funcid - 41000
  234. SELECT filename, parentid
  235. INTO :ls_filename, :ll_parentid
  236. FROM u_plugins
  237. Where fileid = :ll_fileid;
  238. IF sqlca.SQLCode <> 0 THEN
  239. ls_filename = ''
  240. END IF
  241. IF ls_filename <> '' THEN
  242. count++
  243. ls_s_func[count].funcid = ll_funcid
  244. ls_s_func[count].treename = ls_filename+'(外挂)'
  245. ls_s_func[count].MenuName = ls_filename+'(外挂)'
  246. ls_s_func[count].parentid = ll_parentid
  247. ls_s_func[count].sortflag = count
  248. ls_s_func[count].functype = 8
  249. ls_s_func[count].mainid = ll_funcid
  250. ls_s_func[count].if_use = 1
  251. END IF
  252. END IF
  253. // FOR ls_i = 1 To ds_shortcutinfo.RowCount( )
  254. // IF ds_shortcutinfo.Object.if_use[ls_i] = 0 THEN CONTINUE
  255. // IF ds_shortcutinfo.Object.functype[ls_i] < 9 THEN
  256. // IF ds_shortcutinfo.Object.funcid[ls_i] = ll_funcid THEN
  257. // count++
  258. // ls_s_func[count].funcid = ds_shortcutinfo.Object.funcid[ls_i]
  259. // ls_s_func[count].treename = ds_shortcutinfo.Object.treename[ls_i]
  260. // ls_s_func[count].MenuName = ds_shortcutinfo.Object.MenuName[ls_i]
  261. // ls_s_func[count].parentid = ds_shortcutinfo.Object.parentid[ls_i]
  262. // ls_s_func[count].sortflag = ds_shortcutinfo.Object.sortflag[ls_i]
  263. // ls_s_func[count].functype = ds_shortcutinfo.Object.functype[ls_i]
  264. // ls_s_func[count].mainid = ds_shortcutinfo.Object.mainid[ls_i]
  265. // ls_s_func[count].if_use = ds_shortcutinfo.Object.if_use[ls_i]
  266. // END IF
  267. // END IF
  268. // NEXT
  269. LOOP
  270. END IF
  271. lv_shortcut.DeleteItems()
  272. listviewitem l_lvi
  273. FOR ls_i = 1 To count
  274. l_lvi.Label = ls_s_func[ls_i].treename
  275. l_lvi.Data = ls_s_func[ls_i]
  276. IF right(ls_s_func[ls_i].treename,1) = "表" THEN
  277. l_lvi.PictureIndex = 3
  278. ELSEIF pos(ls_s_func[ls_i].treename, "(外挂)") > 0 THEN
  279. l_lvi.PictureIndex = 2
  280. ELSE
  281. l_lvi.PictureIndex = 1
  282. END IF
  283. lv_shortcut.AddItem(l_lvi)
  284. NEXT
  285. RETURN 1
  286. end function
  287. public function integer pf_menutreegrowth_bk (long arg_handl, long arg_funcid, integer arg_lp);Int rslt = 1
  288. s_sys_func ls_s_func[]
  289. Long count = 0,ls_i
  290. Long handl
  291. String ls_power_str
  292. Long ll_hand
  293. treeviewitem tvi
  294. String ls_filter
  295. IF sys_if_network = 1 THEN
  296. ls_filter = 'parentid='+String(arg_funcid)+ ' and worktype <> 1 '
  297. ELSE
  298. ls_filter = 'parentid='+String(arg_funcid)+ ' and worktype <> 2 '
  299. END IF
  300. IF sys_version_type = 0 THEN
  301. ls_filter = ls_filter + 'and ( Versiontype = 0 or Versiontype = -1 )'
  302. ELSEIF sys_version_type = 1 THEN
  303. ls_filter = ls_filter + 'and ( Versiontype = 1 or Versiontype = -1 )'
  304. ELSEIF sys_version_type = 2 THEN
  305. ls_filter = ls_filter + 'and ( Versiontype = 0 or Versiontype = -1 or Versiontype = 2 )'
  306. END IF
  307. ds_shortcuttree.SetFilter(ls_filter)
  308. ds_shortcuttree.Filter()
  309. deep++
  310. IF deep > 1000 THEN //防止死递归
  311. RETURN 0
  312. END IF
  313. FOR ls_i = 1 To ds_shortcuttree.RowCount( )
  314. IF ds_shortcuttree.Object.if_use[ls_i] = 0 THEN CONTINUE
  315. IF ds_shortcuttree.Object.functype[ls_i] < 9 THEN
  316. IF ds_shortcuttree.Object.parentid[ls_i] = arg_funcid THEN
  317. IF Mid(sys_right,ds_shortcuttree.Object.funcid[ls_i],1) = '1' THEN
  318. count++
  319. ls_s_func[count].funcid = ds_shortcuttree.Object.funcid[ls_i]
  320. ls_s_func[count].treename = ds_shortcuttree.Object.treename[ls_i]
  321. ls_s_func[count].MenuName = ds_shortcuttree.Object.MenuName[ls_i]
  322. ls_s_func[count].parentid = ds_shortcuttree.Object.parentid[ls_i]
  323. ls_s_func[count].sortflag = ds_shortcuttree.Object.sortflag[ls_i]
  324. ls_s_func[count].functype = ds_shortcuttree.Object.functype[ls_i]
  325. ls_s_func[count].mainid = ds_shortcuttree.Object.mainid[ls_i]
  326. ls_s_func[count].if_use = ds_shortcuttree.Object.if_use[ls_i]
  327. // ds_shortcuttree.deleterow(ls_i)
  328. // ls_i = ls_i - 1
  329. END IF
  330. END IF
  331. END IF
  332. NEXT
  333. FOR ls_i = 1 To count
  334. //build tree
  335. IF ls_s_func[ls_i].functype = 0 THEN
  336. arg_lp = 2
  337. ELSEIF ls_s_func[ls_i].functype = 8 THEN
  338. arg_lp = 3
  339. ELSEIF ls_s_func[ls_i].functype = 9 THEN
  340. arg_lp = 4
  341. END IF
  342. handl = tv_func.InsertItemLast(arg_handl,ls_s_func[ls_i].treename,arg_lp) //生成树
  343. tv_func.GetItem(handl,tvi)
  344. tvi.Data = ls_s_func[ls_i]
  345. tv_func.SetItem(handl,tvi)
  346. //build menu
  347. pf_menutreegrowth(handl,ls_s_func[ls_i].funcid,arg_lp+1) //下级生成树
  348. NEXT
  349. RETURN rslt
  350. end function
  351. public function integer pf_menutreegrowth_plugins (ref s_sys_func arg_s_func[], long arg_parentid);String str_shortcutstr,str_tmp
  352. Int rslt = 1
  353. s_sys_func ls_s_func[]
  354. Long count = 0,ls_i
  355. Long handl
  356. String ls_power_str
  357. Long ll_hand,ll_funcid
  358. String ls_filepath, ls_filename
  359. count = UpperBound(arg_s_func)
  360. //加入插件
  361. Long ll_pluginscnt
  362. datastore ds
  363. ds = Create datastore
  364. ds.DataObject = 'u_plugins_index'
  365. ds.SetTransObject(sqlca)
  366. ll_pluginscnt = ds.Retrieve(sys_user_plugins, arg_parentid)
  367. FOR ls_i = 1 To ll_pluginscnt
  368. ls_filename = Trim(ds.Object.Filename[ls_i])
  369. ls_filepath = Trim(ds.Object.FilePath[ls_i])
  370. ll_funcid = 41000 + ds.Object.fileid[ls_i]
  371. count++
  372. ls_s_func[count].funcid = ll_funcid
  373. ls_s_func[count].treename = ls_filename+'(外挂)'
  374. ls_s_func[count].MenuName = ls_filename+'(外挂)'
  375. ls_s_func[count].parentid = arg_parentid
  376. ls_s_func[count].sortflag = ls_i
  377. ls_s_func[count].functype = 8
  378. ls_s_func[count].mainid = ll_funcid
  379. ls_s_func[count].if_use = 1
  380. IF Not Pos(ls_filepath,'.exe') > 0 THEN
  381. s_sys_win_open[ll_funcid].funcid = String(ll_funcid)
  382. s_sys_win_open[ll_funcid].Name = ls_filepath
  383. s_sys_win_open[ll_funcid].Title = ls_filename
  384. s_sys_win_open[ll_funcid].ifarg = True
  385. s_sys_win_open[ll_funcid].if_retrieve_all = True
  386. END IF
  387. NEXT
  388. arg_s_func = ls_s_func
  389. Destroy ds
  390. RETURN 1
  391. end function
  392. on w_shortcut_add.create
  393. int iCurrent
  394. call super::create
  395. this.tv_func=create tv_func
  396. this.lv_shortcut=create lv_shortcut
  397. this.ln_bar=create ln_bar
  398. this.ln_bar2=create ln_bar2
  399. this.r_bar=create r_bar
  400. iCurrent=UpperBound(this.Control)
  401. this.Control[iCurrent+1]=this.tv_func
  402. this.Control[iCurrent+2]=this.lv_shortcut
  403. this.Control[iCurrent+3]=this.ln_bar
  404. this.Control[iCurrent+4]=this.ln_bar2
  405. this.Control[iCurrent+5]=this.r_bar
  406. end on
  407. on w_shortcut_add.destroy
  408. call super::destroy
  409. destroy(this.tv_func)
  410. destroy(this.lv_shortcut)
  411. destroy(this.ln_bar)
  412. destroy(this.ln_bar2)
  413. destroy(this.r_bar)
  414. end on
  415. event open;call super::open;ds_shortcutinfo = create datastore
  416. ds_shortcuttree = create datastore
  417. ds_shortcutinfo.dataobject='ds_sys_funcpwr'
  418. ds_shortcuttree.dataobject='ds_sys_funcpwr'
  419. wf_refresh_func()
  420. wf_refresh_shortcut()
  421. end event
  422. event close;call super::close;IF sys_version_type = 0 THEN
  423. IF IsValid(w_main_scware) THEN
  424. w_main_scware.wf_refresh_shortcut()
  425. END IF
  426. ELSE
  427. // IF IsValid(w_main_scware_biz) THEN
  428. // w_main_scware_biz.wf_refresh_shortcut()
  429. // END IF
  430. END IF
  431. end event
  432. event resize;call super::resize;ln_bar.endx = this.width
  433. ln_bar2.endx = this.width
  434. r_bar.width = this.width
  435. end event
  436. type cb_func from w_publ_base`cb_func within w_shortcut_add
  437. boolean visible = false
  438. integer x = 631
  439. integer height = 172
  440. end type
  441. type cb_exit from w_publ_base`cb_exit within w_shortcut_add
  442. integer x = 0
  443. integer width = 165
  444. integer height = 172
  445. integer picsize = 16
  446. toolbaralignment pic_align = alignattop!
  447. boolean border = false
  448. end type
  449. type tv_func from treeview within w_shortcut_add
  450. event ue_add_shortcut ( )
  451. integer y = 184
  452. integer width = 1115
  453. integer height = 1776
  454. integer taborder = 10
  455. boolean bringtotop = true
  456. integer textsize = -9
  457. integer weight = 400
  458. fontcharset fontcharset = gb2312charset!
  459. fontpitch fontpitch = variable!
  460. string facename = "宋体"
  461. long textcolor = 33554432
  462. long backcolor = 16777215
  463. borderstyle borderstyle = stylelowered!
  464. boolean linesatroot = true
  465. boolean trackselect = true
  466. string picturename[] = {"application.ico","graphics\Shell32 005.ico","graphics\blue folder.ico","graphics\Shell32 025.ico"}
  467. integer picturewidth = 16
  468. integer pictureheight = 16
  469. long picturemaskcolor = 536870912
  470. string statepicturename[] = {"Continue!"}
  471. long statepicturemaskcolor = 536870912
  472. end type
  473. event ue_add_shortcut();Long ll_hand,funcid
  474. treeviewitem tvi
  475. String arg_msg
  476. s_sys_func s_lss
  477. listviewitem lv_li
  478. uo_userpwr uo_user
  479. uo_user = Create uo_userpwr
  480. ll_hand = This.FindItem(CurrentTreeItem!,0)
  481. This.GetItem(ll_hand,tvi)
  482. s_lss = tvi.Data
  483. funcid = s_lss.funcid
  484. IF funcid > 0 THEN
  485. IF s_lss.functype <> 8 THEN RETURN
  486. IF uo_user.add_shortcut(sys_scid,sys_empid,funcid,arg_msg,True) = 0 THEN
  487. MessageBox('提示',arg_msg, Information!, OK! )
  488. ELSE
  489. wf_refresh_shortcut()
  490. END IF
  491. END IF
  492. Destroy uo_userpwr
  493. end event
  494. event itemexpanded;treeviewitem tvi
  495. THIS.GetItem(Handle,tvi)
  496. tvi.PictureIndex = 4
  497. end event
  498. event rightclicked;IF Handle <= 0 THEN RETURN
  499. il_handle = Handle
  500. this.SelectItem(il_handle)
  501. m_popup_shortcut_add om_1
  502. om_1 = CREATE m_popup_shortcut_add
  503. om_1.anyobject = THIS
  504. om_1.popupmenu(THIS.X+THIS.PointerX(),THIS.Y+THIS.PointerY())
  505. DESTROY om_1
  506. end event
  507. type lv_shortcut from listview within w_shortcut_add
  508. event ue_del_shortcut ( )
  509. event mousemove pbm_mousemove
  510. integer x = 1115
  511. integer y = 184
  512. integer width = 1691
  513. integer height = 1776
  514. integer taborder = 50
  515. boolean bringtotop = true
  516. integer textsize = -9
  517. integer weight = 400
  518. fontcharset fontcharset = gb2312charset!
  519. fontpitch fontpitch = variable!
  520. string facename = "宋体"
  521. long textcolor = 33554432
  522. long backcolor = 16777215
  523. borderstyle borderstyle = stylelowered!
  524. boolean autoarrange = true
  525. boolean editlabels = true
  526. boolean extendedselect = true
  527. boolean fixedlocations = true
  528. boolean showheader = false
  529. boolean trackselect = true
  530. boolean oneclickactivate = true
  531. boolean twoclickactivate = true
  532. boolean headerdragdrop = true
  533. string largepicturename[] = {"graphics\shortcut1.bmp","graphics\define.bmp","graphics\report.bmp","Custom082!"}
  534. long largepicturemaskcolor = 536870912
  535. string smallpicturename[] = {"AppIcon!","AlignRight!"}
  536. long smallpicturemaskcolor = 536870912
  537. long statepicturemaskcolor = 536870912
  538. end type
  539. event ue_del_shortcut();Long ll_hand,funcid
  540. listviewitem l_lvi
  541. String ls_tv_label,arg_msg
  542. s_sys_func s_lss
  543. uo_userpwr uo_user
  544. uo_user = CREATE uo_userpwr
  545. THIS.GetItem(THIS.SelectedIndex(),l_lvi)
  546. s_lss = l_lvi.Data
  547. funcid = s_lss.funcid
  548. IF funcid > 0 THEN
  549. IF uo_user.del_shortcut(sys_scid,sys_empid,funcid,arg_msg,TRUE) = 0 THEN
  550. MessageBox('提示',arg_msg, Information!, OK! )
  551. ELSE
  552. wf_refresh_shortcut()
  553. END IF
  554. END IF
  555. DESTROY uo_userpwr
  556. end event
  557. event mousemove;ins_x = xpos
  558. ins_y = ypos
  559. end event
  560. event rightclicked;IF Index <= 0 THEN RETURN
  561. m_popup_shortcut_del_2 om_1
  562. om_1 = CREATE m_popup_shortcut_del_2
  563. om_1.popupmenu(lv_shortcut.X+ins_x,lv_shortcut.Y+ins_y)
  564. DESTROY om_1
  565. end event
  566. type ln_bar from line within w_shortcut_add
  567. long linecolor = 268435456
  568. integer linethickness = 4
  569. integer beginy = 176
  570. integer endx = 3323
  571. integer endy = 176
  572. end type
  573. type ln_bar2 from line within w_shortcut_add
  574. long linecolor = 16777215
  575. integer linethickness = 4
  576. integer beginy = 180
  577. integer endx = 3323
  578. integer endy = 180
  579. end type
  580. type r_bar from rectangle within w_shortcut_add
  581. long linecolor = 16777215
  582. long fillcolor = 1073741824
  583. integer x = 1522
  584. integer width = 73
  585. integer height = 172
  586. end type
  587. event constructor;this.fillcolor = 14215660
  588. this.linecolor = 14215660
  589. this.x = -1
  590. this.y = -1
  591. this.height = ln_bar2.beginy - 5
  592. end event