/3.1 (Extension.1 Name: "TOC Theme Shuffle Extension" FirstRootClassName: "List" Roots: 2 Roots: 3 Roots: 20 Roots: 21 Roots: 22 Roots: 23 Roots: 24 Roots: 25 Version: 31 About: "This extension installs two buttons in the view menu bar.\nClicking the first button moves an active theme to the top of the table of contents\nClicking the next moves the active theme to the bottom of the table of contents.\nEspecially useful when creating new views or adding themes to a view.\nBrian J. Torreano, 03/1999" InstallScript: 22 UninstallScript: 23 ExtVersion: 1 ) (List.2 ) (List.3 Child: 4 Child: 12 ) (List.4 Child: 5 Child: 9 Child: 11 ) (List.5 Child: 6 Child: 7 Child: 8 ) (AVStr.6 S: "View" ) (AVStr.7 S: "ButtonBar" ) (AVStr.8 S: "Theme.ShuffleToTop" ) (Butn.9 Help: "Shuffle theme to top//Moves the active theme to the top of the table of contents" Icon: 10 Click: "Theme.ShuffleToTop" ) (AVIcon.10 Name: "Promote" Res: "Icons.Promote" ) (Numb.11 N: 25.00000000000000 ) (List.12 Child: 13 Child: 17 Child: 19 ) (List.13 Child: 14 Child: 15 Child: 16 ) (AVStr.14 S: "View" ) (AVStr.15 S: "ButtonBar" ) (AVStr.16 S: "Theme.MoveToBottom" ) (Butn.17 Help: "Move theme to bottom//Moves the active theme to the bottom of the table of contents." Icon: 18 Click: "Theme.MoveToBottom" ) (AVIcon.18 Name: "promodown.bmp" Data: 4e442049 6d616765 00010014 00140000 Data: 00f07777 77777777 77777777 00007777 Data: 77777777 77777777 00007777 77777777 Data: 77707777 00007777 77777777 77000777 Data: 00007770 70707070 70000077 00007777 Data: 77777777 77000777 00007770 70707070 Data: 77000777 00007777 77777777 77000777 Data: 00007770 70707070 77000777 00007777 Data: 77777777 77000777 00007770 00000000 Data: 00000777 00007770 70707070 70000777 Data: 00007770 00000000 00000777 00007777 Data: 77777777 77000777 00007770 00000000 Data: 00000777 00007770 70707070 70000777 Data: 00007770 00000000 00007777 00007777 Data: 77777777 77777777 00007777 77777777 Data: 77777777 00007777 77777777 77777777 Data: 00000000 00400000 00000000 80000080 Data: 00000080 80008000 00008000 80008080 Data: 0000c0c0 c0008080 80000000 ff0000ff Data: 000000ff ff00ff00 0000ff00 ff00ffff Data: 0000ffff ff000002 00040007 00200001 Data: 00020000 00000000 0000 ) (Numb.19 N: 26.00000000000000 ) (List.20 ) (List.21 ) (Script.22 Name: "TOCshuffleInstall" SourceCode: "'DO NOT EDIT!!!\n\nif (av.getproject=nil) then return(nil) end\n\n\ntheDocs = SELF.get(0)\ntheControlList = SELF.get(1)\ntheMenuList = SELF.get(2)\ntheToolMenuList=SELF.Get(3)\ntheProject=Av.getproject\n\n\n'Add the Docs\n'\nfor each adoc in theDocs\n theProject.addDoc(adoc)\nend\n\n'Add the Controls\n'\nfor each totalControl in theControlList\n 'The Control list\n acontrol=totalControl.get(0)\n \n 'The physical control\n theControl = totalControl.get(1)\n \n 'The control Index\n theCindex=totalControl.get(2)\n\n 'Find the DocGUI\n theControlDoc=av.getproject.findGUI(aControl.get(0))\n if (theControlDoc=NIL) then \n MsgBox.Warning(\"The GUI \"+aControl.get(0)+\" cannot be found in the current project.\",\"Script Eror\")\n return(nil)\n end\n \n 'This finds the control set \n thecommand=\"av.getproject.findGUI(\"\"\"+aControl.get(0)+\"\"\").Get\"+acontrol.get(1)\n thescript1=Script.Make(thecommand)\n thecontrolset=thescript1.doit(\"\")\n \n 'Add the control to the control set\n theControlSet.Add(theControl,theCindex )\nend\n\n\n'Add the menus\nfor each totalcontrol in theMenuList\n \n 'The Control list\n acontrol=totalControl.get(0)\n mDoc=acontrol.get(0)\n mMenu=acontrol.get(1)\n mMenuItem=acontrol.get(2)\n\n 'The physical control\n theControl = totalControl.get(1)\n \n 'The control Index\n theCindex=totalControl.get(2)\n\n 'Find the DocGUI\n theControlDoc=av.getproject.findGUI(aControl.get(0))\n if (theControlDoc=NIL) then \n MsgBox.Warning(\"The GUI \"+aControl.get(0)+\" cannot be found in the c urrent project.\",\"Script Eror\")\n return(nil)\n end\n \n theMbar=av.getproject.findGUI(mDoc).GetMenuBar\n themenu=theMbar.findbylabel(mMenu)\n if (themenu=NiL) then\n themenu=menu.make\n themenu.setlabel(mMenu)\n theMbar.add(themenu,999)\n end\n \n themenu.add(thecontrol, theCindex)\nend\n \n \n'Add the Tool Menus\n\nfor each totalControl in theToolMenuList\n 'The Control list\n acontrol=totalControl.get(0)\n \n 'The physical control\n theControl = totalControl.get(1)\n \n 'The con trol Index\n theCindex=totalControl.get(2)\n\n 'Find the DocGUI\n theControlDoc=av.getproject.findGUI(aControl.get(0))\n if (theControlDoc=NIL) then \n MsgBox.Warning(\"The GUI \"+aControl.get(0)+\" cannot be found in the current project.\",\"Script Eror\")\n return(nil)\n end\n \n 'This finds the control set \n thecommand=\"av.getproject.findGUI(\"\"\"+aControl.get(0)+\"\"\").Get\"+acontrol.get(1)\n thescript1=Script.Make(thecommand)\n thecontrolset=av.getproject.findGUI(aControl.get(0)).GetToolBa r\n \n 'Add the control to the control set\n theControlSet.Add(theControl,theCindex)\nend\n\n\nav.getproject.setmodified(true)\n\n\n'And the scripts add themselves\n" ) (Script.23 Name: "TOCshuffleUninstall" SourceCode: "'DO NOT EDIT!!!\n\n'The SELF is the Extension\n\ntheDocs = SELF.get(0)\ntheControlList = SELF.get(1)\ntheMenuList = SELF.get(2)\ntheToolMenuList=SELF.get(3)\ntheProject=Av.getproject\n\n\n'Add the Docs\n'\nfor each adoc in theDocs\n If (theProject.finddoc(adoc.getname)<>NIL) then \n theAnswer=msgbox.yesno(\"Remove the Document \"+adoc.getname+\"?\",\"Remove Document?\",TRUE)\n if (theAnswer=TRUE) then theProject.RemoveDoc(adoc) end\n end\nend\n\n'Removethe Controls\n'\nfor each totalControl in theControlList\n 'Get the control list from the Ext\n acontrol=totalControl.get(0)\n \n 'Get the physical Control\n theControl = totalControl.get(1)\n \n 'Get the Controls Index\n theCindex=totalControl.get(2)\n\n 'Find the DocGUI for the Control\n theControlDoc=av.getproject.findGUI(aControl.get(0))\n if (theControlDoc=NIL) then \n MsgBox.Warning(\"The GUI \"+aControl.get(0)+\" cannot be found in the current project.\",\"Script Eror\")\n return(nil)\n end\n \n 'This sequence finds the appropiate control set\n thecommand= \"av.getproject.findGUI(\"\"\"+aControl.get(0)+\"\"\").Get\"+acontrol.get(1)\n thescript1=Script.Make(thecommand)\n thecontrolset=thescript1.doit(\"\")\n\n 'See if the control is in the set , if so remove it\n if (theControlSet.GetControls.find(theControl)<>NIL) then\n theControlSet.remove(theControl)\n if (thecontrol = \"ToolBar\") then\n theControlSet.selectdefault\n end\n end\nend\n\n\n'Remove the Menus\n'\nfor each totalcontrol in theMenuList\n \n 'The Control list\n acontrol=totalControl.get(0 )\n mDoc=acontrol.get(0)\n mMenu=acontrol.get(1)\n mMenuItem=acontrol.get(2)\n\n 'The physical control\n theControl = totalControl.get(1)\n \n 'The control Index\n theCindex=totalControl.get(2)\n\n 'Find the DocGUI\n theControlDoc=av.getproject.findGUI(aControl.get(0))\n if (theControlDoc=NIL) then \n MsgBox.Warning(\"The GUI \"+aControl.get(0)+\" cannot be found in the current project.\",\"Script Eror\")\n return(nil)\n end\n \n theMbar=av.getproject.findGUI(mDoc).GetMenuBar\n themenu=theMbar.findbylabel(mMenu)\n if (themenu=NiL) then\n MsgBox.Warning(\"The menu named \"+mMenu+\" is not here.\",\"Script Eror\")\n 'return(nil)\n else\n \n thething=themenu.getcontrols.find(thecontrol)\n if (thething<>NIL) then \n themenu.remove(thecontrol) \n end\n 'msgbox.info(themenu.GetControls.count.asstring,\"\")\n if (themenu.GetControls.count<1) then\n theMbar.remove(themenu)\n end\n end\nend\n \nfor each totalControl in theToolMenuList\n 'Get the control list from the Ext\n acontrol=totalControl.get(0)\n \n 'Get the physical Control\n theControl = totalControl.get(1)\n \n 'Get the Controls Index\n theCindex=totalControl.get(2)\n\n 'Find the DocGUI for the Control\n theControlDoc=av.getproject.findGUI(aControl.get(0))\n if (theControlDoc=NIL) then \n MsgBox.Warning(\"The GUI \"+aControl.get(0)+\" cannot be found in the current project.\",\"Script Eror\")\n return(nil)\n end\n \n 'This sequence finds the appropiate control set\n thecontrolset=av.getp roject.findGUI(aControl.get(0)).GetToolBar\n\n \n 'See if the control is in the set , if so remove it\n if (theControlSet.GetControls.find(theControl)<>NIL) then\n \n theControlSet.remove(theControl)\n theControlSet.selectdefault\n end\n\nend\n \n\n'And the scripts delete themselves\n\n\nav.getproject.setmodified(true)\n" ) (Script.24 Name: "Theme.ShuffleToTop" SourceCode: "' @(#) theme_sh.ave 3/17/1999 \n' Name: Theme.ShuffleToTop \n'\n' Headline: Brings the active view theme to the top of the Table of Contents.\n'\n' Self: \n'\n' Returns:\n'\n' Description: Brings the active view theme to the top of the Table of Contents. \n' Associate this script with a button on the menu bar to move themes quickly in \n' the Table of contents. Especially useful when creating new views or adding \n' themes to a view.\n' \n' Topics: Themes\n'\n' Search Keys: Themes, Shuffle, TOC, Table of Contents\n'\n' Requires: An active theme, and a view must be the current document.\n'\n' History:\n' Created as an ArcView 3.1 Avenue script. by Brian J. Torreano - US EPA -FIELDS Div.\n' \n' Brian Torreano\n' 03/1999\n'\n theView = av.GetActiveDoc\n theThemes = theView.GetThemes\n\n'Get the first Active Theme\n firstActive = theView.GetActiveThemes.Get(0)\n\n'Move the Active Theme to the top of the list\n theThemes.Shuffle(firstActive, 0)\n theView.Invalidate\n theView.InvalidateTOC(Nil)\n\n\n" ) (Script.25 Name: "Theme.MoveToBottom" SourceCode: "' @(#) theme_mo.ave 4/02/1999 \n' Name: Theme.MoveToBottom \n'\n' Headline: Moves the active view theme to the bottom of the Table of Contents.\n'\n' Self: \n'\n' Returns:\n'\n' Description: Moves the active view theme to the bottom of the Table of Contents. \n' Associate this script with a button on the menu bar to move themes quickly in \n' the Table of contents. Especially useful when creating new views or adding \n' themes to a view.\n' \n' Topics: Themes\n'\n' Search Keys: Themes, Shuffle, TOC, Table of Contents\n' \n' Requires: An active theme, and a view must be the current document.\n'\n' History:\n' Created as an ArcView 3.1 Avenue script. by Brian J. Torreano - US EPA - FIELDS Div.\n' \n' Brian J. Torrreano - USEPA FIELDS div.-\n' 04/99\n'\n\ntheView = av.GetActiveDoc\ntheThemes = theView.GetThemes\n\n' find the active Theme\nthemeNum = -1\nfor each t in theView.GetThemes\n if ((t.IsActive.Not)) then continue end\n themeNum = theThemes.Find(t)\n theTheme = t\nend\n\n' if active Theme found, take it to the bottom\nif (themeNum >= 0 ) then\n theThemes.Shuffle(theTheme, theThemes.Count)\n theView.Invalidate\n theView.InvalidateTOC(Nil)\nend\n" )