/3.1 (Extension.1 Name: "Table of Contents Defaults Dialog" Dependencies: "$AVBIN/avdlog.dll\n" FirstRootClassName: "AVDLog" Roots: 2 Roots: 38 Roots: 39 Roots: 40 Roots: 41 Version: 31 About: "Contains a dialog for setting the default properties for all view's TOCs" CanUnloadScript: 42 UnloadScript: 43 InstallScript: 44 ExtVersion: 1 ) (AVDLog.2 Name: "TocDefs.Dialog" X: 29 Y: 57 W: 389 H: 290 HelpTopic: "TOC_Defaults" ConstrainedControlNames: 3 ConstrainedControlNames: 4 Constraints: 5 Constraints: 6 Server: 7 ControlPanel: 8 Title: "Table of Contents Style Settings" EscapeEnabled: 1 AlwaysOnTop: 1 HasTitleBar: 1 Closeable: 1 Open: "TocDefs.Open" DefaultButton: 37 ) (AVStr.3 S: "Cancel" ) (AVStr.4 S: "OK" ) (Numb.5 N: 85.00000000000000 ) (Numb.6 N: 85.00000000000000 ) (Nil.7 ) (CPanel.8 Child: 9 Child: 10 Child: 11 Child: 13 Child: 14 Child: 15 Child: 16 Child: 18 Child: 20 Child: 22 Child: 23 Child: 24 ResBox: 25 ResBox: 26 ResBox: 27 ResBox: 28 ResBox: 29 ResBox: 30 ResBox: 31 ResBox: 32 ResBox: 33 ResBox: 34 ResBox: 35 ResBox: 36 Listening: 1 ) (TextLabel.9 InternalName: "aTextLabel3" Constraints: 0x55 Label: "Line flatness:" Listening: 1 ) (TextLabel.10 InternalName: "aTextLabel4" Constraints: 0x55 Label: "Symbol length:" Listening: 1 ) (AVCBBox.11 InternalName: "Flats" Help: "Choose how flat line symbols will be shown as in all view's TOCs" NextControl: 12 ContentKind: 4 Constraints: 0x55 Listening: 1 ) (Nil.12 ) (AVCBBox.13 InternalName: "Lens" Help: "Choose how long pen and fill symbols will be shown in all view's TOCs" NextControl: 12 ContentKind: 4 Constraints: 0x55 Listening: 1 ) (LButn.14 InternalName: "Cancel" Label: "Close" Click: "TocDefs.Close" ) (LButn.15 InternalName: "OK" Label: "Apply" Click: "TocDefs.Close" ) (AVLBox.16 InternalName: "Fonts" Help: "Choose the font to use for all view's TOCs" NextControl: 12 ContentKind: 4 Constraints: 0x55 ColumnCount: 1 Listening: 1 VerticalScroll: 1 Select: "TocDefs.UpdateStyle" SelectionStyle: 17 ) (AVEnum.17 Name: "LISTBOX_SELECTION_SINGLECELL" ) (AVLBox.18 InternalName: "Sizes" Help: "Choose the point size of text to use for all view's TOCs" NextControl: 12 ContentKind: 4 Constraints: 0x55 ColumnCount: 1 Listening: 1 VerticalScroll: 1 SelectionStyle: 19 ) (AVEnum.19 Name: "LISTBOX_SELECTION_SINGLECELL" ) (AVLBox.20 InternalName: "Styles" Help: "Choose the style to apply to the font for all view's TOCs" NextControl: 12 ContentKind: 4 Constraints: 0x55 ColumnCount: 1 Listening: 1 VerticalScroll: 1 SelectionStyle: 21 ) (AVEnum.21 Name: "LISTBOX_SELECTION_SINGLECELL" ) (TextLabel.22 InternalName: "aTextLabel14" Constraints: 0x55 Label: "Style:" Listening: 1 ) (TextLabel.23 InternalName: "aTextLabel15" Constraints: 0x55 Label: "Size (pts):" Listening: 1 ) (TextLabel.24 InternalName: "aTextLabel16" Constraints: 0x55 Label: "Font:" Listening: 1 ) (RectD.25 Left: 15.00000000000000 Top: 49.00000000000000 Right: 142.00000000000000 Bottom: 22.00000000000000 ) (RectD.26 Left: 15.00000000000000 Top: 80.00000000000000 Right: 141.00000000000000 Bottom: 53.00000000000000 ) (RectD.27 Left: 141.00000000000000 Top: 117.00000000000000 Right: 285.00000000000000 Bottom: 21.00000000000000 ) (RectD.28 Left: 142.00000000000000 Top: 149.00000000000000 Right: 286.00000000000000 Bottom: 53.00000000000000 ) (RectD.29 Left: 298.00000000000000 Top: 280.00000000000000 Right: 380.00000000000000 Bottom: 255.00000000000000 ) (RectD.30 Left: 211.00000000000000 Top: 280.00000000000000 Right: 293.00000000000000 Bottom: 255.00000000000000 ) (RectD.31 Left: 15.00000000000000 Top: 244.00000000000000 Right: 164.00000000000000 Bottom: 112.00000000000000 ) (RectD.32 Left: 302.00000000000000 Top: 244.00000000000000 Right: 381.00000000000000 Bottom: 112.00000000000000 ) (RectD.33 Left: 179.00000000000000 Top: 244.00000000000000 Right: 288.00000000000000 Bottom: 112.00000000000000 ) (RectD.34 Left: 179.00000000000000 Top: 115.00000000000000 Right: 275.00000000000000 Bottom: 87.00000000000000 ) (RectD.35 Left: 302.00000000000000 Top: 115.00000000000000 Right: 398.00000000000000 Bottom: 87.00000000000000 ) (RectD.36 Left: 15.00000000000000 Top: 115.00000000000000 Right: 111.00000000000000 Bottom: 87.00000000000000 ) (Nil.37 ) (Script.38 Name: "TocDefs.Close" SourceCode: "ATD = av.FindDialog(\"TocDefs.Dialog\")\n\nif (Self.GetName = \"Cancel\") then\n ATD.Close\nelseif (Self.GetName = \"OK\") then\n theExt = Extension.Find(\"Table of Contents Defaults Dialog\")\n thePrefs = theExt.GetPreferences\n theTocDefs = thePrefs.Get(\"TocDefs\")\n theFlat = ATD.FindByName(\"Flats\").GetSelection\n theLen = ATD.FindByName(\"Lens\").GetSelection\n theFont = ATD.FindByName(\"Fonts\").GetSelection.Get(0)\n theStyle = ATD.FindByName(\"Styles\").GetSelection.Get(0)\n theSize = ATD.FindByName(\"Sizes\").GetSelect ion.Get(0)\n \n theTxtSym = TextSymbol.Make\n theTxtSym.SetColor(Color.GetBlack)\n theTxtSym.SetFont(Font.Make(theFont,theStyle))\n theTxtSym.SetSize(theSize)\n\n if (theTocDefs = nil) then\n thePrefs.Add(\"TocDefs\",{theFlat,theLen,theTxtSym})\n else\n thePrefs.Set(\"TocDefs\",{theFlat,theLen,theTxtSym}) \n end\n \n ff = nil\n if (theFlat = \"Flat\") then\n ff = 100\n elseif (theFlat = \"Moderate zigzag\") then\n ff = 50\n elseif (theFlat = \"Strong zigzag\") then\n ff = 0\n end\n if (ff <> nil) then\n av .GetProject.SetLegendLineFlatness(ff)\n end\n\n ll = nil\n if (theLen = \"Normal\") then\n ll = 1\n elseif (thelen = \"Short\") then\n ll = 0.5\n elseif (thelen = \"Long\") then\n ll = 3\n elseif (thelen = \"Very long\") then\n ll = 5\n end\n if (ll <> nil) then\n av.GetProject.SetTocWidthScale(ll)\n end\n TOC.SetDefaultSymbol(theTxtSym)\n o = false\n for each d in av.GetProject.GetDocs\n if (d.Is(View)) then\n if (d.GetGroupGUI.Contains(\"3d\")) then\n continue\n end\n if (d.GetWin.IsOpe n.Not) then\n d.GetWin.Move(3000,3000)\n d.GetWin.Open\n o = true\n end\n d.GetToc.SetSymbol( theTxtSym)\n if (d.GetWin.isOpen) then\n d.InvalidateTOC(nil)\n end\n if (o) then\n d.GetWin.Close\n d.GetWin.Move(-3000,-3000)\n o = false\n end\n end\n end\n av.GetProject.SetModified(true)\nend\n\n" ) (Script.39 Name: "TocDefs.Open" SourceCode: "ATD = av.FindDialog(\"TocDefs.Dialog\")\n\nFlats = ATD.FindByName(\"Flats\")\nLens = ATD.FindByName(\"Lens\")\nFonts = ATD.FindByName(\"Fonts\")\nStyles = ATD.FindByName(\"Styles\")\nSizes = ATD.FindByName(\"Sizes\")\n\ntheExt = Extension.Find(\"Table of Contents Defaults Dialog\")\nthePrefs = theExt.GetPreferences\ntheTocDefs = thePrefs.Get(\"TocDefs\")\n\nif (theTocDefs = nil) then\n CurTocSym = TOC.GetDefaultSymbol\n curFlat = av.GetProject.GetLegendLineFlatness\n curLen = av.GetProject.GetTocWidthScale\n fs = {\"Strong zigzag\",\"Mod erate zigzag\",\"Flat\"}\n ls = {\"Normal\",\"Short\",\"Long\",\"Very long\"}\n if (not ((curFlat <> 0) or (curFlat <> 100) or (curFlat <> 50))) then\n fs.Insert(\"Custom zigzag\")\n end\n if (not ((curLen <> 0.5) or (curLen <> 1) or (curLen <> 3) or (curLen <> 5))) then\n ls.Insert(\"Custom length\")\n end\nelse\n fs = {\"Strong zigzag\",\"Moderate zigzag\",\"Flat\"}\n ls = {\"Normal\",\"Short\",\"Long\",\"Very long\"}\n CurTocSym = theTocDefs.Get(2)\n curFlat = theTocDefs.Get(0)\n cfidx = fs.FindByValue(curFlat)\n if (cfidx <> -1) then\n fs.Remove(cfidx)\n end\n fs.Insert(curFlat)\n curLen = theTocDefs.Get(1)\n clidx = ls.FindByValue(curLen)\n if (clidx <> -1) then\n ls.Remove(clidx) \n end\n ls.Insert(curLen)\n if (fs.FindByValue(curFlat) = -1) then\n fs.Insert(\"Custom zigzag\")\n end\n if (ls.FindByValue(curLen) = -1) then\n ls.Insert(\"Custom length\")\n end\nend\nFlats.DefineFromList(fs)\nLens.DefineFromList(ls)\n\n\n\ntheFonts = FontManager.The.ReturnFamilies\nFonts.DefineFromList(theFonts)\nCurFont = CurTocSym.GetFont\nCurFam = Cur Font.GetFamily\nCurStyle = CurFont.GetStyle\nCurSize = CurTocSym.GetSize\n\nSelIdx = theFonts.FindByValue(CurFam)\nif (SelIdx = -1) then\n SelIdx = 0\n CurFam = theFonts.Get(0)\nend\n\nFonts.SetSelection(Rect.Make(0@SelIdx,1@1), false)\nFonts.ShowCurrent\n\ntheStyles = FontManager.The.ReturnStyles(CurFam)\nStyles.DefineFromList(theStyles)\n\nStyIdx = theStyles.FindByValue(CurStyle)\nif (StyIdx = -1) then\n StyIdx = 0\nend\n\nStyles.SetSelection(Rect.Make(0@StyIdx,1@1),false)\nStyles.ShowCurrent\n\ntheSizes = {}\nfor each h in 8. .24\n theSizes.Add(h)\nend\nSizes.DefineFromList(theSizes)\n\nSizIdx = theSizes.FindByValue(CurSize)\nif (SizIdx = -1) then\n SizIdx = 2\nend\nSizes.SetSelection(Rect.Make(0@SizIdx,1@1),false)\nSizes.ShowCurrent\n" ) (Script.40 Name: "TocDefs.Show" SourceCode: "ATD = av.FindDialog(\"TocDefs.Dialog\")\n\nATD.Open\n" ) (Script.41 Name: "TocDefs.UpdateStyle" SourceCode: "ATD = av.FindDialog(\"TocDefs.Dialog\")\n\ntheFontName = ATD.FindByName(\"Fonts\").GetSelection.Get(0)\nStyles = ATD.FindByName(\"Styles\")\n\ntheNewStyles = FontManager.The.ReturnStyles(theFontName)\nStyles.DefineFromList(theNewStyles)\n\nNormIdx = 0\nx = 0\nfor each s in theNewStyles\n if (s.Contains(\"orm\")) then\n NormIdx = x\n end\n x = x + 1\nend\n\nStyles.SetSelection(Rect.Make(0@NormIdx,1@1),false)" ) (Script.42 Name: "TocDefs.CanUnload" SourceCode: "return (true)" ) (Script.43 Name: "TocDefs.Unload" SourceCode: "Dialog.DetachFromExtension(self)" ) (Script.44 Name: "TocDefs.Install" SourceCode: "if (av.getproject=nil) then return nil end\n\ntocDefs = Self.GetPreferences.Get(\"TocDefs\")\nif (tocDefs <> nil) then\n theFlat = tocDefs.Get(0)\n theLen = tocDefs.Get(1)\n theTxtSym = tocDefs.Get(2).Clone\n \n ff = nil\n if (theFlat = \"Flat\") then\n ff = 100\n elseif (theFlat = \"Moderate zigzag\") then\n ff = 50\n elseif (theFlat = \"Strong zigzag\") then\n ff = 0\n end\n if (ff <> nil) then\n av.GetProject.SetLegendLineFlatness(ff)\n end\n\n ll = nil\n if (theLen = \"Normal\") then\n ll = 1\n elseif (thel en = \"Short\") then\n ll = 0.5\n elseif (thelen = \"Long\") then\n ll = 3\n elseif (thelen = \"Very long\") then\n ll = 5\n end\n if (ll <> nil) then\n av.GetProject.SetTocWidthScale(ll)\n end\n \n TOC.SetDefaultSymbol(theTxtSym)\n av.GetProject.SetModified(true)\nend\n" )