/* ----------------------------------------------------------------------------- This source file is part of OpenSpace3D For the latest info, see http://www.openspace3d.com Copyright (c) 2012 I-maginer This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA, or go to http://www.gnu.org/copyleft/lesser.txt ----------------------------------------------------------------------------- */ struct TreeUnit = [ TU_ctrlItem : EdTreeItem, TU_parentstr : TreeUnit, TU_sLabel : S, TU_sId : S, TU_iDepth : I, TU_iMode : I, TU_bIsUrl : I, TU_sPath : S, TU_sUrl : S, TU_iStates : I, TU_iNbFrames : I, TU_iNbFps : I, TU_bUnfold : I, TU_bIsCheckable : I, TU_bCheckInit : I, TU_lChildren : [TreeUnit r1] ]mkTreeUnit;; struct PlugMenuTree = [ PMT_ctrltree : EdControl, PMT_ctrlmenu : EdTreeItem, PMT_lItems : [TreeUnit r1], PMT_selected : TreeUnit, PMT_prevSelected : TreeUnit ]mkPlugMenuTree;; fun getTreeSave(litems, prefix, suffix)= let nil -> save in if litems == nil then nil else ( let if prefix == nil then "" else prefix -> prefix in let if suffix == nil then "" else suffix -> suffix in let sizelist litems -> size in let 0 -> i in while (litems != nil) do ( let hd litems -> item in let (strcatn suffix::"_"::(itoa i)::nil) -> newsuffix in let (strcat prefix item.TU_sId) -> eventprefix in let if (item.TU_bIsCheckable) then ["EVENT" (strcat eventprefix " checked")]:: ["EVENT" (strcat eventprefix " unchecked")]:: ["ACTION" (strcat eventprefix " check")]:: ["ACTION" (strcat eventprefix " uncheck")]:: nil else ["EVENT" eventprefix]:: nil -> levents in let getTreeSave item.TU_lChildren (strcat eventprefix " > ") newsuffix -> childrensave in ( if childrensave == nil then nil else set save = lcat childrensave save; set save = lcat levents save; set save = [(strcat "item" newsuffix) item.TU_sLabel]:: [(strcat "id" newsuffix) item.TU_sId]:: [strcat "path" newsuffix item.TU_sPath]:: [strcat "mode" newsuffix (itoa item.TU_iMode)]:: [strcat "isurl" newsuffix (itoa item.TU_bIsUrl)]:: [strcat "url" newsuffix item.TU_sUrl]:: [strcat "btnstates" newsuffix (itoa item.TU_iStates)]:: [strcat "nbframes" newsuffix (itoa item.TU_iNbFrames)]:: [strcat "nbfps" newsuffix (itoa item.TU_iNbFps)]:: [strcat "unfold" newsuffix (itoa item.TU_bUnfold)]:: [strcat "ischeckable" newsuffix (itoa item.TU_bIsCheckable)]:: [strcat "checkinit" newsuffix (itoa item.TU_bCheckInit)]:: save; ); set litems = tl litems; set i = i + 1; ); save; );; fun saveTreeUnit(tosave, p) = let p -> [ctrlmode /*ctrlisurl ctrlurl*/ ctrlpath ctrlstates ctrlnbframes ctrlnbfps ctrlunfold ctrlischeckable ctrlcheckinit] in ( if tosave.TU_iDepth != 1 then nil else ( set tosave.TU_iMode = getSelectedEdCtrlSelectPos ctrlmode; //set tosave.TU_bIsUrl = getEdCtrlCheckState ctrlisurl; //set tosave.TU_sUrl = getEdCtrlTextLineValue ctrlurl; set tosave.TU_sPath = getEdCtrlTextLineValue ctrlpath; set tosave.TU_iStates = getSelectedEdCtrlSelectPos ctrlstates; set tosave.TU_iNbFrames = ftoi getEdCtrlFloatValue ctrlnbframes; set tosave.TU_iNbFps = ftoi getEdCtrlFloatValue ctrlnbfps; set tosave.TU_bUnfold = getEdCtrlCheckState ctrlunfold; ); set tosave.TU_bIsCheckable = getEdCtrlCheckState ctrlischeckable; set tosave.TU_bCheckInit = getEdCtrlCheckState ctrlcheckinit; ); 0;; fun cbCloseEdit(p)= let p -> [posstr treestr ctrltree ctrlmenu ctrlmenupos ctrlxmargin ctrlymargin ctrlxoffset ctrlyoffset ctrlmode /*ctrlisurl ctrlurl*/ ctrlpath ctrlstates ctrlnbframes ctrlnbfps ctrlunfold ctrlischeckable ctrlcheckinit theltselector ctrlshow] in ( saveTreeUnit treestr.PMT_selected [ctrlmode /*ctrlisurl ctrlurl*/ ctrlpath ctrlstates ctrlnbframes ctrlnbfps ctrlunfold ctrlischeckable ctrlcheckinit]; let getSelectedEdCtrlSelectPos ctrlmenupos -> menupos in let ftoi getEdCtrlFloatValue ctrlxmargin -> xmargin in let ftoi getEdCtrlFloatValue ctrlymargin -> ymargin in let ftoi getEdCtrlFloatValue ctrlxoffset -> levelxoffset in let ftoi getEdCtrlFloatValue ctrlyoffset -> levelyoffset in let getThemeEltSelectorSave theltselector -> thdefsave in let getEdCtrlCheckState ctrlshow -> show in let getTreeSave treestr.PMT_lItems nil nil -> treesave in let getInterfaceSaveData posstr -> possave in ["menupos" itoa menupos]:: ["xmargin" itoa xmargin]:: ["ymargin" itoa ymargin]:: ["levelxoffset" itoa levelxoffset]:: ["levelyoffset" itoa levelyoffset]:: ["show" itoa show]:: (lcat (lcat treesave possave) thdefsave); );; fun loadTreeUnit(selected, p)= let p -> [ctrllabel ctrlid ctrlmode /*ctrlisurl ctrlurl*/ ctrlpath pickfilebtn refreshpath ctrlstates ctrlnbframes ctrlnbfps ctrlunfold ctrlischeckable ctrlcheckinit] in ( if (selected != nil && selected.TU_iDepth == 1) then ( setEdCtrlSelectEnable ctrlmode 1; //setEdCtrlCheckEnable ctrlisurl 1; setEdCtrlSelectEnable ctrlstates 1; setEdCtrlFloatEnable ctrlnbframes 1; setEdCtrlFloatEnable ctrlnbfps 1; setEdCtrlCheckEnable ctrlunfold 1; selectEdCtrlSelectByPos ctrlmode selected.TU_iMode; //setEdCtrlCheckState ctrlisurl selected.TU_bIsUrl; //setEdCtrlTextLineValue ctrlurl selected.TU_sUrl; //setEdCtrlTextLineEnable ctrlurl selected.TU_bIsUrl; setEdCtrlTextLineValue ctrlpath selected.TU_sPath; setEdCtrlButtonEnable pickfilebtn !(selected.TU_bIsUrl); setEdCtrlButtonEnable refreshpath !(selected.TU_bIsUrl); selectEdCtrlSelectByPos ctrlstates selected.TU_iStates; setEdCtrlFloatValue ctrlnbframes itof selected.TU_iNbFrames; setEdCtrlFloatValue ctrlnbfps itof selected.TU_iNbFps; setEdCtrlCheckState ctrlunfold selected.TU_bUnfold; ) else ( setEdCtrlSelectEnable ctrlmode 0; //setEdCtrlCheckEnable ctrlisurl 0; setEdCtrlSelectEnable ctrlstates 0; setEdCtrlFloatEnable ctrlnbframes 0; setEdCtrlFloatEnable ctrlnbfps 0; setEdCtrlCheckEnable ctrlunfold 0; selectEdCtrlSelectByPos ctrlmode 0; //setEdCtrlCheckState ctrlisurl 0; //setEdCtrlTextLineValue ctrlurl ""; //setEdCtrlTextLineEnable ctrlurl 0; setEdCtrlTextLineValue ctrlpath ""; setEdCtrlButtonEnable pickfilebtn 0; setEdCtrlButtonEnable refreshpath 0; selectEdCtrlSelectByPos ctrlstates 0; setEdCtrlFloatValue ctrlnbframes 1.0; setEdCtrlFloatValue ctrlnbfps 0.0; setEdCtrlCheckState ctrlunfold 0; ); if (selected == nil || selected.TU_iDepth <= 1) then ( setEdCtrlCheckEnable ctrlischeckable 0; setEdCtrlCheckState ctrlischeckable 0; setEdCtrlCheckEnable ctrlcheckinit 0; setEdCtrlCheckState ctrlcheckinit 0; ) else ( setEdCtrlCheckEnable ctrlischeckable 1; setEdCtrlCheckState ctrlischeckable selected.TU_bIsCheckable; setEdCtrlCheckEnable ctrlcheckinit selected.TU_bIsCheckable; setEdCtrlCheckState ctrlcheckinit selected.TU_bCheckInit; ); if (selected != nil) then ( setEdCtrlTextLineEnable ctrlid 1; setEdCtrlTextLineValue ctrlid selected.TU_sId; setEdCtrlTextLineEnable ctrllabel 1; setEdCtrlTextLineValue ctrllabel selected.TU_sLabel; ) else ( setEdCtrlTextLineEnable ctrlid 0; setEdCtrlTextLineValue ctrlid "Menu"; setEdCtrlTextLineEnable ctrllabel 0; setEdCtrlTextLineValue ctrllabel "Menu"; ) ); 0;; fun getSelectedStr(litems, ctrltree, itemfather, selected)= let getEdCtrlTreeValueByItem ctrltree itemfather -> [fvalue ftype] in let getEdCtrlTreeValueByItem ctrltree selected -> [value type] in let (hd litems) -> item in let item.TU_iDepth -> depth in let nil -> selectedstr in let 0 -> i in ( if type <= 0 then nil else if depth < ftype then ( let sizelist litems -> size in while i < size && selectedstr == nil do ( let nth_list litems i -> itemstr in set selectedstr = getSelectedStr itemstr.TU_lChildren ctrltree itemfather selected; set i = i + 1; ); ) else if depth == ftype then ( let sizelist litems -> size in while i < size && selectedstr == nil do ( let nth_list litems i -> itemstr in if itemstr.TU_ctrlItem != itemfather then nil else set selectedstr = getSelectedStr itemstr.TU_lChildren ctrltree itemfather selected; set i = i + 1; ); ) else ( let sizelist litems -> size in while i < size && selectedstr == nil do ( let nth_list litems i -> itemstr in if itemstr.TU_ctrlItem != selected then nil else set selectedstr = itemstr; set i = i + 1; ); ); selectedstr; );; fun cbTreeSelect(ctrlstr, itemfather, selected, value, type, p)= let p -> [treestr ctrllabel ctrlid addmenubtn editmenubtn delmenubtn ctrlmode /*ctrlisurl ctrlurl*/ ctrlpath pickfilebtn refreshpath ctrlstates ctrlnbframes ctrlnbfps ctrlunfold ctrlischeckable ctrlcheckinit] in let getEdCtrlTextLineValue ctrlpath -> path in //let getEdCtrlTextLineValue ctrlurl -> url in ( set treestr.PMT_prevSelected = treestr.PMT_selected; set treestr.PMT_selected = getSelectedStr treestr.PMT_lItems ctrlstr itemfather selected; if (type == 0) then ( setEdCtrlButtonEnable editmenubtn 0; setEdCtrlButtonEnable delmenubtn 0; ) else ( setEdCtrlButtonEnable editmenubtn 1; setEdCtrlButtonEnable delmenubtn 1; ); //limit the depth of the menu if (type >= 3) then setEdCtrlButtonEnable addmenubtn 0 else setEdCtrlButtonEnable addmenubtn 1; saveTreeUnit treestr.PMT_prevSelected [ctrlmode /*ctrlisurl ctrlurl*/ ctrlpath ctrlstates ctrlnbframes ctrlnbfps ctrlunfold ctrlischeckable ctrlcheckinit]; loadTreeUnit treestr.PMT_selected [ctrllabel ctrlid ctrlmode /*ctrlisurl ctrlurl*/ ctrlpath pickfilebtn refreshpath ctrlstates ctrlnbframes ctrlnbfps ctrlunfold ctrlischeckable ctrlcheckinit]; ); 0;; fun getNewId(brotherlist)= let sizelist brotherlist -> size in let size + 1 -> idnumber in let strcat "Menu " (itoa idnumber) -> newId in let 0 -> i in ( while (i < size) do ( let nth_list brotherlist i -> treeunit in if (strcmpi newId treeunit.TU_sId) != 0 then set i = i + 1 else ( set idnumber = idnumber + 1; set newId = strcat "Menu " (itoa idnumber); set i = 0; ); ); newId; );; fun cbAddMenu(ctrlstr, p)= let p -> [treestr ctrlnew] in let treestr.PMT_selected -> selected in let if selected == nil then treestr.PMT_ctrlmenu else selected.TU_ctrlItem -> selecteditem in let strtrim getEdCtrlTextLineValue ctrlnew -> label in let getNewId (if selected == nil then treestr.PMT_lItems else selected.TU_lChildren) -> newId in let getEdCtrlTreeValueByItem treestr.PMT_ctrltree selecteditem -> [value type] in let (type + 1) -> depth in if (type >= 3) || (label == nil) || ((strcmpi label "") == 0) then nil else ( let addEdCtrlTreeItem treestr.PMT_ctrltree selecteditem label label depth strcat APPBASEDIR "os3deditor/res/tree_menu.png" -> new in let mkTreeUnit[new selected label newId depth 0 0 nil nil 0 1 15 0 0 0 nil] -> newstr in ( if selected == nil then set treestr.PMT_lItems = lcat treestr.PMT_lItems newstr::nil else set selected.TU_lChildren = lcat selected.TU_lChildren newstr::nil; selEdCtrlTreeItem treestr.PMT_ctrltree new; ); setEdCtrlTextLineValue ctrlnew ""; ); 0;; fun cbAdd(ctrlstr, value, p)= cbAddMenu nil p; 0;; fun checkBrothers(brotherlist, selected, id)= let 1 -> ret in ( while (brotherlist != nil) do ( let hd brotherlist -> treeunit in if (treeunit == selected || (strcmpi treeunit.TU_sId id) != 0) then nil else set ret = 0; set brotherlist = tl brotherlist; ); ret; );; fun cbEditMenu(ctrlstr, p)= let p -> [treestr ctrlid ctrllabel ewinstr] in let treestr.PMT_selected -> selected in let if selected.TU_parentstr == nil then treestr.PMT_lItems else selected.TU_parentstr.TU_lChildren -> brotherlist in let strtrim getEdCtrlTextLineValue ctrllabel -> label in let strtrim getEdCtrlTextLineValue ctrlid -> id in if (label == nil) || ((strcmpi label "") == 0) || (id == nil) || ((strcmpi id "") == 0) then ( _DLGMessageBox _channel ewinstr.EDW_win (loc "OS3DMENU_0035") (loc "OS3DMENU_0036") 0; 0; ) else if ((checkBrothers brotherlist selected id) == 0) then ( _DLGMessageBox _channel ewinstr.EDW_win (loc "OS3DMENU_0035") (loc "OS3DMENU_0037") 0; 0; ) else ( setEdCtrlTreeLabel treestr.PMT_ctrltree selected.TU_ctrlItem label; set selected.TU_sLabel = label; set selected.TU_sId = id; 0; ); 0;; fun cbEdit(ctrlstr, value, p)= cbEditMenu nil p; 0;; fun cbDelMenu(ctrlstr, p)= let p -> [treestr] in let treestr.PMT_selected -> selected in ( delEdCtrlTreeItem treestr.PMT_ctrltree selected.TU_ctrlItem; if selected.TU_parentstr == nil then set treestr.PMT_lItems = remove_from_list treestr.PMT_lItems selected else set selected.TU_parentstr.TU_lChildren = remove_from_list selected.TU_parentstr.TU_lChildren selected; ); 0;; /* fun cbCheckUrl(ctrl, state, p)= let p -> [ctrlurl ctrlpath pickbtn] in if state then ( setEdCtrlTextLineEnable ctrlurl 1 ; setEdCtrlTextLineValue ctrlpath nil; setEdCtrlButtonEnable pickbtn 0; ) else ( setEdCtrlTextLineEnable ctrlurl 0; setEdCtrlButtonEnable pickbtn 1; ); 0;; */ fun cbDlgGetPath(dlg, p, pfile)= let p -> [inst ctrlbtn winstr ctrlpath /*ctrlurl ctrlisurl*/] in ( if pfile == nil then nil else let _PtoScol pfile -> file in if file == nil then ( _DLGMessageBox _channel winstr.EDW_win (loc "OS3DMENU_0018") (loc "OS3DMENU_0019") 0; 0; ) else ( setEdCtrlTextLineValue ctrlpath file; //setEdCtrlTextLineValue ctrlurl nil; //setEdCtrlCheckState ctrlisurl 0; 0; ); setEdCtrlButtonEnable ctrlbtn 1; ); 0;; fun cbBtnPickFile(ctrlbtn, p)= let p -> [inst winstr ctrlpath /*ctrlurl ctrlisurl*/] in let getEdCtrlTextLineValue ctrlpath -> path in let getPathFile path "" -> [fpath fname] in ( setEdCtrlButtonEnable ctrlbtn 1; _DLGrflopen _DLGOpenFile _channel winstr.EDW_win fpath fname "Bitmaps\0*.bmp;*.jpg;*.png;*.tga;\0Bitmap\0*.bmp\0Jpeg\0*.jpg\0Png\0*.png\0Targa\0*.tga\0All\0*.*\0\0" @cbDlgGetPath [inst ctrlbtn winstr ctrlpath /*ctrlurl ctrlisurl*/]; ); 0;; fun cbRefreshBtn(pickbtn, p)= let p -> [inst winstr ctrlobjname] in setEdCtrlTextLineValue ctrlobjname ""; 0;; fun cbIsCheckableCheckbox(ctrlstr, state, ctrlcheckinit)= if state then setEdCtrlCheckEnable ctrlcheckinit 1 else setEdCtrlCheckEnable ctrlcheckinit 0; 0;; fun getItem(inst, parentstr, item, label, depth, suffix)= let (getPluginInstanceParam inst strcat "id" suffix) -> id in let (getPluginInstanceParam inst strcat "path" suffix) -> path in let atoi (getPluginInstanceParam inst strcat "mode" suffix) -> mode in let if mode == nil then 0 else mode -> mode in let atoi (getPluginInstanceParam inst strcat "isurl" suffix) -> isurl in let if isurl == nil then 0 else isurl -> isurl in let (getPluginInstanceParam inst strcat "url" suffix) -> url in let atoi (getPluginInstanceParam inst strcat "btnstates" suffix) -> btnstates in let if btnstates == nil then 0 else btnstates -> btnstates in let atoi (getPluginInstanceParam inst strcat "nbframes" suffix) -> nbframes in let if (nbframes == nil) || (nbframes < 1) then 1 else nbframes -> nbframes in let atoi (getPluginInstanceParam inst strcat "nbfps" suffix) -> nbfps in let if (nbfps == nil) || (nbfps < 0) then 0 else nbfps -> nbfps in let atoi (getPluginInstanceParam inst strcat "unfold" suffix) -> unfold in let if (unfold == nil) then 0 else unfold -> unfold in let atoi (getPluginInstanceParam inst strcat "ischeckable" suffix) -> ischeckable in let if (ischeckable == nil) then 0 else ischeckable -> ischeckable in let atoi (getPluginInstanceParam inst strcat "checkinit" suffix) -> checkinit in let if (checkinit == nil) then 0 else checkinit -> checkinit in mkTreeUnit [item parentstr label id depth mode isurl path url btnstates nbframes nbfps unfold ischeckable checkinit nil];; fun fillTree(inst, treestr, parentstr, suffix)= let if suffix == nil then "" else suffix -> suffix in let if parentstr == nil then treestr.PMT_ctrlmenu else parentstr.TU_ctrlItem -> ctrlparent in let if parentstr == nil then 0 else parentstr.TU_iDepth -> type in let nil -> litems in let 0 -> i in let 0 -> end in ( while end != 1 do ( let (strcatn suffix::"_"::(itoa i)::nil) -> newsuffix in let getPluginInstanceParam inst strcat "item" newsuffix -> label in ( if label == nil then set end = 1 else ( let addEdCtrlTreeItem treestr.PMT_ctrltree ctrlparent label label (type + 1) (strcat APPBASEDIR "os3deditor/res/tree_menu.png") -> newitem in let getItem inst parentstr newitem label (type + 1) newsuffix -> itemstr in ( fillTree inst treestr itemstr newsuffix; set litems = itemstr::litems; ); 0; ); ); set i = i + 1; ); if parentstr == nil then set treestr.PMT_lItems = revertlist litems else set parentstr.TU_lChildren = revertlist litems; ); 0;; fun cbDragTreeMenu(ctrlstr, telem1, telem2, treestr)= let telem1 -> [e1father e1str e1val e1type] in let telem2 -> [e2father e2str e2val e2type] in ( let getSelectedStr treestr.PMT_lItems ctrlstr e1str.EDTITEM_father e1str -> unit1str in let getSelectedStr treestr.PMT_lItems ctrlstr e2str.EDTITEM_father e2str -> unit2str in if ((unit1str == nil) || (unit2str == nil) || (unit1str.TU_parentstr != unit2str.TU_parentstr)) then nil else ( changeEdCtrlTreeItemPos ctrlstr e1str e2str; if (unit2str.TU_parentstr == nil) then ( set treestr.PMT_lItems = remove_from_list treestr.PMT_lItems unit1str; let pos_in_list treestr.PMT_lItems unit2str 0 -> npos in set treestr.PMT_lItems = add_nth_in_list treestr.PMT_lItems npos + 1 unit1str; ) else ( set unit1str.TU_parentstr.TU_lChildren = remove_from_list unit1str.TU_parentstr.TU_lChildren unit1str; let pos_in_list unit2str.TU_parentstr.TU_lChildren unit2str 0 -> npos in set unit2str.TU_parentstr.TU_lChildren = add_nth_in_list unit2str.TU_parentstr.TU_lChildren npos + 1 unit1str; ); ); ); 0;; fun dynamicedit(ewinstr, inst, viewstr, applybtn)= let [455 530] -> [iw ih] in let 10 -> ypos in ( setEdWindowSize ewinstr iw ih; let atoi (getPluginInstanceParam inst "menupos") -> menupos in let if (menupos == nil) then 2 else menupos -> menupos in let atoi (getPluginInstanceParam inst "xmargin") -> xmargin in let if (xmargin == nil) then 5 else xmargin -> xmargin in let atoi (getPluginInstanceParam inst "ymargin") -> ymargin in let if (ymargin == nil) then 5 else ymargin -> ymargin in let atoi (getPluginInstanceParam inst "levelxoffset") -> levelxoffset in let if (levelxoffset == nil) then 10 else levelxoffset -> levelxoffset in let atoi (getPluginInstanceParam inst "levelyoffset") -> levelyoffset in let if (levelyoffset == nil) then 0 else levelyoffset -> levelyoffset in let atoi (getPluginInstanceParam inst "show") -> show in let if (show == nil) then 1 else show -> show in let crPositionInterface inst viewstr ewinstr (loc "OS3DMENU_0007") (iPOS_INTERFACE_2D_NO_BACKGROUND_NO_KEEPRATIO | iPOS_INTERFACE_MAT | iPOS_INTERFACE_3D/* | iPOS_INTERFACE_VR*/) iw ih -> posstr in let crEdFrameWindow _channel ewinstr 0 0 iw 470 EDWIN_RESIZE_MW nil (loc "OS3DMENU_0009") (loc "OS3DMENU_0005") -> winfrm in let crEdWindow _channel winfrm 0 18 iw 445 WN_CHILDINSIDE|WN_NOBORDER EDWIN_RESIZE_MW nil nil -> winstr in let crEdCtrlTree winstr 10 (set ypos = 10) 200 250 EDWIN_RESIZE_MW -> ctrltree in let addEdCtrlTreeItem ctrltree nil "menu" "menu" 0 strcat APPBASEDIR "os3deditor/res/tree_menu.png" -> ctrlmenu in let crEdCtrlLabel winstr 220 (ypos + 2) 120 20 (loc "OS3DMENU_0021") nil -> labelmenupos in let crEdCtrlSelect winstr 350 ypos 105 120 EDWIN_RESIZE_MW -> ctrlmenupos in let crEdCtrlLabel winstr 220 ((set ypos = ypos + 25) + 2) 120 20 (loc "OS3DMENU_0029") nil -> labelxmargin in let crEdCtrlFloat winstr 350 ypos 50 20 (itof xmargin) 0.0 10000.0 1.0 0 nil EDWIN_RESIZE_MW -> ctrlxmargin in let crEdCtrlFloat winstr 405 ypos 50 20 (itof ymargin) 0.0 10000.0 1.0 0 nil EDWIN_RESIZE_MW -> ctrlymargin in let crEdCtrlLabel winstr 220 ((set ypos = ypos + 25) + 2) 120 20 (loc "OS3DMENU_0030") nil -> labeloffset in let crEdCtrlFloat winstr 350 ypos 50 20 (itof levelxoffset) 0.0 10000.0 1.0 0 nil EDWIN_RESIZE_MW -> ctrlxoffset in let crEdCtrlFloat winstr 405 ypos 50 20 (itof levelyoffset) 0.0 10000.0 1.0 0 nil EDWIN_RESIZE_MW -> ctrlyoffset in let crEdCtrlLabel winstr 220 ((set ypos = ypos + 50) + 2) 45 20 (loc "OS3DMENU_0032") nil -> labelid in let crEdCtrlTextLine winstr 275 ypos 180 20 "" nil EDWIN_RESIZE_MW -> ctrlid in let crEdCtrlLabel winstr 220 ((set ypos = ypos + 25) + 2) 45 20 (loc "OS3DMENU_0033") nil -> labellabel in let crEdCtrlTextLine winstr 275 ypos 180 20 "" nil EDWIN_RESIZE_MW -> ctrllabel in let crEdCtrlButton winstr 300 (set ypos = ypos + 25) 75 20 (loc "OS3DMENU_0003") nil -> editmenubtn in let crEdCtrlButton winstr 380 ypos 75 20 (loc "OS3DMENU_0004") nil -> delmenubtn in let crEdCtrlLabel winstr 220 ((set ypos = ypos + 30) + 2) 200 20 (loc "OS3DMENU_0034") nil -> labelnew in let crEdCtrlTextLine winstr 220 (set ypos = ypos + 25) 155 20 "" nil EDWIN_RESIZE_MW -> ctrlnew in let crEdCtrlButton winstr 380 ypos 75 20 (loc "OS3DMENU_0002") nil -> addmenubtn in let crEdCtrlCheck winstr 10 (set ypos = 270) 170 20 (loc "OS3DMENU_0008") EDWIN_RESIZE_MW -> ctrlischeckable in let crEdCtrlCheck winstr 190 ypos 170 20 (loc "OS3DMENU_0031") EDWIN_RESIZE_MW -> ctrlcheckinit in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 170 20 (loc "OS3DMENU_0026") nil -> labelmode in let crEdCtrlSelect winstr 190 ypos (iw - 190) 70 EDWIN_RESIZE_MW -> ctrlmode in //let crEdCtrlCheck winstr 10 (set ypos = ypos + 25) 100 20 (loc "OS3DMENU_0020") EDWIN_RESIZE_MW -> ctrlisurl in //let crEdCtrlTextLine winstr 300 ypos 140 20 "" nil EDWIN_RESIZE_MW -> ctrlurl in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 170 20 (loc "OS3DMENU_0010") nil -> labelobj in let crEdCtrlTextLine winstr 190 ypos 175 20 "" nil EDWIN_RESIZE_MW -> ctrlpath in let crEdCtrlButton winstr 370 ypos 45 20 "..." nil -> pickfilebtn in let crEdCtrlButton winstr 420 ypos 35 20 "X" nil -> refreshpath in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 170 20 (loc "OS3DMENU_0011") nil -> labelstates in let crEdCtrlSelect winstr 190 ypos (iw - 190) 120 EDWIN_RESIZE_MW -> ctrlstates in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 170 20 (loc "OS3DMENU_0012") nil -> labelnbframes in let crEdCtrlFloat winstr 190 ypos 100 20 1.0 1.0 10000.0 1.0 0 nil EDWIN_RESIZE_MW -> ctrlnbframes in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 170 20 (loc "OS3DMENU_0013") nil -> labelnbfps in let crEdCtrlFloat winstr 190 ypos 100 20 15.0 0.0 10000.0 1.0 0 nil EDWIN_RESIZE_MW -> ctrlnbfps in let crEdCtrlCheck winstr 10 (set ypos = ypos + 25) 280 20 (loc "OS3DMENU_0038") EDWIN_RESIZE_MW -> ctrlunfold in let crThemeEltSelector inst ewinstr nil "menu"::nil iw ih -> theltselector in let crEdFrameWindow _channel ewinstr 0 0 iw 60 EDWIN_RESIZE_MW nil (loc "OS3DMENU_0006") (loc "OS3DMENU_0005") -> winfrm in let crEdWindow _channel winfrm 0 18 iw 35 WN_CHILDINSIDE|WN_NOBORDER EDWIN_RESIZE_MW nil nil -> winstr in let crEdCtrlCheck winstr 10 (set ypos = 10) 280 20 (loc "OS3DMENU_0001") EDWIN_RESIZE_MW -> ctrlshow in let mkPlugMenuTree[ctrltree ctrlmenu nil nil nil] -> treestr in let V3DgetDefaultSession viewstr -> sessionstr in ( fillTree inst treestr nil nil; setEdCtrlTreeCbDrag ctrltree mkfun4 @cbDragTreeMenu treestr; setEdCtrlTreeExpandAll ctrltree 1; setEdCtrlTreeCbSelect ctrltree mkfun6 @cbTreeSelect [treestr ctrllabel ctrlid addmenubtn editmenubtn delmenubtn ctrlmode /*ctrlisurl ctrlurl*/ ctrlpath pickfilebtn refreshpath ctrlstates ctrlnbframes ctrlnbfps ctrlunfold ctrlischeckable ctrlcheckinit]; selEdCtrlTreeItem ctrltree ctrlmenu; fillEdCtrlSelect ctrlmenupos (loc "OS3DMENU_0022")::(loc "OS3DMENU_0023")::(loc "OS3DMENU_0024")::(loc "OS3DMENU_0025")::nil; selectEdCtrlSelectByPos ctrlmenupos menupos; setEdCtrlTextLineCbValidate ctrlid mkfun3 @cbEdit [treestr ctrlid ctrllabel ewinstr]; setEdCtrlTextLineCbValidate ctrllabel mkfun3 @cbEdit [treestr ctrlid ctrllabel ewinstr]; setEdCtrlTextLineCbValidate ctrlnew mkfun3 @cbAdd [treestr ctrlnew]; setEdCtrlButtonCb addmenubtn mkfun2 @cbAddMenu [treestr ctrlnew]; setEdCtrlButtonCb editmenubtn mkfun2 @cbEditMenu [treestr ctrlid ctrllabel ewinstr]; setEdCtrlButtonCb delmenubtn mkfun2 @cbDelMenu [treestr]; setEdCtrlCheckCbState ctrlischeckable mkfun3 @cbIsCheckableCheckbox ctrlcheckinit; fillEdCtrlSelect ctrlmode (loc "OS3DMENU_0027")::(loc "OS3DMENU_0028")::nil; //setEdCtrlCheckCbState ctrlisurl mkfun3 @cbCheckUrl [ctrlurl ctrlpath pickfilebtn]; setEdCtrlTextLineEnable ctrlpath 0; setEdCtrlButtonCb pickfilebtn mkfun2 @cbBtnPickFile [inst winstr ctrlpath /*ctrlurl ctrlisurl*/]; setEdCtrlButtonCb refreshpath mkfun2 @cbRefreshBtn [inst winstr ctrlpath]; fillEdCtrlSelect ctrlstates (loc "OS3DMENU_0017")::(loc "OS3DMENU_0016")::(loc "OS3DMENU_0015")::(loc "OS3DMENU_0014")::nil; setEdCtrlCheckState ctrlshow show; [mkfun1 @cbCloseEdit [posstr treestr ctrltree ctrlmenu ctrlmenupos ctrlxmargin ctrlymargin ctrlxoffset ctrlyoffset ctrlmode /*ctrlisurl ctrlurl*/ ctrlpath ctrlstates ctrlnbframes ctrlnbfps ctrlunfold ctrlischeckable ctrlcheckinit theltselector ctrlshow] nil]; ); );;