/3.1 (Extension.1 Name: "Show/Hide Selected Extension" FirstRootClassName: "Butn" Roots: 2 Roots: 4 Roots: 6 Roots: 7 Version: 31 About: "Extension for displaying selected records of a theme (v.3a)." InstallScript: 8 UninstallScript: 9 ExtVersion: 1 ) (Butn.2 Help: "Show all records (turns off 'show selected' button)//" Icon: 3 Click: "ShowAll" ) (AVIcon.3 Name: "DiamondBlue" Res: "Icons.DiamondBlue" ) (Butn.4 Help: "Hide Unselected Records//" Icon: 5 Click: "ShowSelected" ) (AVIcon.5 Name: "DiamondRed" Res: "Icons.DiamondRed" ) (Script.6 Name: "ShowAll" SourceCode: " for each aTheme in av.GetActiveDoc.GetActiveThemes\n aTheme.GetFTab.Refresh\n end\n" ) (Script.7 Name: "ShowSelected" SourceCode: "' Name: Theme.HideUnselected\n'\n' Headline: Temporarily hides all but selected features of active\n' Themes\n'\n' Self: \n'\n' Returns:\n'\n' Description: Uses the selection Bitmap of the currently-active\n' Themes to set their definition Bitmaps. In other words, the\n' selected features become the ONLY visible features in the Theme.\n' This effect lasts only until the Theme's FTab is refreshed, so\n' it is not persistent between sessions. One could use the following\n' code as e.g. a \"Theme.Restore\" script:\n' for eac h aTheme in av.GetActiveDoc.GetActiveThemes\n' aTheme.GetFTab.Refresh\n' end\n'\n' Update Script: View.SelectableThemesUpdate (system script)\n'\n' Topics: Theme, Bitmap, View\n'\n' Search Keys: Theme, Bitmap, View\n'\n' Requires:\n'\n' History: Eric Vessey, 10 Mar 96\n'\nfor each aTheme in av.GetActiveDoc.GetActiveThemes\n theFTab = aTheme.GetFTab\n theFTab.SetDefBitmap(theFTab.GetSelection.Clone)\n theFTab.UpdateDefBitmap\n theFTab.GetSelection.ClearAll\nend\n" ) (Script.8 Name: "Show.Install" SourceCode: "' Make sure there is a project\nif (av.GetProject = nil) then\n return nil\nend\n\n' Add button to View GUI\nviewgui = av.getproject.findgui(\"View\")\n\nif (viewgui = nil) then\n MsgBox.Error(\"Cannot find View GUI. Stopping.\",\"Error\")\n return nil\nend\n\nbuttons = viewgui.getbuttonbar\nshowbutton = self.Get(1)\nbuttons.add(showbutton,999)\nhidebutton = self.Get(0)\nbuttons.add(hidebutton,999)\n\n\n\n'In your install script you install the first item twice:\n'buttons = viewgui.getbuttonbar\n'showbutton = self.Get(0)\n'buttons.ad d(showbutton,999)\n'buttons = viewgui.getbuttonbar\n'hidebutton = self.Get(0)\n'buttons.add(hidebutton,999)\n'Change hidebutton = self.Get(0) to hidebutton = self.Get(1)." ) (Script.9 Name: "Show.Uninstall" SourceCode: "' Make sure there is a project\nif (av.GetProject = nil) then\n return nil\nend\n\n' don't bother uninstalling on close\nif (av.GetProject.IsClosing) then\n return nil\nend\n\n' Remove buttons from View GUI\nviewgui = av.getproject.findgui(\"View\")\nif (viewgui = nil) then\n return nil\nend\nviewgui.getbuttonbar.Remove(self.Get(1))\nviewgui.getbuttonbar.Remove(self.Get(0))\n\n'In your uninstall script, you are only removing\n'the first item from your extension. Add the\n'following line to get rid of the second button:\nviewgu i.getbuttonbar.Remove(self.Get(1))\n\n" )