123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353 |
- $PBExportHeader$q6_main_demo.srw
- forward
- global type q6_main_demo from w_publ_base
- end type
- type p_left from picture within q6_main_demo
- end type
- type p_right from picture within q6_main_demo
- end type
- type p_middle from picture within q6_main_demo
- end type
- type tv_func from treeview within q6_main_demo
- end type
- type tab_1 from tab within q6_main_demo
- end type
- type tabpage_1 from userobject within tab_1
- end type
- type dw_1 from datawindow within tabpage_1
- end type
- type st_3 from statictext within tabpage_1
- end type
- type st_2 from statictext within tabpage_1
- end type
- type st_1 from statictext within tabpage_1
- end type
- type lv_shortcut from listview within tabpage_1
- end type
- type tabpage_1 from userobject within tab_1
- dw_1 dw_1
- st_3 st_3
- st_2 st_2
- st_1 st_1
- lv_shortcut lv_shortcut
- end type
- type tabpage_2 from userobject within tab_1
- end type
- type tabpage_2 from userobject within tab_1
- end type
- type tabpage_3 from userobject within tab_1
- end type
- type tabpage_3 from userobject within tab_1
- end type
- type tab_1 from tab within q6_main_demo
- tabpage_1 tabpage_1
- tabpage_2 tabpage_2
- tabpage_3 tabpage_3
- end type
- end forward
- global type q6_main_demo from w_publ_base
- integer width = 5152
- integer height = 2972
- string menuname = "m_x_genapp_frame_sp1"
- boolean maxbox = true
- boolean resizable = true
- windowtype windowtype = main!
- windowstate windowstate = maximized!
- long backcolor = 16777215
- event ue_main_menu_commnd ( long arg_funcid )
- event ue_main_meun_plugins ( long arg_mainid )
- event ue_del_shortcut ( )
- p_left p_left
- p_right p_right
- p_middle p_middle
- tv_func tv_func
- tab_1 tab_1
- end type
- global q6_main_demo q6_main_demo
- type variables
- Long deep = 0
- Int retrieve_mm = 10
- s_main_menu ins_s_menu_rp[],ins_s_menu_fz[]
- m_sale_rp_biz om_biz_rp
- m_buy_rp om_buy_rp
- m_ware_rp om_ware_rp
- m_cw_rp om_cw_rp
- m_jg_rp om_jg_rp
- m_rsgz_rp om_rsgz_rp
- m_sale_rp om_sale_rp
- m_buy_fz om_buy_fz
- m_ware_fz om_ware_fz
- m_cw_fz om_cw_fz
- m_jg_fz om_jg_fz
- m_sale_fz om_sale_fz
- datawindow dw_guide
- end variables
- forward prototypes
- public function integer wf_refresh_shortcut ()
- public function integer pf_menutreegrowth_plugins (ref s_sys_func arg_s_func[], long arg_parentid)
- public function integer pf_menutreegrowth (long arg_handl, menu arg_prn_menu, long arg_funcid)
- public subroutine wf_build_menutree ()
- public subroutine wf_init_menu ()
- public subroutine wf_handle_click_guide (long arg_mainid, string arg_dwname, long arg_x, long arg_y)
- public function string wf_retr_guide (long arg_funcid, long arg_parentid)
- end prototypes
- event ue_main_menu_commnd(long arg_funcid);arg_funcid = Message.LongParm
- IF arg_funcid > 0 THEN
- f_sys_main(arg_funcid)
- END IF
- end event
- event ue_main_meun_plugins(long arg_mainid);arg_mainid = Message.LongParm
- String ls_filepath
- String ls_psw
- Long ll_dftWinState
- Long ll_fileid
- ll_fileid = arg_mainid - 41000
- SELECT filepath,
- psw,
- dftWinState
- INTO :ls_filepath,
- :ls_psw,
- :ll_dftWinState
- FROM u_plugins
- Where fileid = :ll_fileid;
- IF sqlca.SQLCode <> 0 THEN
- MessageBox('Error','打开外挂程序失败')
- RETURN
- END IF
- IF Pos(lower(ls_filepath), '.exe') > 0 THEN
- WindowState lwstmp
- IF ll_dftWinState = -1 THEN
- lwstmp = Minimized!
- ELSEIF ll_dftWinState = 0 THEN
- lwstmp = Normal!
- ELSE
- lwstmp = Maximized!
- END IF
-
-
- String ls_run
- ls_run = ls_psw + '&'
- ls_run += publ_userid + '&'
- ls_run += sqlca.Database + '&'
- ls_run += sqlca.UserID + '&'
- ls_run += f_psw_bczh(sqlca.DBPass,0,sys_power_key) + '&'
- ls_run += sqlca.LogID + '&'
- ls_run += sqlca.LogPass + '&'
- ls_run += sqlca.ServerName + '&'
- IF Run(sys_cur_path + ls_filepath + ' - ' +ls_run) = -1 THEN
- MessageBox('错误','运行程序失败!',stopsign!,ok!)
- RETURN
- END IF
- ELSE
- window lw_win
-
- s_edit_index_tran s_tran //翻页功能窗口 传递参数使用
- s_tran.if_retrieve_all = True //是否一次RETRIEVE所有行
- s_tran.work_mode = 0 //0-单纯编辑模式, 1-选择模式
- s_tran.arg_pkid = 0 //目标定位PKID (备用)
- s_tran.arg_string_code = '' //查询列部分内容,用于初步筛选
- s_tran.mainid = arg_mainid
-
- TRY
-
- s_sys_win_open[arg_mainid].Name = ls_filepath
-
- IF IsValid(s_sys_win_open[arg_mainid].win) THEN
- s_sys_win_open[arg_mainid].win.WindowState = Normal!
- s_sys_win_open[arg_mainid].win.BringToTop = True
- ELSE
- IF s_sys_win_open[arg_mainid].ifarg THEN
- s_tran.if_retrieve_all = local_retrieve_all //True
-
- OpenWithParm(lw_win,s_tran,s_sys_win_open[arg_mainid].Name)
- ELSE
- Open(lw_win,s_sys_win_open[arg_mainid].Name)
- END IF
-
- s_sys_win_open[arg_mainid].win = lw_win
- s_sys_win_open[arg_mainid].mainid = arg_mainid
- s_sys_win_open[arg_mainid].Title = lw_win.Title
- s_sys_win_open[arg_mainid].Handle = Handle(lw_win)
-
- END IF
- Catch(runtimeerror e)
-
- //Unknown object type: w_dismantle_install_tl3 at line 64 in ue_main_meun_plugins event of object w_main_scware.
- String ls_msg
- ls_msg = "Unknown object type: "+s_sys_win_open[arg_mainid].Name //+" at line 64 in ue_main_meun_plugins event of object w_main_scware."
- IF Pos(e.Text, ls_msg ) > 0 THEN
- MessageBox('外挂运行错误', '窗口:'+s_sys_win_open[arg_mainid].Title+'不存在')
- ELSE
- MessageBox('', e.Text)
- END IF
- END TRY
- END IF
- RETURN
- end event
- event ue_del_shortcut();Long ll_hand,funcid
- listviewitem l_lvi
- String ls_tv_label,arg_msg
- s_sys_func s_lss
- IF tab_1.tabpage_1.lv_shortcut.SelectedIndex() <= 0 THEN RETURN
- uo_userpwr uo_user
- uo_user = CREATE uo_userpwr
- tab_1.tabpage_1.lv_shortcut.GetItem(tab_1.tabpage_1.lv_shortcut.SelectedIndex(),l_lvi)
- s_lss = l_lvi.Data
- funcid = s_lss.funcid
- IF funcid > 0 THEN
- IF uo_user.del_shortcut(sys_scid,sys_empid,funcid,arg_msg,TRUE) = 0 THEN
- MessageBox('错误',arg_msg, StopSign!, OK! )
- ELSE
- wf_refresh_shortcut()
- END IF
- END IF
- DESTROY uo_userpwr
- end event
- public function integer wf_refresh_shortcut ();String str_shortcutstr,str_tmp
- Int rslt = 1
- s_sys_func ls_s_func[]
- Long count = 0,ls_i
- Long handl
- String ls_power_str
- Long ll_hand,ll_funcid
- treeviewitem tvi
- SELECT shortcutstr
- INTO :str_shortcutstr
- FROM u_user
- WHERE scid = :sys_scid
- And empid = :sys_empid;
- IF sqlca.SQLCode <> 0 THEN
- RETURN 0
- END IF
- sys_ds_maininfo.SetFilter('')
- sys_ds_maininfo.Filter()
- Long ll_fileid, ll_parentid
- String ls_filename
- IF str_shortcutstr <> '' THEN
- DO WHILE Pos(str_shortcutstr,',') <> 0
- str_tmp = Trim(Left(str_shortcutstr,Pos(str_shortcutstr,',') - 1 ))
- str_shortcutstr = Right(str_shortcutstr,Len(str_shortcutstr) - Pos(str_shortcutstr,','))
-
- ll_funcid = Long(str_tmp)
-
- IF ll_funcid < 40000 THEN
- ls_i = sys_ds_maininfo.Find('funcid = ' + String(ll_funcid), 1, sys_ds_maininfo.RowCount())
-
- IF ls_i > 0 THEN
- count++
- ls_s_func[count].funcid = sys_ds_maininfo.Object.funcid[ls_i]
- ls_s_func[count].treename = sys_ds_maininfo.Object.treename[ls_i]
- ls_s_func[count].MenuName = sys_ds_maininfo.Object.MenuName[ls_i]
- ls_s_func[count].parentid = sys_ds_maininfo.Object.parentid[ls_i]
- ls_s_func[count].sortflag = sys_ds_maininfo.Object.sortflag[ls_i]
- ls_s_func[count].functype = sys_ds_maininfo.Object.functype[ls_i]
- ls_s_func[count].mainid = sys_ds_maininfo.Object.mainid[ls_i]
- END IF
- ELSE
-
- ll_fileid = ll_funcid - 41000
-
- SELECT filename, parentid
- INTO :ls_filename, :ll_parentid
- FROM u_plugins
- Where fileid = :ll_fileid;
- IF sqlca.SQLCode <> 0 THEN
- ls_filename = ''
- END IF
-
- IF ls_filename <> '' THEN
- count++
- ls_s_func[count].funcid = ll_funcid
- ls_s_func[count].treename = ls_filename+'(外挂)'
- ls_s_func[count].MenuName = ls_filename+'(外挂)'
- ls_s_func[count].parentid = ll_parentid
- ls_s_func[count].sortflag = count
- ls_s_func[count].functype = 8
- ls_s_func[count].mainid = ll_funcid
- ls_s_func[count].if_use = 1
-
- END IF
- END IF
- LOOP
- END IF
- tab_1.tabpage_1.lv_shortcut.setredraw(false)
- tab_1.tabpage_1.lv_shortcut.DeleteItems()
- listviewitem l_lvi
- FOR ls_i = 1 To count
- l_lvi.Label = ls_s_func[ls_i].treename
- l_lvi.Data = ls_s_func[ls_i]
-
- IF pos(ls_s_func[ls_i].treename, "(外挂)") > 0 THEN
- l_lvi.PictureIndex = 2
- ELSEIF right(ls_s_func[ls_i].treename,1) = "表" THEN
- l_lvi.PictureIndex = 3
- ELSEIF pos(ls_s_func[ls_i].treename,"销售") > 0 THEN
- l_lvi.PictureIndex = 4
- ELSEIF pos(ls_s_func[ls_i].treename,"采购") > 0 THEN
- l_lvi.PictureIndex = 5
- ELSE
- l_lvi.PictureIndex = 1
- END IF
- tab_1.tabpage_1.lv_shortcut.AddItem(l_lvi)
- NEXT
- tab_1.tabpage_1.lv_shortcut.setredraw(true)
- RETURN 1
- end function
- public function integer pf_menutreegrowth_plugins (ref s_sys_func arg_s_func[], long arg_parentid);String str_shortcutstr,str_tmp
- Int rslt = 1
- s_sys_func ls_s_func[]
- Long count = 0,ls_i
- Long handl
- String ls_power_str
- Long ll_hand,ll_funcid
- String ls_filepath, ls_filename
- count = UpperBound(arg_s_func)
- //加入插件
- Long ll_pluginscnt
- datastore ds
- ds = Create datastore
- ds.DataObject = 'u_plugins_index'
- ds.SetTransObject(sqlca)
- ll_pluginscnt = ds.Retrieve(sys_user_plugins, arg_parentid)
- //if arg_parentid = 0 then arg_parentid = 40000
- FOR ls_i = 1 To ll_pluginscnt
- ls_filename = Trim(ds.Object.Filename[ls_i])
- ls_filepath = Trim(ds.Object.FilePath[ls_i])
- ll_funcid = 41000 + ds.Object.fileid[ls_i]
-
- count++
- ls_s_func[count].funcid = ll_funcid
- ls_s_func[count].treename = ls_filename+'(外挂)'
- ls_s_func[count].MenuName = ls_filename+'(外挂)'
- ls_s_func[count].parentid = arg_parentid
- ls_s_func[count].sortflag = ls_i
- ls_s_func[count].functype = 8
- ls_s_func[count].mainid = ll_funcid
- ls_s_func[count].if_use = 1
-
- IF Not Pos(lower(ls_filepath),'.exe') > 0 THEN
- s_sys_win_open[ll_funcid].funcid = String(ll_funcid)
- s_sys_win_open[ll_funcid].Name = ls_filepath
- s_sys_win_open[ll_funcid].Title = ls_filename
- s_sys_win_open[ll_funcid].ifarg = True
- s_sys_win_open[ll_funcid].if_retrieve_all = True
- END IF
- NEXT
- arg_s_func = ls_s_func
- Destroy ds
- RETURN 1
- end function
- public function integer pf_menutreegrowth (long arg_handl, menu arg_prn_menu, long arg_funcid);Int rslt = 1
- s_sys_func ls_s_func[]
- Long count = 0,ls_i
- Long handl
- String ls_power_str
- Long ll_hand
- String ls_filter
- If sys_if_network = 1 Then
- ls_filter = 'parentid='+String(arg_funcid)+ ' and worktype <> 1 and if_use <> 0 and functype < 9 '
- Else
- ls_filter = 'parentid='+String(arg_funcid)+ ' and worktype <> 2 and if_use <> 0 and functype < 9 '
- End If
- If sys_version_type = 0 Then
- ls_filter = ls_filter + 'and ( Versiontype = 0 or Versiontype = -1 )'
- ElseIf sys_version_type = 1 Then
- ls_filter = ls_filter + 'and ( Versiontype = 1 or Versiontype = -1 )'
- ElseIf sys_version_type = 2 Then
- ls_filter = ls_filter + 'and ( Versiontype = 0 or Versiontype = -1 or Versiontype = 2 )'
- End If
- sys_ds_maininfo.SetFilter(ls_filter)
- sys_ds_maininfo.Filter()
- sys_ds_maininfo.SetSort('sortflag')
- sys_ds_maininfo.Sort()
- deep++
- If deep > 3000 Then //防止死递归
- Return 0
- End If
- For ls_i = 1 To sys_ds_maininfo.RowCount( )
- // IF sys_ds_maininfo.Object.funcid[ls_i] = 1766 THEN
- // ls_i = ls_i
- // END IF
- // IF sys_ds_maininfo.Object.if_use[ls_i] = 0 THEN CONTINUE
- // IF sys_ds_maininfo.Object.functype[ls_i] < 9 THEN
- // IF sys_ds_maininfo.Object.parentid[ls_i] = arg_funcid THEN
-
- If sys_option_hide_cw = 0 Then
- If sys_accsetbegin Then
- //账务初始化
- If sys_ds_maininfo.Object.funcid[ls_i] = 1950 Then Continue
- Else
- //账务
- If sys_ds_maininfo.Object.funcid[ls_i] = 1964 Then Continue
- End If
- Else
- //隐藏总帐菜单
- If sys_ds_maininfo.Object.funcid[ls_i] = 1932 Then Continue
- If sys_ds_maininfo.Object.funcid[ls_i] = 1950 Then Continue
- If sys_ds_maininfo.Object.funcid[ls_i] = 1964 Then Continue
-
- End If
-
-
- If sys_ds_maininfo.Object.treename[ls_i] <> '系统解决方案' &
- And sys_ds_maininfo.Object.treename[ls_i] <> '解决方案' &
- And sys_ds_maininfo.Object.treename[ls_i] <> '系统' Then
- If Mid(sys_pwrstr,sys_ds_maininfo.Object.funcid[ls_i],1) <> '1' Then Continue
- End If
- If Mid(sys_right,sys_ds_maininfo.Object.funcid[ls_i],1) = '1' Then
-
- If sys_ds_maininfo.Object.treename[ls_i] = '仓库' And &
- sys_option_hide_ware = 1 Then
- Continue
- End If
-
- If sys_ds_maininfo.Object.treename[ls_i] = '生产' And &
- sys_version = 802001 Then Continue
-
- If sys_ds_maininfo.Object.treename[ls_i] = '外协' And &
- sys_version = 802001 Then Continue
-
- If sys_ds_maininfo.Object.treename[ls_i] = '生产' And &
- sys_option_hide_sc = 1 Then
- Continue
- End If
-
- If sys_ds_maininfo.Object.treename[ls_i] = '外协' And &
- sys_option_hide_wfjg = 1 Then
- Continue
- End If
-
-
- If sys_ds_maininfo.Object.treename[ls_i] = '财务' And &
- sys_option_hide_money = 1 Then
- Continue
- End If
-
- If sys_ds_maininfo.Object.treename[ls_i] = '人事工资' And &
- sys_option_hide_gz = 1 Then
- Continue
- End If
-
-
-
- count++
- ls_s_func[count].funcid = sys_ds_maininfo.Object.funcid[ls_i]
- ls_s_func[count].treename = sys_ds_maininfo.Object.treename[ls_i]
- ls_s_func[count].MenuName = sys_ds_maininfo.Object.MenuName[ls_i]
- ls_s_func[count].parentid = sys_ds_maininfo.Object.parentid[ls_i]
- ls_s_func[count].sortflag = sys_ds_maininfo.Object.sortflag[ls_i]
- ls_s_func[count].functype = sys_ds_maininfo.Object.functype[ls_i]
- ls_s_func[count].mainid = sys_ds_maininfo.Object.mainid[ls_i]
- ls_s_func[count].if_use = sys_ds_maininfo.Object.if_use[ls_i]
- End If
- // END IF
- // END IF
- Next
- //IF arg_funcid = 0 THEN
- // //加入插件
- // Long ll_pluginscnt
- // datastore ds
- // ds = Create datastore
- // ds.DataObject = 'u_plugins_index'
- // ds.SetTransObject(sqlca)
- // ll_pluginscnt = ds.Retrieve(sys_user_plugins, 0)
- // IF ll_pluginscnt > 0 THEN
- // count++
- // ls_s_func[count].funcid = 40000
- // ls_s_func[count].MenuName = "外挂"
- // ls_s_func[count].treename = "外挂"
- // ls_s_func[count].parentid = 0
- // ls_s_func[count].functype = 0
- // ls_s_func[count].sortflag = count
- // END IF
- // Destroy ds
- //END IF
- //IF arg_funcid = 40000 THEN
- // //pf_menutreegrowth_plugins(ls_s_func)
- // count = UpperBound(ls_s_func)
- //END IF
- Long ll_parentid_plugins[] = {40000,40001,40002,40003,40004,40005,40006,40007,40008,40009,40010,40011}
- Long ll_funcid_plugins[] = {0, 256,258,259,349,1047,260,1541,1542,1543,1046,1557}
- Boolean lb_plugins = False
- Long ll_plugins_parentid
- //检查是否有插件
- For ls_i = 1 To UpperBound(ll_funcid_plugins)
- If ll_funcid_plugins[ls_i] = arg_funcid Then
- ll_plugins_parentid = ll_parentid_plugins[ls_i]
- lb_plugins = True
- Exit
- End If
- Next
- If lb_plugins Then
- //加入插件
- Long ll_pluginscnt
- datastore ds
- ds = Create datastore
- ds.DataObject = 'u_plugins_index'
- ds.SetTransObject(sqlca)
- ll_pluginscnt = ds.Retrieve(sys_user_plugins, ll_plugins_parentid)
- // if ll_plugins_parentid = 0 then ll_plugins_parentid = 40000
- If ll_pluginscnt > 0 Then
- count++
- ls_s_func[count].funcid = ll_plugins_parentid
- ls_s_func[count].MenuName = "外挂"
- ls_s_func[count].treename = "外挂"
- ls_s_func[count].parentid = arg_funcid
- ls_s_func[count].functype = 0
- ls_s_func[count].sortflag = count
- End If
- Destroy ds
- End If
- If arg_funcid >= 40000 Then
- pf_menutreegrowth_plugins(ls_s_func, arg_funcid)
- count = UpperBound(ls_s_func)
- End If
- // //按模块增加插件
- //long ll_parentid_plugins
- //choose case arg_funcid
- // case 0 //全部
- // case 256 //销售
- // case 258 //仓库
- // case 259 //采购
- // case 349 //外协
- // case 1047 //生产
- // case 260 //人事工资
- // //case 261 //财务
- // case 1541 //应收
- // case 1542 //应付
- // case 1543 //出纳
- // case 1046 //零售
- // case 1557 //电子商务
- //end choose
- //if arg_funcid = 0 then
- // count++
- // ls_s_func[count].funcid = -1
- // ls_s_func[count].MenuName = "收藏"
- // ls_s_func[count].treename = "收藏"
- // ls_s_func[count].parentid = 0
- // ls_s_func[count].functype = 0
- // ls_s_func[count].sortflag = count
- //end if
- //
- //if arg_funcid = -1 then
- // wf_build_menu_shortcut(ls_s_func)
- // count = UpperBound(ls_s_func)
- //end if
- String ls_menuname,ls_treename
- long ll_lp
- treeviewitem tvi
- For ls_i = 1 To count
-
- ls_menuname = Trim(ls_s_func[ls_i].MenuName)
- ls_treename = ls_s_func[ls_i].treename
-
- if ls_s_func[ls_i].functype = 0 then
- ll_lp = 2
- elseif ls_s_func[ls_i].functype = 8 then
- ll_lp = 5
- ELSEIF ls_s_func[ls_i].functype = 9 THEN
- ll_lp = 4
- else
- ll_lp = 6
- END IF
-
- handl = tv_func.InsertItemLast(arg_handl,ls_treename,ll_lp) //生成树
- tv_func.GetItem(handl,tvi)
- tvi.Data = ls_s_func[ls_i]
- tv_func.SetItem(handl,tvi)
-
- f_add_menuItem(arg_prn_menu,ls_i,ls_menuname,String(ls_s_func[ls_i].mainid))
- // if arg_funcid <> -1 then
- pf_menutreegrowth(handl,arg_prn_menu.Item[UpperBound(arg_prn_menu.Item)],ls_s_func[ls_i].funcid)
- // end if
- Next
- Return rslt
- end function
- public subroutine wf_build_menutree ();Long hand,ll_getitem
- If sys_if_network = 1 Then
- Long i
- For i = 1 To UpperBound(MenuID.Item[1].Item)
- If MenuID.Item[1].Item[i].Text = '帐套管理' Then
- MenuID.Item[1].Item[i].Visible = False
- Exit
- End If
- Next
-
- //MenuID.Item[1].Item[5].enabled = false //帐套管理
- //This.ChangeMenu(m_x_genapp_frame_sp1_net)
- Else
- //This.ChangeMenu(m_x_genapp_frame_sp1)
- End If
- s_sys_func s_sf_ls
- treeviewitem ltvi_item
- Long tvi_hdl = 0
- Do Until tv_func.FindItem(roottreeitem!, 0) = -1
- tv_func.DeleteItem(tvi_hdl)
- Loop
- hand = tv_func.InsertItemLast(0,sys_message_title,1)
- ll_getitem = tv_func.GetItem(hand, ltvi_item)
- If ll_getitem > 0 Then
- ltvi_item.Data = s_sf_ls
- tv_func.SetItem( hand, ltvi_item)
- End If
- pf_menutreegrowth(hand,This.MenuID,0)
- tv_func.ExpandItem(hand)
- MenuID.Item[1].Hide() //should be item[1], whatever the base menuitem is.
- MenuID.Item[1].Show()
- sys_ds_maininfo.RowsMove(1, sys_ds_maininfo.DeletedCount(), Delete!, sys_ds_maininfo, 1, Primary!)
- end subroutine
- public subroutine wf_init_menu ();om_biz_rp = Create m_sale_rp_biz
- om_buy_rp = Create m_buy_rp
- om_ware_rp = Create m_ware_rp
- om_cw_rp = Create m_cw_rp
- om_jg_rp = Create m_jg_rp
- om_rsgz_rp = Create m_rsgz_rp
- om_sale_rp = Create m_sale_rp
- om_buy_fz = create m_buy_fz
- om_ware_fz = create m_ware_fz
- om_cw_fz = create m_cw_fz
- om_jg_fz = create m_jg_fz
- om_sale_fz = create m_sale_fz
- Long i
- ////更多报表
- i++
- ins_s_menu_rp[i].dwname = 'dw_main_child_biz'
- ins_s_menu_rp[i].menu = om_biz_rp
- i++
- ins_s_menu_rp[i].dwname = 'dw_main_child_cg'
- ins_s_menu_rp[i].menu = om_buy_rp
- i++
- ins_s_menu_rp[i].dwname = 'dw_main_child_ck'
- ins_s_menu_rp[i].menu = om_ware_rp
- i++
- ins_s_menu_rp[i].dwname = 'dw_main_child_cw'
- ins_s_menu_rp[i].menu = om_cw_rp
- i++
- ins_s_menu_rp[i].dwname = 'dw_main_child_jg'
- ins_s_menu_rp[i].menu = om_jg_rp
- i++
- ins_s_menu_rp[i].dwname = 'dw_main_child_rsgz'
- ins_s_menu_rp[i].menu = om_rsgz_rp
- i++
- ins_s_menu_rp[i].dwname = 'dw_main_child_xs'
- ins_s_menu_rp[i].menu = om_sale_rp
- long j
- ////辅助功能
- j++
- ins_s_menu_fz[j].dwname = 'dw_main_child_cg'
- ins_s_menu_fz[j].menu = om_buy_fz
- j++
- ins_s_menu_fz[j].dwname = 'dw_main_child_ck'
- ins_s_menu_fz[j].menu = om_ware_fz
- j++
- ins_s_menu_fz[j].dwname = 'dw_main_child_cw'
- ins_s_menu_fz[j].menu = om_cw_fz
- j++
- ins_s_menu_fz[j].dwname = 'dw_main_child_jg'
- ins_s_menu_fz[j].menu = om_jg_fz
- j++
- ins_s_menu_fz[j].dwname = 'dw_main_child_xs'
- ins_s_menu_fz[j].menu = om_sale_fz
- end subroutine
- public subroutine wf_handle_click_guide (long arg_mainid, string arg_dwname, long arg_x, long arg_y);menu arg_m
- Long i
- If arg_mainid = 99999 Then
- For i = 1 To UpperBound(ins_s_menu_rp)
- If arg_dwname = ins_s_menu_rp[i].dwname Then
- ins_s_menu_rp[i].menu.PopMenu(arg_x,arg_y)
- Return
- End If
- Next
- ElseIf arg_mainid = 88888 Then
- For i = 1 To UpperBound(ins_s_menu_fz)
- If arg_dwname = ins_s_menu_fz[i].dwname Then
- ins_s_menu_fz[i].menu.PopMenu(arg_x,arg_y)
- Return
- End If
- Next
- ElseIf arg_mainid = 77777 and arg_dwname = 'dw_main_child_ck' Then
- m_ware_buy om_ware_buy
- om_ware_buy = CREATE m_ware_buy
- om_ware_buy.PopMenu(arg_x,arg_y)
- DESTROY om_ware_buy
- ElseIf arg_mainid = 66666 and arg_dwname = 'dw_main_child_ck' Then
- m_ware_sale om_ware_sale
- om_ware_sale = CREATE m_ware_sale
- om_ware_sale.PopMenu(arg_x,arg_y)
- DESTROY om_ware_sale
- End If
- end subroutine
- public function string wf_retr_guide (long arg_funcid, long arg_parentid);String arg_dwname
- If arg_funcid = 1046 Or arg_parentid = 1046 Then
- //零售
- arg_dwname = 'dw_main_child_biz'
- ElseIf arg_funcid = 256 Or arg_parentid = 256 Then
- //销售
- arg_dwname = 'dw_main_child_xs'
- ElseIf arg_funcid = 258 Or arg_parentid = 258 Then
- //仓库
- arg_dwname = 'dw_main_child_ck'
- ElseIf arg_funcid = 259 Or arg_parentid = 259 Then
- //采购
- arg_dwname = 'dw_main_child_cg'
- ElseIf arg_funcid = 349 Or arg_parentid = 349 Then
- //外协
- arg_dwname = 'dw_main_child_jg'
- ElseIf arg_funcid = 1047 Or arg_parentid = 1047 Then
- //生产
- arg_dwname = 'dw_main_child_sc'
- ElseIf arg_funcid = 260 Or arg_parentid = 260 Then
- //人事工资
- arg_dwname = 'dw_main_child_rsgz'
- ElseIf arg_funcid = 261 Or arg_parentid = 261 Then
- //财务
- arg_dwname = 'dw_main_child_cw'
- End If
- Return arg_dwname
- end function
- on q6_main_demo.create
- int iCurrent
- call super::create
- if this.MenuName = "m_x_genapp_frame_sp1" then this.MenuID = create m_x_genapp_frame_sp1
- this.p_left=create p_left
- this.p_right=create p_right
- this.p_middle=create p_middle
- this.tv_func=create tv_func
- this.tab_1=create tab_1
- iCurrent=UpperBound(this.Control)
- this.Control[iCurrent+1]=this.p_left
- this.Control[iCurrent+2]=this.p_right
- this.Control[iCurrent+3]=this.p_middle
- this.Control[iCurrent+4]=this.tv_func
- this.Control[iCurrent+5]=this.tab_1
- end on
- on q6_main_demo.destroy
- call super::destroy
- if IsValid(MenuID) then destroy(MenuID)
- destroy(this.p_left)
- destroy(this.p_right)
- destroy(this.p_middle)
- destroy(this.tv_func)
- destroy(this.tab_1)
- end on
- event resize;call super::resize;p_right.x = this.workspacewidth() - p_right.width
- p_middle.width = this.width - p_left.width - p_right.width
- tv_func.height = this.workspaceheight() - tv_func.y - 10
- tab_1.width = this.workspacewidth() - tab_1.x - 10
- tab_1.height = this.workspaceheight() - tab_1.y - 10
- tab_1.tabpage_1.lv_shortcut.width = tab_1.tabpage_1.width - 10
- end event
- event open;call super::open;dw_guide = tab_1.tabpage_1.dw_1
- tab_1.tabpage_1.dw_1.insertrow(0)
- wf_refresh_shortcut()
- wf_build_menutree()
- //初始化导航图用到的菜单
- wf_init_menu()
- end event
- event close;call super::close;destroy om_biz_rp
- destroy om_buy_rp
- destroy om_ware_rp
- destroy om_cw_rp
- destroy om_jg_rp
- destroy om_rsgz_rp
- destroy om_sale_rp
- destroy om_buy_fz
- destroy om_ware_fz
- destroy om_cw_fz
- destroy om_jg_fz
- destroy om_sale_fz
- end event
- type cb_func from w_publ_base`cb_func within q6_main_demo
- boolean visible = false
- end type
- type cb_exit from w_publ_base`cb_exit within q6_main_demo
- boolean visible = false
- end type
- type p_left from picture within q6_main_demo
- integer width = 1111
- integer height = 200
- boolean bringtotop = true
- string picturename = "q6bar_left.bmp"
- boolean focusrectangle = false
- end type
- type p_right from picture within q6_main_demo
- integer x = 2496
- integer width = 2619
- integer height = 200
- boolean bringtotop = true
- string picturename = "q6bar_right.bmp"
- boolean focusrectangle = false
- end type
- type p_middle from picture within q6_main_demo
- integer x = 1111
- integer width = 1385
- integer height = 200
- boolean bringtotop = true
- string picturename = "q6bar_middle.bmp"
- boolean focusrectangle = false
- end type
- type tv_func from treeview within q6_main_demo
- event ue_add_shortcut ( )
- integer x = 9
- integer y = 208
- integer width = 1106
- integer height = 2576
- integer taborder = 20
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- boolean border = false
- boolean haslines = false
- boolean disabledragdrop = false
- string picturename[] = {"q6logo.ico","graphics\folder_v3.bmp","graphics\folder_g_v3.bmp","graphics\power_v3.bmp","graphics\icon_00.png","graphics\icon_01.png","graphics\icon_02.png","graphics\icon_03.png","graphics\icon_04.png","graphics\icon_05.png","graphics\icon_06.png","graphics\icon_07.png","graphics\icon_08.png","graphics\icon_09.png","graphics\icon_plug.png"}
- integer picturewidth = 16
- integer pictureheight = 16
- long picturemaskcolor = 536870912
- long statepicturemaskcolor = 536870912
- end type
- event ue_add_shortcut();Long ll_hand,funcid
- treeviewitem tvi
- String arg_msg
- s_sys_func s_lss
- listviewitem lv_li
- uo_userpwr uo_user
- uo_user = Create uo_userpwr
- ll_hand = This.FindItem(CurrentTreeItem!,0)
- This.GetItem(ll_hand,tvi)
- s_lss = tvi.Data
- funcid = s_lss.funcid
- IF funcid > 0 THEN
- IF s_lss.functype <> 8 THEN RETURN
- IF uo_user.add_shortcut(sys_scid,sys_empid,funcid,arg_msg,True) = 0 THEN
- MessageBox('提示',arg_msg, Information!, OK! )
- ELSE
- wf_refresh_shortcut()
- END IF
- END IF
- Destroy uo_userpwr
- end event
- event doubleclicked;Long ll_hand,mainid,wintype,functype
- string treename
- treeviewitem tvi
- s_sys_func s_lss
- ll_hand = THIS.FindItem(currenttreeitem!,0)
- THIS.GetItem(ll_hand,tvi)
- s_lss = tvi.Data
- mainid = s_lss.mainid
- treename = s_lss.treename
- functype = s_lss.functype
- IF mainid > 0 AND functype <> 2 and functype <> 3 THEN
-
- IF Pos(treename,'(嵌入式)') > 0 THEN
- PARENT.PostEvent('ue_main_meun_report',0,mainid)
- ELSEIF Pos(treename,'(外挂)') > 0 THEN
- PARENT.PostEvent('ue_main_meun_plugins',0,mainid)
- ELSE
- PARENT.PostEvent('ue_main_menu_commnd',0,mainid)
- RETURN 1
- END IF
- END IF
- end event
- event clicked;treeviewitem tvi
- s_sys_func s_lss
- Long funcid ,parentid
- String arg_dwname
- If This.GetItem(Handle,tvi) = -1 Then Return
- s_lss = tvi.Data
- funcid = s_lss.funcid
- parentid = s_lss.parentid
- arg_dwname = wf_retr_guide(funcid,parentid)
- If dw_guide.DataObject <> arg_dwname and arg_dwname <> '' Then
- dw_guide.DataObject = arg_dwname
- dw_guide.InsertRow(0)
- End If
- end event
- event rightclicked;//IF Handle <= 0 THEN RETURN
- //il_handle = Handle
- //THIS.SelectItem(il_handle)
- //m_popup_shortcut_add om_1
- //om_1 = CREATE m_popup_shortcut_add
- ////把菜单的anyobject指向被右击的对象(dw_1)
- //om_1.anyobject = THIS
- ////om_1.setmenuitem("添加子项|添加兄弟|编辑|-|删除")
- ////可在此调用om_1.setitemdisable(itemorder)函数disable某菜单项。
- //om_1.popupmenu(THIS.X+THIS.PointerX(),THIS.Y+THIS.PointerY())
- //
- //DESTROY om_1
- Long ll_hand,mainid,functype,if_navigation,funcid,parentid
- string arg_dwname
- treeviewitem tvi
- s_sys_func s_lss
- IF THIS.GetItem(Handle,tvi) = -1 THEN RETURN
- s_lss = tvi.Data
- mainid = s_lss.mainid
- functype = s_lss.functype
- funcid = s_lss.funcid
- parentid = s_lss.parentid
- arg_dwname = wf_retr_guide(funcid,parentid)
- If dw_guide.DataObject <> arg_dwname and arg_dwname <> '' Then
- dw_guide.DataObject = arg_dwname
- dw_guide.InsertRow(0)
- End If
- IF mainid > 0 AND functype <> 0 and functype <> 2 and functype <> 3 THEN
- IF Handle <= 0 THEN RETURN
- THIS.SelectItem(Handle)
- m_popup_shortcut_add om_1
- om_1 = CREATE m_popup_shortcut_add
- //把菜单的anyobject指向被右击的对象(dw_1)
- om_1.anyobject = THIS
- //om_1.setmenuitem("添加子项|添加兄弟|编辑|-|删除")
- //可在此调用om_1.setitemdisable(itemorder)函数disable某菜单项。
- om_1.popupmenu(THIS.X+THIS.PointerX(),THIS.Y+THIS.PointerY())
-
- DESTROY om_1
- // RETURN
- ELSE
- THIS.SelectItem(Handle)
- END IF
- end event
- type tab_1 from tab within q6_main_demo
- integer x = 1125
- integer y = 208
- integer width = 3680
- integer height = 2572
- integer taborder = 30
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long backcolor = 16777215
- boolean raggedright = true
- boolean boldselectedtext = true
- integer selectedtab = 1
- tabpage_1 tabpage_1
- tabpage_2 tabpage_2
- tabpage_3 tabpage_3
- end type
- on tab_1.create
- this.tabpage_1=create tabpage_1
- this.tabpage_2=create tabpage_2
- this.tabpage_3=create tabpage_3
- this.Control[]={this.tabpage_1,&
- this.tabpage_2,&
- this.tabpage_3}
- end on
- on tab_1.destroy
- destroy(this.tabpage_1)
- destroy(this.tabpage_2)
- destroy(this.tabpage_3)
- end on
- type tabpage_1 from userobject within tab_1
- integer x = 18
- integer y = 96
- integer width = 3643
- integer height = 2460
- long backcolor = 16777215
- string text = "日常办公"
- long tabtextcolor = 33554432
- long tabbackcolor = 16777215
- long picturemaskcolor = 536870912
- dw_1 dw_1
- st_3 st_3
- st_2 st_2
- st_1 st_1
- lv_shortcut lv_shortcut
- end type
- on tabpage_1.create
- this.dw_1=create dw_1
- this.st_3=create st_3
- this.st_2=create st_2
- this.st_1=create st_1
- this.lv_shortcut=create lv_shortcut
- this.Control[]={this.dw_1,&
- this.st_3,&
- this.st_2,&
- this.st_1,&
- this.lv_shortcut}
- end on
- on tabpage_1.destroy
- destroy(this.dw_1)
- destroy(this.st_3)
- destroy(this.st_2)
- destroy(this.st_1)
- destroy(this.lv_shortcut)
- end on
- type dw_1 from datawindow within tabpage_1
- integer x = 9
- integer y = 420
- integer width = 2734
- integer height = 1544
- integer taborder = 30
- string title = "none"
- string dataobject = "dw_main_child_ck"
- boolean border = false
- boolean livescroll = true
- end type
- event clicked;string ls_name
- ls_name = dwo.Name
- string ls_tag,ll_x,ll_y
- long ll_mainid
- ls_tag = this.Describe(ls_name+".Tag")
- ll_x = this.Describe(ls_name+".x")
- ll_y = this.Describe(ls_name+".y")
- if trim(ls_tag) <> '' then
- ll_mainid = long(ls_tag)
- end if
- if ll_mainid > 0 then
- // if ll_mainid = 99999 then
- // //更多报表
- // m_sale_rp om_1
- // om_1 = CREATE m_sale_rp
- // om_1.PopMenu(tab_1.X+this.x + long(ll_x),tab_1.Y+this.y+long(ll_y) + 150)
- // DESTROY om_1
- // elseif ll_mainid = 88888 then
- // //辅助功能
- // choose case this.dataobject
- // case 'dw_main_child_jg'
- // m_jg_fz om_jg_fz
- // om_jg_fz = CREATE m_jg_fz
- // om_jg_fz.PopMenu(tab_1.X+this.x + long(ll_x),tab_1.Y+this.y+long(ll_y) + 150)
- // DESTROY om_jg_fz
- // end choose
- if ll_mainid > 10000 then
- wf_handle_click_guide(ll_mainid,this.dataobject ,tab_1.X+this.x + long(ll_x),tab_1.Y+this.y+long(ll_y) + 150)
-
- else
- f_sys_main(ll_mainid)
- end if
- end if
- end event
- type st_3 from statictext within tabpage_1
- integer x = 2752
- integer y = 424
- integer width = 155
- integer height = 64
- integer textsize = -10
- integer weight = 700
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- fontfamily fontfamily = swiss!
- string facename = "微软雅黑"
- long textcolor = 33554432
- long backcolor = 16777215
- string text = "消息"
- boolean focusrectangle = false
- end type
- type st_2 from statictext within tabpage_1
- integer x = 46
- integer y = 1984
- integer width = 251
- integer height = 64
- integer textsize = -10
- integer weight = 700
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- fontfamily fontfamily = swiss!
- string facename = "微软雅黑"
- long textcolor = 33554432
- long backcolor = 16777215
- string text = "龙嘉资讯"
- boolean focusrectangle = false
- end type
- type st_1 from statictext within tabpage_1
- integer x = 46
- integer y = 8
- integer width = 297
- integer height = 80
- integer textsize = -10
- integer weight = 700
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- fontfamily fontfamily = swiss!
- string facename = "微软雅黑"
- long textcolor = 33554432
- long backcolor = 16777215
- string text = "快捷方式"
- boolean focusrectangle = false
- end type
- type lv_shortcut from listview within tabpage_1
- integer x = 5
- integer y = 108
- integer width = 3639
- integer height = 312
- integer taborder = 30
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- boolean border = false
- boolean showheader = false
- boolean trackselect = true
- boolean oneclickactivate = true
- boolean twoclickactivate = true
- boolean headerdragdrop = true
- string largepicturename[] = {"graphics\icon_big_00.png","graphics\icon_big_01.png","graphics\icon_big_02.png","graphics\icon_big_03.png","graphics\icon_big_04.png","graphics\icon_big_05.png","graphics\icon_big_06.png","graphics\icon_big_07.png","graphics\icon_big_08.png","graphics\icon_big_09.png","graphics\icon_big_plug.png"}
- long largepicturemaskcolor = 536870912
- long smallpicturemaskcolor = 536870912
- long statepicturemaskcolor = 536870912
- end type
- event doubleclicked;Long mainid
- listviewitem l_lvi
- s_sys_func s_lss
- string ls_text, dsEventName
- IF THIS.SelectedIndex() > 0 THEN
- THIS.GetItem(THIS.SelectedIndex(),l_lvi)
- s_lss = l_lvi.Data
- mainid = s_lss.mainid
-
- ls_text = l_lvi.label
-
- IF Pos(ls_text,'(嵌入式)') > 0 THEN
- dsEventName = 'ue_main_meun_report'
- ELSEIF Pos(ls_text,'(外挂)') > 0 THEN
- dsEventName = 'ue_main_meun_plugins'
- ELSE
- dsEventName = 'ue_main_menu_commnd'
- END IF
-
- PARENT.getparent().getparent().postEvent(dsEventName,mainid,mainid)
-
- END IF
- end event
- event rightclicked;
- m_Dfc_Control_PopupMenu dmPopupMenu
- String menustr
- menustr = "Text=删除快捷方式~tEvent=ue_del_shortcut"
- IF Len(Trim(menustr)) <> 0 THEN
- dmPopupMenu = CREATE m_Dfc_Control_PopupMenu
- dmPopupMenu.mf_BuildMenu(THIS, menustr)
- dmPopupMenu.mf_PopMenu()
- DESTROY dmPopupMenu
- END IF
- end event
- type tabpage_2 from userobject within tab_1
- integer x = 18
- integer y = 96
- integer width = 3643
- integer height = 2460
- long backcolor = 16777215
- string text = "销售供应链"
- long tabtextcolor = 33554432
- long tabbackcolor = 16777215
- long picturemaskcolor = 536870912
- end type
- type tabpage_3 from userobject within tab_1
- integer x = 18
- integer y = 96
- integer width = 3643
- integer height = 2460
- long backcolor = 16777215
- string text = "采购供应链"
- long tabtextcolor = 33554432
- long tabbackcolor = 16777215
- long picturemaskcolor = 536870912
- end type
|