macroScript QuickNav category:"RPManager" tooltip:"Quick Navigate Scenes 1.00 .NET" ( global quickNav, QOmenu, QOPathManager local nameTemp, whatToDo, quickNavWhatToDo try(cui.UnRegisterDialogBar quickNav)catch() try(destroydialog quickNav )catch() fn makeOLEcolor input = ( -- no longer used, just return (lazy, should remove) return input ) function getNETColor hColor = ( local dnColor = dotNetClass "System.Drawing.Color" dnColor.fromARGB hColor.r hColor.g hColor.b ) function getColorNET hColor = ( local dnColor = dotNetClass "System.Drawing.Color" dnColor.fromARGB hColor.r hColor.g hColor.b return (color hcolor.r hcolor.g hcolor.b) ) rollout whatToDo "QuickNav: No paths ini file found" width:423 height:35 ( button new "Create new paths .ini file" pos:[6,6] width:161 height:22 button pick "Pick existing paths .ini file" pos:[169,6] width:161 height:22 button cancel "Cancel" pos:[333,6] width:83 height:22 on new pressed do (quickNavWhatToDo = false; destroydialog whatToDo ) on pick pressed do (quickNavWhatToDo = true; destroydialog whatToDo ) on cancel pressed do (quickNavWhatToDo = #cancel; destroydialog whatToDo ) ) rollout defineSetName "Define Set Name" width:330 height:50 ( edittext sltNme "" pos:[1,4] width:325 height:18 fieldwidth:280 button oker "OK" pos:[185,27] width:141 height:19 button canc "Cancel" pos:[5,27] width:141 height:19 local closeFlag = 0 on defineSetName open do ( if nametemp != undefined do ( sltNme.text = nameTemp ) ) on canc pressed do ( try(rpmdata.nameTemp = undefined)catch() DestroyDialog defineSetName ) on sltNme changed val do ( for i in 1 to sltNme.text.count do ( if sltNme.text[i] == "\n" do ( -- remove the return slotName = (replace sltNme.text (i - 1) 2 "") sltNme.text = slotName nameTemp = sltNme.text if sltNme.text != "" then ( nameTemp = sltNme.text DestroyDialog defineSetName ) else messagebox "You must type a name" ) ) ) on oker pressed do ( if sltNme.text != "" then ( nameTemp = sltNme.text closeFlag = 1 if closeFlag == 1 do try (DestroyDialog defineSetName) catch() ) else messagebox "You must type a name" ) on addNamePicker open do setfocus sltNme ) rollout QOPathManager "Quick Nav Path Manager" width:1000 height:862 ( local whereIniPathsFile local LVM_FIRST = 0x1000, LVM_SETCOLUMNWIDTH = (LVM_FIRST + 30) GroupBox grp1 "Container Paths - this will list all directories within the path(s) chosen" pos:[4,4] width:990 height:355 -- ActiveXControl containerList "{BDD1F04B-858B-11D1-B16A-00C0F0283628}" pos:[13,20] width:975 height:300 dotNetControl containerList "ListView" pos:[13,20] width:975 height:300 button addCPath "Add Container Path" pos:[14,325] width:145 height:24 button remCPath "Remove Path" pos:[162,325] width:145 height:24 edittext altC "Alternate Name:" pos:[713,329] width:222 height:17 GroupBox grp3 "Include Sets:" pos:[3,363] width:990 height:466 --ActiveXControl includeList "{BDD1F04B-858B-11D1-B16A-00C0F0283628}" pos:[229,380] width:756 height:417 dotNetControl includeList "ListView" pos:[229,380] width:756 height:417 button addIPath "Add Include Path" pos:[230,801] width:145 height:24 button remIPath "Remove Path" pos:[378,801] width:145 height:24 edittext altI "Alternate Name:" pos:[709,805] width:222 height:17 colorPicker Ccolor "" pos:[943,327] width:44 height:20 color:(color 0 0 0) title:"" modal:false colorPicker Icolor "" pos:[939,804] width:44 height:20 color:(color 0 0 0) title:"" modal:false edittext cFilter "Filter:" pos:[512,329] width:189 height:17 --ActiveXControl includeSets "{BDD1F04B-858B-11D1-B16A-00C0F0283628}" pos:[12,380] width:201 height:417 dotNetControl includeSets "ListView" pos:[12,380] width:201 height:417 button addIset "Add Set" pos:[11,801] width:72 height:24 button remIset "Remove" pos:[143,801] width:67 height:24 button renameIset "Rename" pos:[84,801] width:58 height:24 groupBox grpb3 "" pos:[221,363] width:772 height:466 label lbl1 " Include Set Paths - the specific path(s) chosen for the current set " pos:[228,364] height:13 button closeMe "Close" pos:[895,833] width:98 height:25 on closeMe pressed do destroydialog QOPathManager on addIset pressed do ( nameTemp = undefined local dpos = getdialogpos QOPathManager setdialogpos QOPathManager [-1000,-1200] createdialog definesetname modal:true setdialogpos QOPathManager dpos if nameTemp != undefined do ( lis = includeSets.items li = lis.Add nameTemp includeSetCount = (getinisetting whereIniPathsFile "IncludeSets" "count") as integer includeSetCount += 1 setinisetting whereIniPathsFile "IncludeSets" "count" (includeSetCount as string) setinisetting whereIniPathsFile "IncludeSets" (includeSetCount as string) nameTemp ) ) on remIset pressed do ( whichItem = includeSets.selecteditems.item[0].index + 1 includeSets.items.remove includeSets.selecteditems.item[0] includeSetCount = (getinisetting whereIniPathsFile "IncludeSets" "count") as integer --includeSetCount += 1 setinisetting whereIniPathsFile "IncludeSets" "count" ((includeSetCount - 1) as string) for i in (whichItem + 1) to includeSetCount do ( toMove = getinisetting whereIniPathsFile "IncludeSets" (i as string) setinisetting whereIniPathsFile "IncludeSets" ((i - 1) as string) tomove ) if (maxversion())[1]>=6000 then ( delinisetting whereIniPathsFile "IncludeSets" (includeSetCount as string) ) else ( setinisetting whereIniPathsFile "IncludeSets" (includeSetCount as string) "" ) ) on renameIset pressed do ( whichItem = includeSets.selecteditems.item[0].index + 1 nameTemp = includeSets.selecteditems.item[0].text local dpos = getdialogpos QOPathManager setdialogpos QOPathManager [-1000,-1200] createdialog definesetname modal:true setdialogpos QOPathManager dpos includeSets.selecteditems.item[0].text = nameTemp setinisetting whereIniPathsFile "IncludeSets" (whichItem as string) nameTemp ) on addCPath pressed do ( getOP =(getsavefilename caption:"Save a null file to the path" filename:"Save to a directory (Leave this field alone)") if getOP == undefined do return() outpath = getfilenamepath getOP if outpath[outpath.count] == "\\" do outpath = substring outpath 1 (outpath.count - 1) lis = containerList.items local li li = lis.Add outpath lis2 = li.subitems li2 = lis2.add "" li2 = lis2.add "" containerPathCount = (getinisetting whereIniPathsFile "Container" "count") as integer setinisetting whereIniPathsFile "Container" "count" ((containerPathCount + 1) as string) setinisetting whereIniPathsFile "Container" ((containerPathCount + 1) as string) outpath ) on remCPath pressed do ( whichItem = containerList.selecteditems.item[0].index + 1 containerList.items.remove containerList.selecteditems.item[0] containerPathCount = (getinisetting whereIniPathsFile "Container" "count") as integer setinisetting whereIniPathsFile "Container" "count" ((containerPathCount - 1) as string) --setinisetting whereIniPathsFile "Container" "count" ((containerPathCount - 1) as string) for i in (whichItem + 1) to containerPathCount do ( toMove = getinisetting whereIniPathsFile "Container" (i as string) setinisetting whereIniPathsFile "Container" ((i - 1) as string) tomove toMove = getinisetting whereIniPathsFile "ContainerColor" (i as string) setinisetting whereIniPathsFile "ContainerColor" ((i - 1) as string) tomove toMove = getinisetting whereIniPathsFile "ContainerFilter" (i as string) setinisetting whereIniPathsFile "ContainerFilter" ((i - 1) as string) tomove toMove = getinisetting whereIniPathsFile "ContainerAltName" (i as string) setinisetting whereIniPathsFile "ContainerAltName" ((i - 1) as string) tomove ) if (maxversion())[1]>=6000 then ( delinisetting whereIniPathsFile "Container" (containerPathCount as string) delinisetting whereIniPathsFile "ContainerColor" (containerPathCount as string) delinisetting whereIniPathsFile "ContainerFilter" (containerPathCount as string) delinisetting whereIniPathsFile "ContainerAltName" (containerPathCount as string) ) else ( setinisetting whereIniPathsFile "Container" (containerPathCount as string) "" setinisetting whereIniPathsFile "ContainerColor" (containerPathCount as string) "" setinisetting whereIniPathsFile "ContainerFilter" (containerPathCount as string) "" setinisetting whereIniPathsFile "ContainerAltName" (containerPathCount as string) "" ) ) on addIPath pressed do ( getOP =(getsavefilename caption:"Save a null file to the path" filename:"Save to a directory (Leave this field alone)") if getOP == undefined do return() outpath = getfilenamepath getOP if outpath[outpath.count] == "\\" do outpath = substring outpath 1 (outpath.count - 1) lis = includeList.items local li li = lis.Add outpath lis2 = li.subitems li2 = lis2.add "" whichItem = (includeSets.selecteditems.item[0].index + 1) as string includePathCount = (getinisetting whereIniPathsFile ("Include" + whichItem) "count") as integer setinisetting whereIniPathsFile ("Include" + whichItem) "count" ((includePathCount + 1) as string) setinisetting whereIniPathsFile ("Include" + whichItem) ((includePathCount + 1) as string) outpath ) on remIPath pressed do ( if includeList.items.count == 0 do return() if includeList.selecteditems.count == 0 do return() whichItem = includeList.selecteditems.item[0].index + 1 whichSet = (includeSets.selecteditems.item[0].index + 1) as string includeList.items.remove includeList.selecteditems.item[0] includePathCount = (getinisetting whereIniPathsFile ("Include" + whichSet) "count") as integer setinisetting whereIniPathsFile ("Include" + whichSet) "count" ((includePathCount - 1) as string) --setinisetting whereIniPathsFile "Container" "count" ((containerPathCount - 1) as string) for i in (whichItem + 1) to includePathCount do ( toMove = getinisetting whereIniPathsFile ("Include" + whichSet) (i as string) setinisetting whereIniPathsFile ("Include" + whichSet) ((i - 1) as string) tomove toMove = getinisetting whereIniPathsFile ("IncludeAltName" + whichSet) (i as string) setinisetting whereIniPathsFile ("IncludeAltName" + whichSet) ((i - 1) as string) tomove toMove = getinisetting whereIniPathsFile ("IncludeColor" + whichSet) (i as string) setinisetting whereIniPathsFile ("IncludeColor" + whichSet) ((i - 1) as string) tomove ) if (maxversion())[1]>=6000 then ( delinisetting whereIniPathsFile ("Include" + whichSet) (includePathCount as string) delinisetting whereIniPathsFile ("IncludeColor" + whichSet) (includePathCount as string) delinisetting whereIniPathsFile ("IncludeAltName" + whichSet) (includePathCount as string) ) else ( setinisetting whereIniPathsFile ("Include" + whichSet) (includePathCount as string) "" setinisetting whereIniPathsFile ("IncludeColor" + whichSet) (includePathCount as string) "" setinisetting whereIniPathsFile ("IncludeAltName" + whichSet) (includePathCount as string) "" ) ) on cfilter entered val do ( if containerList.items.count == 0 do return() if containerList.selecteditems.count == 0 do return() containerList.selecteditems.item[0].subitems.item[2].text = val setinisetting whereIniPathsFile "ContainerFilter" ((containerList.selecteditems.item[0].index + 1) as string) val ) on altC entered val do ( if containerList.items.count == 0 do return() if containerList.selecteditems.count == 0 do return() containerList.selecteditems.item[0].subitems.item[1].text = val setinisetting whereIniPathsFile "ContainerAltName" ((containerList.selecteditems.item[0].index + 1) as string) val ) on cColor changed val do ( if containerList.items.count == 0 do return() if containerList.selecteditems.count == 0 do return() containerList.selecteditems.item[0].forecolor = getNETColor val setinisetting whereIniPathsFile "ContainerColor" ((containerList.selecteditems.item[0].index + 1) as string) (val as string) ) on iColor changed val do ( if includeList.items.count == 0 do return() if includeList.selecteditems.count == 0 do return() whichSet = (includeSets.selecteditems.item[0].index + 1) as string includeList.selecteditems.item[0].forecolor = getNETColor val setinisetting whereIniPathsFile ("IncludeColor"+ whichset) ((includeList.selecteditems.item[0].index + 1) as string) (val as string) ) on altI entered val do ( if includeList.items.count == 0 do return() if includeList.selecteditems.count == 0 do return() whichSet = (includeSets.selecteditems.item[0].index + 1) as string includeList.selecteditems.item[0].subitems.item[1].text = val setinisetting whereIniPathsFile ("IncludeAltName" + whichset) ((includeList.selecteditems.item[0].index + 1) as string) val ) on containerList mouseUp button shift x y do ( if containerList.items.count == 0 do return() if containerList.selecteditems.count == 0 do containerList.items.item[containerList.items.count-1].selected = true altC.text = containerList.selecteditems.item[0].subitems.item[1].text cfilter.text = containerList.selecteditems.item[0].subitems.item[2].text --print containerList.selecteditems.item[0].forecolor cColor.color = getColorNET containerList.selecteditems.item[0].forecolor ) on includeList mouseUp button shift x y do ( if includeList.items.count == 0 do return() if includeList.selecteditems.count == 0 do includeList.items.item[includeList.items.count-1].selected = true altI.text = includeList.selecteditems.item[0].subitems.item[1].text iColor.color = getcolorNET includeList.selecteditems.item[0].forecolor ) on includeSets mouseUp button shift x y do ( if includeSets.items.count == 0 do return() if includeSets.selecteditems.count == 0 do includeSets.items.item[includeSets.items.count-1].selected = true -- get whichitem is selected whichItem = (includeSets.selecteditems.item[0].index + 1) as string -- then rebuild the includeList: includeList.items.clear() -- get the count of the includelist that is selected: --whichItem = 1 as string -- when opening the first item is always the one: --if includeSet.count > 1 do -- only do if there are include sets defined: local includeItems = #() local includeItemsAlt = #() local includeItemsColor = #() includeItemsCount = (getinisetting whereIniPathsFile ("Include" + whichItem) "count") as integer for i in 1 to includeItemsCount do ( gg = getinisetting whereIniPathsFile ("Include" + whichItem) (i as string) ggC = getinisetting whereIniPathsFile ("IncludeColor" + whichItem) (i as string) ggAN = getinisetting whereIniPathsFile ("IncludeAltName" + whichItem) (i as string) append includeItems gg append includeItemsAlt ggAN append includeItemsColor (execute ggC) ) lis = includeList.items for j in 1 to includeItems.count do ( local li li = lis.Add includeItems [j] if includeItemsColor[j] != OK do li.forecolor = getNETcolor includeItemsColor[j] lis2 = li.subitems local li2 li2 = lis2.Add "" if includeItemsAlt[j] == undefined then li2.text = "" else li2.text = includeItemsAlt[j] --li.tag = shotListLong[i] ) if includeItemsAlt[1] != undefined do altI.text = includeItemsAlt[1] if includeItemsColor.count != 0 AND includeItemsColor[1] != OK do iColor.color = includeItemscolor[1] ) on QOPathManager close do ( local fItems = #() local fItemsNames=#() local fItemsAltNames=#() containerPathCount = (getinisetting whereIniPathsFile "Container" "count") as integer for i in 1 to containerPathCount do ( whichPath = getinisetting whereIniPathsFile "Container" (i as string) whichAltName = getinisetting whereIniPathsFile "ContainerAltName" (i as string) if whichAltName != "" then append fItems whichAltName else append fItems (filterstring whichPath "\/")[(filterstring whichPath "\/").count] ) --print #(fitems) append fItems "---------------------------------------------" includeSetCount = (getinisetting whereIniPathsFile "IncludeSets" "count") as integer for i in 1 to includeSetCount do ( local setName = getinisetting whereIniPathsFile "IncludeSets" (i as string) append fItems setName ) quickNav.ddl1.items = fItems quickNav.projList.items.clear() inval = getinisetting ((getdir #scripts) + "/quickNav.ini") "WhichJob" "val" if inval != "" then ( if inval as integer > quickNav.ddl1.items.count do inval = quickNav.ddl1.items.count quickNav.ddl1.selection = inval as integer quickNav.updateList quickNav.ddl1.selection ) else( quickNav.ddl1.selection = 1 quicknav.updateList 1 ) ) on QOPathManager open do ( whereIniPathsFile =quickNav.whereIniPathsFile -- init the activeX components i = containerList i.backcolor = getNETColor white i.hideselection = false i.ForeColor = getNETColor black i.fullRowSelect = true i.GridLines = true if i == dirContent do i.hideselection = true tview = dotnetclass "System.Windows.Forms.View" i.view = tview.details hName = i.columns.add "Path" hname.width = (435+191) hName = i.columns.add "Alternate Name" hname.width = 165 hName = i.columns.add "Filter" hname.width = 165 i = includeList i.backcolor = getNETColor white i.hideselection = false i.ForeColor = getNETColor black i.fullRowSelect = true i.GridLines = true if i == dirContent do i.hideselection = true tview = dotnetclass "System.Windows.Forms.View" i.view = tview.details hName = i.columns.add "Path" hname.width = 572 hName = i.columns.add "Alternate Name" hname.width = 165 i = includeSets i.backcolor = getNETcolor white i.hideselection = false i.ForeColor = getNETcolor black i.fullRowSelect = true i.GridLines = true if i == dirContent do i.hideselection = true tview = dotnetclass "System.Windows.Forms.View" i.view = tview.details hName = i.columns.add "Set Name" hname.width = 182 -- read current paths from .ini local containerItems = #() local containerItemsAlt = #() local containerItemsColor = #() local containerItemsFilter = #() containerPathCount = (getinisetting whereIniPathsFile "Container" "count") as integer for i in 1 to containerPathCount do ( gg = getinisetting whereIniPathsFile "Container" (i as string) ggC = getinisetting whereIniPathsFile "ContainerColor" (i as string) ggF = getinisetting whereIniPathsFile "ContainerFilter" (i as string) ggAN = getinisetting whereIniPathsFile "ContainerAltName" (i as string) append containerItems gg append containerItemsAlt ggAN append containerItemsColor (execute ggC) append containerItemsFilter ggF ) lis = containerList.items for j in 1 to containerItems.count do ( local li li = lis.Add containerItems[j] if containerItemsColor[j] != OK do li.forecolor = getNETcolor containerItemsColor[j] lis2 = li.subitems local li2 li2 = lis2.Add "" if containerItemsAlt[j] != undefined AND containerItemsAlt[j] != OK then li2.text = containerItemsAlt[j] else li2.text = "" li3 = lis2.Add "" if containerItemsFilter[j] != undefined AND containerItemsFilter[j] != OK then li3.text = containerItemsFilter[j] else li3.text = "" --li.tag = shotListLong[i] ) if containerItemsAlt.count > 0 AND containerItemsAlt[1] != undefined do altC.text = containerItemsAlt[1] if containerItemsColor.count > 0 AND containerItemsColor[1] != OK do cColor.color = containerItemsColor[1] -- include sets local includeSet = #() includeSetsCount = (getinisetting whereIniPathsFile "IncludeSets" "count") as integer for i in 1 to includeSetsCount do ( gg = getinisetting whereIniPathsFile "IncludeSets" (i as string) append includeSet gg ) lis = includeSets.items for j in 1 to includeSet.count do ( local li li = lis.Add includeSet[j] ) -- include items whichItem = 1 as string -- when opening the first item is always the one: --if includeSet.count > 1 do -- only do if there are include sets defined: local includeItems = #() local includeItemsAlt = #() local includeItemsColor = #() includeItemsCount = (getinisetting whereIniPathsFile ("Include" + whichItem) "count") as integer for i in 1 to includeItemsCount do ( gg = getinisetting whereIniPathsFile ("Include" + whichItem) (i as string) ggC = getinisetting whereIniPathsFile ("IncludeColor" + whichItem) (i as string) ggAN = getinisetting whereIniPathsFile ("IncludeAltName" + whichItem) (i as string) append includeItems gg append includeItemsAlt ggAN append includeItemsColor (execute ggC) ) lis = includeList.items for j in 1 to includeItems.count do ( local li li = lis.Add includeItems [j] if includeItemsColor[j] != OK do li.forecolor = getnetcolor includeItemsColor[j] lis2 = li.subitems local li2 li2 = lis2.Add "" if includeItemsAlt[j] == undefined then li2.text = "" else li2.text = includeItemsAlt[j] --li.tag = shotListLong[i] ) if includeItemsAlt[1] != undefined do altI.text = includeItemsAlt[1] if includeItemsColor.count != 0 AND includeItemsColor[1] != OK do iColor.color = includeItemscolor[1] containerList.columns.item[0].text = containerList.columns.item[0].text includelist.columns.item[0].text = includelist.columns.item[0].text includesets.columns.item[0].text = includesets.columns.item[0].text if containerList.items.count > 0 AND containerList.selecteditems.count == 0 do containerList.items.item[0].selected = true if includelist.items.count > 0 AND includelist.selecteditems.count == 0 do includelist.items.item[0].selected = true if includesets.items.count > 0 AND includesets.selecteditems.count == 0 do includesets.items.item[0].selected = true ) ) rcmenu QOmenu ( menuitem mi_Browse "Browse Directory" enabled:true -- menuitem mi_BrowseR "Browse Render Directory" separator s1 menuitem mi_openFrom "Open From... \t(double click)" enabled:true menuitem mi_mergeFrom "Merge From... \t(Ctrl + double click)" enabled:true menuitem mi_saveTo "Save To... \t(Alt + double click)" enabled:true separator s2 menuitem mi_openMXSFrom "Open Maxscript From... \t(Shift + double click)" enabled:true separator s5 menuitem mi_openBitmapFrom "Load Bitmap into Active Bitmaptex From..." enabled:true menuitem mi_viewBitmapFrom "View Image From..." enabled:true separator s6 menuitem mi_saveSelectedTo "Save Selected Objects To..." enabled:true menuitem mi_exportSelectedTo "Export Selected Objects To..." enabled:true menuitem mi_exportAllTo "Export Scene To..." enabled:true menuitem mi_importFrom "Import From..." enabled:true separator s8 menuitem mi_loadXrefFrom "Load Xref Scene From..." enabled:true separator s7 menuitem mi_disableFiltering "Disable Filtering" enabled:true checked:false menuitem mi_disableSorting "Disable Sorting" enabled:true checked:false separator s4 menuitem mi_Manage_Paths "Manage Paths..." enabled:true menuitem mi_repick_PrimaryPaths "Pick Primary Paths .ini file..." enabled:true menuitem mi_repick_SecondaryPaths "Pick Secondary Paths .ini file..." enabled:false separator s3 submenu "Auto Open Behavior" ( menuitem mi_autoOpen "Auto Open when I launch max" menuitem mi_UnautoOpen "Undo Auto Open when I launch max" ) submenu "Dock Behavior" ( menuitem mi_dockLeft "Auto Dock on Open: Left" menuitem mi_dockRight "Auto Dock on Open: Right" menuitem mi_dockNone "Do not autodock" ) submenu "Undocked Behavior" ( menuitem mi_closeOnOpen "Close on successful open" menuitem mi_donotcloseOnOpen "Do not close on successful open" ) on mi_importFrom picked do ( quicknav.dothedirthing "ImportFrom" ) on mi_saveSelectedTo picked do ( quicknav.dothedirthing "SaveSelected" ) on mi_exportSelectedTo picked do ( quicknav.dothedirthing "ExportSelected" ) on mi_exportAllTo picked do ( quicknav.dothedirthing "ExportAll" ) on mi_openBitmapFrom picked do ( quicknav.dothedirthing "LoadBitmap" ) on mi_loadXrefFrom picked do ( quicknav.dothedirthing "LoadXref" ) on mi_viewBitmapFrom picked do ( quicknav.dothedirthing "ViewBitmap" ) on mi_closeOnOpen picked do ( setinisetting ((getdir #scripts) + "/quickNav.ini") "closeOnOpen" "val" "true" ) on mi_donotcloseOnOpen picked do ( setinisetting ((getdir #scripts) + "/quickNav.ini") "closeOnOpen" "val" "false" ) on mi_dockLeft picked do ( setinisetting ((getdir #scripts) + "/quickNav.ini") "isDocked" "val" "cui_dock_left" ) on mi_dockRight picked do ( setinisetting ((getdir #scripts) + "/quickNav.ini") "isDocked" "val" "cui_dock_right" ) on mi_dockNone picked do ( setinisetting ((getdir #scripts) + "/quickNav.ini") "isDocked" "val" "" ) on QOmenu open do ( if quickNav.whichitem == undefined do ( mi_openFrom.enabled = false mi_mergeFrom.enabled = false mi_saveTo.enabled = false mi_Browse.enabled = false mi_openBitmapFrom.enabled = false mi_openMXSFrom.enabled = false mi_viewBitmapFrom.enabled = false mi_exportSelectedTo.enabled = false mi_exportAllTo.enabled = false mi_loadXrefFrom.enabled = false mi_saveSelectedTo.enabled = false mi_importFrom.enabled = false ) if (getinisetting ((getdir #scripts) + "/quickNav.ini") "Paths" "Filtering") == "Disabled" then mi_disableFiltering.checked = true else mi_disableFiltering.checked = false if (getinisetting ((getdir #scripts) + "/quickNav.ini") "Paths" "Filtering") == "" do mi_disableFiltering.checked = true if (getinisetting ((getdir #scripts) + "/quickNav.ini") "Paths" "Sorting") == "Disabled" then mi_disableSorting.checked = true else mi_disableSorting.checked = false if (getinisetting ((getdir #scripts) + "/quickNav.ini") "Paths" "Filtering") == "" do mi_disableSorting.checked = false if (getinisetting ((getdir #scripts) + "/quickNav.ini") "closeOnOpen" "val") == "true" then ( mi_closeOnOpen.checked = true mi_donotcloseOnOpen.checked = false ) else ( mi_closeOnOpen.checked = false mi_donotcloseOnOpen.checked = true ) toDock = getinisetting ((getdir #scripts) + "/quickNav.ini") "isDocked" "val" case toDock of ( -- now should it be docked? "cui_dock_left":( mi_dockLeft.checked = true mi_dockRight.checked = false mi_dockNone.checked = false ) "cui_dock_right":( mi_dockLeft.checked = false mi_dockRight.checked = true mi_dockNone.checked = false ) "":( mi_dockLeft.checked = false mi_dockRight.checked = false mi_dockNone.checked = true ) ) if (getfiles (getdir #scripts + "/startup/QuickNav.ms")).count != 0 then ( mi_autoOpen.checked = true ) else ( mi_autoOpen.checked = false ) ) on mi_disableFiltering picked do ( if mi_disableFiltering.checked == true then ( mi_disableFiltering.checked = false setinisetting ((getdir #scripts) + "/quickNav.ini") "Paths" "Filtering" "Enabled" ) else ( mi_disableFiltering.checked = true setinisetting ((getdir #scripts) + "/quickNav.ini") "Paths" "Filtering" "Disabled" ) val = quicknav.ddl1.selection quicknav.projList.items.clear() if val == quicknav.ddl1.items.count then quicknav.updateList val which:#include else quicknav.updateList val ) on mi_disableSorting picked do ( if mi_disableSorting.checked == true then ( mi_disableSorting.checked = false setinisetting ((getdir #scripts) + "/quickNav.ini") "Paths" "Sorting" "Enabled" ) else ( mi_disableSorting.checked = true setinisetting ((getdir #scripts) + "/quickNav.ini") "Paths" "Sorting" "Disabled" ) val = quicknav.ddl1.selection quicknav.projList.items.clear() if val == quicknav.ddl1.items.count then quicknav.updateList val which:#include else quicknav.updateList val ) on mi_openFrom picked do ( quicknav.dothedirthing "Load" ) on mi_openMXSFrom picked do ( quicknav.dothedirthing "LoadMXS" ) on mi_repick_PrimaryPaths picked do ( local a = getopenfilename caption:"Pick your quickNavPaths.ini file" types:".ini|*.ini" if a != undefined then ( whereIniPathsFile = quicknav.convertpathdividers a quicknav.whereIniPathsFile = whereIniPathsFile setinisetting ((getdir #scripts) + "/quickNav.ini") "Paths" "wherePathsIni" a ) else return() local fItems = #() local fItemsNames=#() containerPathCount = (getinisetting whereIniPathsFile "Container" "count") as integer for i in 1 to containerPathCount do ( whichPath = getinisetting whereIniPathsFile "Container" (i as string) whichAltName = getinisetting whereIniPathsFile "ContainerAltName" (i as string) if whichAltName == "" then append fItems (filterstring whichPath "\/|")[(filterstring whichPath "\/|").count] else append fItems whichAltName ) append fItems "---------------------------------------------" includeSetCount = (getinisetting whereIniPathsFile "IncludeSets" "count") as integer for i in 1 to includeSetCount do ( local setName = getinisetting whereIniPathsFile "IncludeSets" (i as string) --projects = getdirectories (whichPath + "\\*") append fItems setName ) quickNav.ddl1.items = fItems quickNav.projList.items.clear() inval = getinisetting ((getdir #scripts) + "/quickNav.ini") "WhichJob" "val" if inval != "" then ( if inval as integer > quickNav.ddl1.items.count do inval = quickNav.ddl1.items.count quickNav.ddl1.selection = inval as integer if quickNav.ddl1.selection == quickNav.ddl1.items.count then quickNav.updateList quickNav.ddl1.selection which:#include else quickNav.updateList quickNav.ddl1.selection ) else( quickNav.ddl1.selection = 1 quickNav.updateList 1 ) ) on mi_manage_paths picked do ( createdialog QOPathManager modal:true ) on mi_browse picked do shelllaunch "explorer" ("/e, " + (quickNav.convertPathDividersBack (quickNav.pathList[quickNav.whichitem.index + 1]))) on mi_mergeFrom picked do quickNav.doTheDirThing "Merge" on mi_saveTo picked do quickNav.doTheDirThing "Save" on mi_autoOpen picked do ( pather = getdir #scripts + "/startup/QuickNav.ms" f = createfile pather ff = openfile pather mode:"a" format "macros.run \"RPManager\" \"QuickNav\"\n" to:ff close f close ff ) on mi_UnautoOpen picked do ( pather = getdir #scripts + "/startup/QuickNav.ms" deletefile pather ) ) rollout quickNav "QuickNav 1.02" width:72 height:808 ( local whereIniPathsFile fn convertPathDividers inval = ( try( while (findstring inVal "\\" != undefined) do ( inVal = replace inval ( findstring inVal "\\") 1 "/" ) while (findstring inVal "%" != undefined) do ( inVal = replace inval ( findstring inVal "%") 1 "*|" ) return inval ) catch() ) fn convertPathDividersBack inval = ( try( while (findstring inVal "/" != undefined) do ( inVal = replace inval ( findstring inVal "/") 1 "\\" ) while (findstring inVal "*|" != undefined) do ( inVal = replace inval ( findstring inVal "*|") 2 "%" ) return inval ) catch() ) fn g_uppercase instring = -- this one is from the help ( local upper, lower, outstring upper="ABCDEFGHIJKLMNOPQRSTUVWXYZ" lower="abcdefghijklmnopqrstuvwxyz" outstring=copy instring for i=1 to outstring.count do ( j=findString lower outstring[i] if (j != undefined) do outstring[i]=upper[j] ) outstring ) fn sortFn inp1 inp2 valarray: = ( atmp = valarray[inp1] btmp = valarray[inp2] aa = #(atmp , btmp) bb = #(atmp , btmp) sort bb case aa[1] == bb[1] of ( true:-1 false:1 default:0 ) ) -- these arrays should be extracted to a separate file local whichItem local GoutPath = "" local LVM_FIRST = 0x1000, LVM_SETCOLUMNWIDTH = (LVM_FIRST + 30) local pathList local fItemsNames =#() local fItems = #() --ActiveXControl projList "{BDD1F04B-858B-11D1-B16A-00C0F0283628}" pos:[1,17] width:70 height:763 dotNetControl projList "ListView" pos:[1,17] width:70 height:763 --button addCPath "Add Container Path" pos:[14,325] width:145 height:24 dropdownList ddl1 "" pos:[1,780] width:69 height:21 enabled:true items:#("--------------------------------------------------") button clos "close" pos:[2,1] width:68 height:14 on quickNav resized sized do ( --projList.size.x = sized[1] - 5 --projList.size.y = sized[2] - 45 local dnSize = dotNetObject "System.Drawing.Size" (sized[1] - 5 ) (sized[2] - 45) projList.size = dnSize projList.columns.item[0].width = sized[1] - 25 ddl1.pos.y = sized[2] - 28 --if not quicknav.dialogbar do --windows.sendMessage projlist.hwnd LVM_SETCOLUMNWIDTH 0 (sized[1] - 25) ) fn updateList inval which:#container = ( fItemsNames =#() fItems = #() fItemsColor = #() -- find out whether we are asking for a container item or an include item containerPathCount = (getinisetting whereIniPathsFile "Container" "count") as integer if inval == containerpathCount + 1 do return() if inval > containerPathCount then (which = #include; inval = inval - 1 - containerPathCount ) else which = #container case which of ( #container: ( containerPathCount = (getinisetting whereIniPathsFile "Container" "count") as integer whichPath = getinisetting whereIniPathsFile "Container" (inval as string) cfiltervalue = getinisetting whereIniPathsFile "ContainerFilter" (inval as string) altName = getinisetting whereIniPathsFile "ContainerAltName" (inval as string) if whichPath == "" do return() projects = getdirectories (whichPath + "\\*") -- FILTERING fItems = projects fItemsNames = for i in projects collect ((filterstring i "\/")[(filterstring i "\/").count]) if cfiltervalue != "" AND ((getinisetting ((getdir #scripts) + "/quickNav.ini") "Paths" "Filtering") == "Enabled") do ( cfilterArray = filterstring cfiltervalue ", " newfItemsNames = #() newfItems = #() for j in cfilterArray do ( for i in 1 to fItemsNames.count do if (matchpattern fItemsNames[i] pattern:j ignorecase:true) == true do (append newfItemsNames fItemsNames[i] ; append newfItems fItems[i] ) ) fItemsNames = copy newfItemsNames #nomap fItems = copy newfItems #nomap ) -- SORTING if ((getinisetting ((getdir #scripts) + "/quickNav.ini") "Paths" "Sorting") != "Disabled") do ( fitemIndices = for i in 1 to fItemsNames.count collect i fitemnamesLC = for i in fItemsNames collect g_uppercase i qsort fitemIndices sortFn valarray:fitemnamesLC fItemsNamesB = for i in fitemIndices collect fItemsNames[i] fItemsB = for i in fitemIndices collect fItems[i] fItemsNames=fItemsNamesB fItems =fItemsB -- finish qsort ) colorSet = (execute (getinisetting whereIniPathsFile "ContainerColor" (inval as string))) fItemsColor = for i in projects collect colorSet pathList = fItems ) #include: ( invalS = inval as string -- since the list has more than just the include stuff AND the --'s add the amount to the inval includePathCount = (getinisetting whereIniPathsFile ("Include"+ invalS) "count") as integer for i in 1 to includePathCount do ( gg = getinisetting whereIniPathsFile ("Include"+ invalS) (i as string) ggAN = getinisetting whereIniPathsFile ("IncludeAltName"+ invalS) (i as string) if ggAN != "" then ( append fItems gg append fItemsNames ggAN ) else ( append fItems gg append fItemsNames ((filterstring gg "\/")[(filterstring gg "\/").count]) ) append fItemsColor (execute (getinisetting whereIniPathsFile ("IncludeColor"+ invalS) (i as string))) ) pathList = fItems ) ) lis = projList.items mm = 0 for j in fItemsNames do ( mm += 1 local li li = lis.Add j --if fitemscolor[mm] != OK do -- li.forecolor = fitemsColor[mm] li.tooltiptext = fItems[mm] --li.tag = shotListLong[i] ) --close ff if (getinisetting ((getdir #scripts) + "/quickNav.ini") "isDocked" "val" != "") do ( if quicknav.projlist.items.count < 54 then projlist.columns.item[0].width = 68 else projlist.columns.item[0].width = 52 ) ) on quickNav open do ( sized = getdialogsize quicknav local dnSize = dotNetObject "System.Drawing.Size" (sized[1] - 5 ) (sized[2] - 45) projList.size = dnSize ddl1.pos.y = sized[2] - 28 whereIniPathsFile = getinisetting ((getdir #scripts) + "/quickNav.ini") "Paths" "wherePathsIni" -- if not set prompt the user to find the files: if whereIniPathsFile == "" OR (getfiles whereIniPathsFile).count == 0 do ( createdialog whattodo modal:true ---whatToDo = querybox "Paths ini file not found - Create a new one? No to pick an existing a new one." title:"Paths ini file not found" if quickNavWhatToDo == #cancel do ( quickNavWhatToDo == #cancel; return()) if quickNavWhatToDo == true then ( local a = getopenfilename caption:"Pick an existing quickNavPaths.ini file" types:".ini|*.ini" if a != undefined then ( whereIniPathsFile = convertpathdividers a setinisetting ((getdir #scripts) + "/quickNav.ini") "Paths" "wherePathsIni" a ) else ( quickNavWhatToDo == #cancel; return()) ) else ( whereToCreate = getsavefilename caption:"Pick where to save Path ini data file" types:".ini|*.ini" filename:(getdir #scripts + "/quickNavPaths.ini") if whereToCreate == undefined do ( quickNavWhatToDo == #cancel; return()) whereIniPathsFile = convertpathdividers whereToCreate setinisetting ((getdir #scripts) + "/quickNav.ini") "Paths" "wherePathsIni" whereToCreate -- now set some defaults: -- add incoludeset includeSetCount = (getinisetting whereIniPathsFile "IncludeSets" "count") as integer includeSetCount += 1 setinisetting whereIniPathsFile "IncludeSets" "count" "1" setinisetting whereIniPathsFile "IncludeSets" "1" "Include:SampleInclude" -- now add some paths: whichitem = "1" includePathCount = (getinisetting whereIniPathsFile ("Include" + whichItem) "count") as integer setinisetting whereIniPathsFile ("Include" + whichItem) "count" ((includePathCount + 1) as string) setinisetting whereIniPathsFile ("Include" + whichItem) ((includePathCount + 1) as string) (getdir #scene) -- includePathCount = (getinisetting whereIniPathsFile ("Include" + whichItem) "count") as integer setinisetting whereIniPathsFile ("Include" + whichItem) "count" ((includePathCount + 1) as string) setinisetting whereIniPathsFile ("Include" + whichItem) ((includePathCount + 1) as string) (getdir #autoback) -- includePathCount = (getinisetting whereIniPathsFile ("Include" + whichItem) "count") as integer setinisetting whereIniPathsFile ("Include" + whichItem) "count" ((includePathCount + 1) as string) setinisetting whereIniPathsFile ("Include" + whichItem) ((includePathCount + 1) as string) (getdir #scripts) -- add a container path containerPathCount = (getinisetting whereIniPathsFile "Container" "count") as integer setinisetting whereIniPathsFile "Container" "count" ((containerPathCount + 1) as string) local outpath = (getdir #maxroot) if outpath[outpath.count] == "\\" do outpath = substring outpath 1 (outpath.count - 1) setinisetting whereIniPathsFile "Container" ((containerPathCount + 1) as string) outpath setinisetting whereIniPathsFile "ContainerAltName" "1" "MaxRoot:SampleContainer" ) ) fItems = #() fItemsNames=#() containerPathCount = (getinisetting whereIniPathsFile "Container" "count") as integer for i in 1 to containerPathCount do ( whichPath = getinisetting whereIniPathsFile "Container" (i as string) whichAltName = getinisetting whereIniPathsFile "ContainerAltName" (i as string) if whichAltName == "" then append fItems (filterstring whichPath "\/|")[(filterstring whichPath "\/|").count] else append fItems whichAltName ) append fItems "---------------------------------------------" includeSetCount = (getinisetting whereIniPathsFile "IncludeSets" "count") as integer for i in 1 to includeSetCount do ( local setName = getinisetting whereIniPathsFile "IncludeSets" (i as string) append fItems setName ) ddl1.items = fItems i = projList i.backcolor = getNETColor white i.hideselection = false i.ForeColor = getNETColor black i.fullRowSelect = true i.GridLines = true if i == dirContent do i.hideselection = true tview = dotnetclass "System.Windows.Forms.View" i.view = tview.details if i == dirContent do i.hideselection = true --i.BorderStyle = #ccFixedSingle --i.view = #lvwReport --i.appearance = #ccFlat ' i.hideselection = false --lstBox.hidecolumnheaders = true --lstBox.labeledit = #lvwManual -- #lvwAutomatic i.MultiSelect = false --chs = lstBox.columnHeaders hPass = i.columns.Add "Projects" hpass.width = sized[1] - 25 hPass.text = "Projects" --- if not quicknav.dialogbar then -- windows.sendMessage projlist.hwnd LVM_SETCOLUMNWIDTH 0 (sized[1] - 25) inval = getinisetting ((getdir #scripts) + "/quickNav.ini") "WhichJob" "val" if inval != "" then ( ddl1.selection = inval as integer updateList ddl1.selection ) else( ddl1.selection = 1 updateList 1 ) inval = getinisetting ((getdir #scripts) + "/quickNav.ini") "LastOne" "val" try( if inval != "" do projList.items.item[inval as integer - 1].selected = true )catch() ) on ddl1 selected val do ( setinisetting ((getdir #scripts) + "/quickNav.ini") "WhichJob" "val" (val as string) projList.items.clear() updateList val ) fn gethitnode inputdialog inputax x: y: = ( if x == unsupplied do ( local allpos = getdialogpos inputdialog local axpos = 2 * inputax.pos mpos = inputax.mouseposition nx = mpos.x - allpos.x - axpos.x ny = mpos.y - allpos.y - axpos.y + 2 ) if x == unsupplied do ( x = nx y = ny ) --hitnode = input.hitTest (p.x*lineValue) ((p.y - 1)*lineValue ) hitnode = inputax.hitTest x y -- print ("---within:" + (hitnode.item.index + 1) as string + " x:" + x as string + " y:" + y as string); if hitnode.item == undefined do return(undefined)-- hitnode = input.hitTest (p.x*lineValue) ((p.y - 2)*lineValue) --print hitnode.item.text --print hitnode.subitem.text try(x -= inputax.items.item[0].bounds.x)catch() -- for H scrolling: return (hitnode.item) ) fn getbutton event = ( if (event.button.value__) == (event.button.left.value__) then return 1 else if (event.button.value__) == (event.button.middle.value__) then return 4 else if (event.button.value__) == (event.button.right.value__) then return 2 ) fn getShift = ( local outval = 0; if keyboard.shiftpressed AND not keyboard.altpressed AND not keyboard.controlpressed do outval = 1 if not keyboard.shiftpressed AND keyboard.altpressed AND not keyboard.controlpressed do outval = 4 if not keyboard.shiftpressed AND not keyboard.altpressed AND keyboard.controlpressed do outval = 2 if keyboard.shiftpressed AND not keyboard.altpressed AND keyboard.controlpressed do outval = 3 if not keyboard.shiftpressed AND keyboard.altpressed AND keyboard.controlpressed do outval = 6 if keyboard.shiftpressed AND keyboard.altpressed AND keyboard.controlpressed do outval = 7 return outval; ) on projList mouseup event do ( local button = getbutton event; local shift = getShift(); if button == 2 do ( local whichItem = gethitnode quickNav projlist x:event.x y:event.y --try(projlist.items.item[0] = whichItem)catch() quickNav.whichItem = whichItem --if quickNav.whichItem != undefined do popupmenu QOmenu ) ) fn closeQNifRequested = ( local toclose = getinisetting ((getdir #scripts) + "/quickNav.ini") "closeOnOpen" "val" if quicknav.dialogbar then ( isDocked =cui.getdockstate quickNav if isdocked == #cui_floatable do ( case toclose of ( "true":(cui.UnRegisterDialogBar quickNav; destroydialog quickNav) ) ) ) else if toClose == "true" do destroydialog quickNav ) fn doTheDirThing whichMode = ( a = projList.SelectedItems.item[0] --print a.index --print pathlist #nomap --print pathList[a.index] if a == undefined do return() ( ( extrabit = "/" outPath = (pathList[(a.index + 1)]) outpath = convertpathdividers outpath if outpath[outpath.count] != "/" do append outpath "/" case whichMode of ( "Load":( toSave = checkForSave() if toSave == true then ( toOpen = getmaxopenfilename dir:(getfilenamepath outPath) filename:"" if toOpen != undefined do ( loadmaxfile toOpen usefileunits:true setinisetting ((getdir #scripts) + "/quickNav.ini") "LastOne" "val" ((a.index + 1) as string) closeQNifRequested() ) ) ) "LoadMXS":( toOpen = getopenfilename filename:outPath types:".ms, .mcr, .m* (*.m*)|*.m*|.ms|*.ms|.mcr|*.mcr|All|*.*" if toOpen != undefined do ( --max file save edit toOpen setinisetting ((getdir #scripts) + "/quickNav.ini") "LastOne" "val" ((a.index + 1) as string) local toclose = getinisetting ((getdir #scripts) + "/quickNav.ini") "closeOnOpen" "val" closeQNifRequested() ) ) "Merge":( toMerge = getmaxopenfilename dir:(getfilenamepath outPath) filename:"" if toMerge != undefined do ( --max file save mergemaxfile toMerge #prompt #select #promptDups--usefileunits:true ---setinisetting ((getdir #scripts) + "/quickNav.ini") "LastOne" "val" ((a.index + 1) as string) local toclose = getinisetting ((getdir #scripts) + "/quickNav.ini") "closeOnOpen" "val" closeQNifRequested() ) ) "Save":( if maxfilename == "" then append outpath "Untitled" else append outpath maxfilename toSave = getmaxsavefilename filename:outPath if toSave != undefined do ( --max file save savemaxfile toSave FdoesFileExist = getfiles tosave if FDoesFileExist.count == 0 then messagebox "File Save Failed" title:"Failure" else displayTempPrompt "File Save Succeeded" 10000 ---setinisetting ((getdir #scripts) + "/quickNav.ini") "LastOne" "val" ((a.index + 1) as string) closeQNifRequested() ) ) "ImportFrom":( toOpen = getopenfilename filename:outpath if toOpen != undefined do ( importfile toOpen setinisetting ((getdir #scripts) + "/quickNav.ini") "LastOne" "val" ((a.index + 1) as string) closeQNifRequested() ) ) "SaveSelected":( if selection.count == 0 do return(messagebox "Nothing Selected" title:"Save Selected needs a selection") if maxfilename == "" then append outpath "Untitled_Selected" else append outpath(( getfilenamefile maxfilename) + "_Selected.max") toSave = getmaxsavefilename filename:outPath if toSave != undefined do ( savenodes (selection as array) toSave FdoesFileExist = getfiles tosave if FDoesFileExist.count == 0 then messagebox "File Save Failed" title:"Failure" else displayTempPrompt "File Save Succeeded" 10000 closeQNifRequested() ) ) "ExportSelected":( if selection.count == 0 do return(messagebox "Nothing Exported" title:"Export Selected needs a selection") if maxfilename == "" then append outpath "Untitled_Export" else append outpath(( getfilenamefile maxfilename) + "_Selected") --append outpath ".obj" toSave = getsavefilename caption:"Export Selected Objects To:" filename:outPath types:"OBJ|*.obj|FBX|*.fbx|IGS|*.igs|DXF|*.dxf|3DS|*.3ds|DWG|*.dwg|AI|*.ai|STL|*.stl|ASE|*.ase|ATR|*.atr|BLK|*.blk|DF|*.df|LAY|*.lay|VW|*.vw|W3D|*.w3d|WRL|*.wrl|*.*|*.*" if toSave != undefined do ( exportFile toSave selectedOnly:true closeQNifRequested() ) ) "ExportAll":( if maxfilename == "" then append outpath "Untitled_Export" else append outpath(( getfilenamefile maxfilename) + "_Selected") --append outpath ".obj" toSave = getsavefilename caption:"Export Entire Scene To:" filename:outPath types:"OBJ|*.obj|FBX|*.fbx|IGS|*.igs|DXF|*.dxf|3DS|*.3ds|DWG|*.dwg|AI|*.ai|STL|*.stl|ASE|*.ase|ATR|*.atr|BLK|*.blk|DF|*.df|LAY|*.lay|VW|*.vw|W3D|*.w3d|WRL|*.wrl|*.*|*.*" if toSave != undefined do ( exportFile toSave selectedOnly:false closeQNifRequested() ) ) "LoadBitmap": ( activeMat = medit.getcurmtl() if classof activeMat == bitmaptexture then ( bitm = getBitmapOpenFileName caption:"Pick bitmap to load into active bitmaptexture" filename:(getfilenamepath outPath) if bitm != undefined do activeMat.bitmap = openbitmap bitm ) else messagebox "Bitmap Map not active in the Material Editor" title:"Nothing to do" ) "ViewBitmap": ( bitm = getBitmapOpenFileName caption:"Pick bitmap to load into active bitmaptexture" filename:(getfilenamepath outPath) if bitm != undefined do ( display (openbitmap bitm) ) ) "LoadXref": ( toOpen = getmaxopenfilename dir:(getfilenamepath outPath) filename:"" if toOpen != undefined do ( xrefs.addNewXRefFile toOpen setinisetting ((getdir #scripts) + "/quickNav.ini") "LastOne" "val" ((a.index + 1) as string) closeQNifRequested() ) ) ) ) ) ) on projList DoubleClick evt do ( print "dblclick" show evt if keyboard.altpressed do return dothedirthing "Save" if keyboard.controlpressed do return dothedirthing "Merge" if keyboard.shiftpressed do return dothedirthing "LoadMXS" dothedirthing "Load" ) on clos pressed do ( try(cui.UnRegisterDialogBar quickNav)catch() destroydialog quickNav ) on quickNav close do ( setinisetting ((getdir #scripts) + "/quickNav.ini") "posX" "val" ((getdialogpos quickNav)[1] as string) setinisetting ((getdir #scripts) + "/quickNav.ini") "posY" "val" ((getdialogpos quickNav)[2] as string) setinisetting ((getdir #scripts) + "/quickNav.ini") "sX" "val" ((getdialogsize quickNav)[1] as string) setinisetting ((getdir #scripts) + "/quickNav.ini") "sY" "val" ((getdialogsize quickNav)[2] as string) ) ) inval1 = getinisetting ((getdir #scripts) + "/quickNav.ini") "posX" "val" inval2 = getinisetting ((getdir #scripts) + "/quickNav.ini") "posY" "val" inval3 = getinisetting ((getdir #scripts) + "/quickNav.ini") "sX" "val" inval4 = getinisetting ((getdir #scripts) + "/quickNav.ini") "sY" "val" pos = [100,100] siz = [100,808] if inval1 != "" do ( pos = [inval1 as integer,inval2 as integer] ) if inval3 != "" do ( siz = [inval3 as integer,inval4 as integer] ) if siz[1] < 100 do siz[1] = 100 if siz[2] < 100 do siz[2] = 100 quickNavWhatToDo = undefined --createdialog quickNav pos:pos --if quicknav.open == true do -- ( -- cui.RegisterDialogBar quickNav style:#(#cui_dock_left, #cui_dock_right, #cui_floatable, #cui_handles) -- now should it be docked? toDock = getinisetting ((getdir #scripts) + "/quickNav.ini") "isDocked" "val" case toDock of ( -- now should it be docked? default:( createdialog quickNav pos:pos width:120 cui.RegisterDialogBar quickNav style:#(#cui_dock_left, #cui_dock_right, #cui_floatable, #cui_handles) cui.DockDialogBar quickNav (toDock as name) ) "cui_floatable":() "":(createdialog quickNav pos:pos width:siz[1] height:siz[2] style:#(#style_titlebar, #style_border, #style_sysmenu,#style_resizing)) ) -- ) )