/3.1 (Extension.1 Name: "Stacked Label Tool" FirstRootClassName: "ToolMenu" Roots: 2 Roots: 11 Roots: 12 Roots: 13 Roots: 14 Roots: 15 Version: 31 About: "Tools for labeling features with more than one field include Stacked Label, Stacked Callout Label, Stacked Bullet Leader Label, and Stacked Banner Label. In the 'Text and Label Defaults...' dialog, click on the Tag, Callout, Bullet Leader, and Banner Tag Tool icons to set default symbols for the corresponding stacked label tools." InstallScript: 16 UninstallScript: 17 ExtVersion: 1 ) (ToolMenu.2 Help: "Stacked Label//Labels features in first active theme with more than one field. (Hold Shift Key to change fields)" Tag: " " Update: "zLabelStacked.ToolUpdate" Icon: 3 Cursor: "Cursors.Tag" Apply: "zLabelStacked.Tool" Child: 4 Child: 5 Child: 7 Child: 9 ) (AVIcon.3 Name: "labstak.bmp" Data: 4e442049 6d616765 00010010 00100000 Data: 00807777 77777777 77777777 77777777 Data: 77777777 77777777 77777777 77777777 Data: 77777777 77777777 77777777 77700000 Data: 00077777 7700ffff ff077777 700ff000 Data: 0f077770 00ffffff ff077700 700ff000 Data: 0f077007 7700ffff ff077077 77700000 Data: 00077077 77777777 77777777 77777777 Data: 77777777 77777777 77777777 77777777 Data: 77770000 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 ) (Tool.4 Help: "Stacked Label//Labels features in first active theme with more than one field. (Hold Shift Key to change fields)" Tag: " " Update: "zLabelStacked.ToolUpdate" Icon: 3 Cursor: "Cursors.Tag" Apply: "zLabelStacked.Tool" ) (Tool.5 Help: "Stacked Callout Label//Click on feature in first active theme and drag to place label. (Hold Shift Key to change fields)" Tag: " " Update: "zLabelStacked.ToolUpdate" Icon: 6 Cursor: "Cursors.Tag" Apply: "zLabelStacked.CalloutTool" ) (AVIcon.6 Name: "labstak1.bmp" Data: 4e442049 6d616765 00010010 00100000 Data: 00807777 77777777 77777777 77777777 Data: 77777777 00777777 77777777 0f077777 Data: 77777777 7ff07777 77777777 70ff0077 Data: 77770000 00ffff00 00000fff ffffffff Data: fff00ff0 00ff0ff0 00f00fff f0ff0ff0 Data: fff00ff0 00ff0ff0 fff00ff0 ffff0ff0 Data: fff00ff0 00f000f0 fff00fff ffffffff Data: fff00000 00000000 00007777 77777777 Data: 77770000 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 ) (Tool.7 Help: "Stacked Bullet Leader Label//Click on feature in first active theme and drag to place label. (Hold Shift Key to change fields)" Tag: " " Update: "zLabelStacked.ToolUpdate" Icon: 8 Cursor: "Cursors.Tag" Apply: "zLabelStacked.BulletLeaderTool" ) (AVIcon.8 Name: "labstak2.bmp" Data: 4e442049 6d616765 00010010 00100000 Data: 00807777 77777777 77777777 77777777 Data: 77777007 77777777 77777007 77777777 Data: 77777770 77777777 77777777 07777777 Data: 77777777 70777777 77777777 77077777 Data: 77777777 77777777 77777000 07770777 Data: 00007777 07770777 07777000 07770777 Data: 07777077 77770777 07777000 07000007 Data: 07777777 77777777 77777777 77777777 Data: 77770000 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 ) (Tool.9 Help: "Stacked Banner Label//Click on feature in first active theme you want to label. (Hold Shift Key to change fields)" Tag: " " Update: "zLabelStacked.ToolUpdate" Icon: 10 Cursor: "Cursors.Tag" Apply: "zLabelStacked.ShadowBoxTool" ) (AVIcon.10 Name: "labstak3.bmp" Data: 4e442049 6d616765 00010010 00100000 Data: 00807777 77777777 77777777 77777777 Data: 77777777 77777777 77777777 77777777 Data: 77777777 77777777 77777777 77777777 Data: 77770000 00000000 00000fff ffffffff Data: fff00ff0 00ff0ff0 00f00fff f0ff0ff0 Data: fff00ff0 00ff0ff0 fff00ff0 ffff0ff0 Data: fff00ff0 00f000f0 fff00fff ffffffff Data: fff00000 00000000 00007777 77777777 Data: 77770000 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 ) (Script.11 Name: "zLabelStacked.BulletLeaderTool" SourceCode: "' Name zLabelStacked.BulletLeaderTool\n' File zLabelStackedBulletLeaderTool.txt\n' Application Stacked Label Tool (zlabstak.avx)\n' Function Labels active theme with stacked bullet leader labels where user clicks\n' Parameters \n' Returns NIL upon error\n' Called by\n' Calls to View.Return Color\n' Requires Active feature theme, \"Graphic.Label Defaults\" dialog\n' Variables\n' History (Symbology setting technique from ESRI's View.BulletLeaderLabelTool script)\n' 1-99 Howie St ernberg, State of Connecticut, DEP \n' Version 3.1\n' Desc An Apply event script for a Tool control in a view DocGUI that\n' adds bullet leader stacked labels to features. Stacked labels annotate features\n' using more than one field value. This script labels the first active theme in the\n' View. The stacked label fields are chosen from a Msgbox and are valid for as long \n' as the theme remains active. To label a theme, make it active, click on a \n' feature, drag a line to where you want the bullet label, and choose the fields\n' to label it with from the Msgbox that opens. Continue labeling other features \n' with the same set of label fields by leaving the theme active and clicking on\n' features and dragging lines to bullet labels with this tool. To label the same active\n' theme with a different set of label fields, hold down the Shift Key while using\n' this tool and choose a new set of fields from the Msgbox that opens. Label a\n' different theme by making it active and then use this tool. Note, thi s script uses\n' the Tool control's Tag property to store the name of the theme and stack label\n' fields. There is no need to set the Tag property in advance or at any time during\n' or after using this script.\n\n' Stacked Bullet Leader Labels are symbolized with same text and graphic symbols used \n' for normal Bullet Leader Labels in ArcView. Modify these symbols in the Graphics>\n' Text and Label Defaults dialog by clicking on the \"Bullet Leader Tag Tool\" icon.\n\n' Apply: zLabelStacked.BulletLeader Tool\n' Tag: zLabelStacked.ToolUpdate\n\n' Get Graphic Text default settings for Bullet Leader Tag Tool (\"Ltool3\" object tag)\n\nCPC = av.FindDialog(\"Graphic.Label Defaults\")\nIconList = CPC.FindByName(\"CalloutIcons\")\nthePrefs = IconList.GetObjectTag.Get(\"Ltool3\")\n\n '(0) Font Family (String) \n '(1) Font Style (String)\n '(2) Font Size (Number)\n '(3) Font Color (String)\n '(4) Fill Color (String)\n '(5) HasOutline (Boolean)\n '(6) OLColor (String)\n '(7) OLWidth (Number)\n '(8) HasDropShadow (Boolean)\n '(9) DSColor (String)\n '(10) UseDefFont (Boolean)\n\nCFont = thePrefs.Get(0)\nCStyle = thePrefs.Get(1)\nif (FontManager.The.ReturnFamilies.FindByValue(CFont) = -1) then\n CFont = av.GetSymbolWin.ReturnCurrentSymbol(#SYMBOL_TEXT).Clone.GetFont.GetFamily\n CStyle = av.GetSymbolWin.ReturnCurrentSymbol(#SYMBOL_TEXT).Clone.GetFont.GetStyle\nend\n\nCSize = thePrefs.Get(2)\nif (thePrefs.Get(3) = \"Unnamed Colo r\") then\n CColor = av.GetSymbolwin.ReturnCurrentSymbol(#SYMBOL_TEXT).Clone.GetColor\nelse \n CColor = av.Run(\"View.Return Color\",thePrefs.Get(3))\nend\nCBGColor = av.Run(\"View.Return Color\",thePrefs.Get(4))\nUseOutline = thePrefs.Get(5)\nCOLColor = av.Run(\"View.Return Color\",thePrefs.Get(6))\nCOLWidth = thePrefs.Get(7)\nUseDef = thePrefs.Get(10)\nif (UseDef) then\n ts = av.GetSymbolWin.ReturnCurrentSymbol(#SYMBOL_TEXT).Clone\n CFont = ts.GetFont.GetFamily\n CStyle = ts.GetFont.GetStyle\n CSize = ts.GetSi ze\n CColor = ts.GetColor\nend\n\ncbox=NIL\ntheDoc = av.GetActiveDoc\n\nif (theDoc.GetGraphics.EditText) then\n return nil\nend\n\nul = theDoc.ReturnUserLine\nif (ul.IsNull) then return nil end\n\npt1 = ul.ReturnStart\npt2 = ul.ReturnEnd\nt = GraphicText.Make(\"\", pt2)\nt.SetDisplay(theDoc.GetDisplay)\ntheDoc.GetDisplay.HookUpSymbol(t.GetSymbol)\ntheDoc.GetGraphics.UnselectAll\nt.SetSelected(TRUE)\n\n' Get parameter from SELF\n\nif (SELF.is(control)) then\n theParameter = SELF.GetTag.AsTokens(\",\")\nelse\n return NIL\nend\n\n' Exit if no active theme\n\ntheView = av.GetActiveDoc\nif ((theView.GetActiveThemes.Count) = 0) then\n return NIL\nend\ntheTheme = theView.GetActiveThemes.Get(0)\nif ((theTheme.IsVisible.Not) or (theTheme.CanLabel.Not)) then\n return NIL\nend\n \n' If the name of the active theme and the theme name stored\n' in the Control's tag property are the same and the Shift\n' Key is not down, then set the flag to not open a MsgBox to \n' select label fields.\n\nselect = TRUE\nif (theParameter.Count > 0 ) then\n theThemeName = theParame ter.Get(0)\n if ((theTheme.GetName = theThemeName) and (System.IsShiftKeyDown.Not)) then\n select = FALSE\n end\nend\n\nif (select) then\n\n ' Exit if no visible fields\n\n theFieldsVisible = List.Make\n for each f in theTheme.GetFtab.GetFields\n if ((f.IsVisible) and (f.IsTypeShape.Not)) then\n theFieldsVisible.Add(f)\n end\n end\n if (theFieldsVisible.IsEmpty) then\n theMsg = \"No visible fields\"\n msgbox.Error(theMsg,theTheme.GetName)\n av.ShowMsg(\"\")\n return NIL\n end\n\n ' Open Msgbox and s elect label fields\n\n theMsg = \"Select label fields\"\n theTitle = \"Label\"++theTheme.GetName\n theFields = Msgbox.MultiListAsString(theFieldsVisible,theMsg,theTitle)\n if (theFields = NIL) then\n SELF.SetTag(\"\")\n return NIL\n end \n\n ' Store theme and label field names as Control Tag property\n \n theParameter = theTheme.GetName\n for each f in theFields\n theParameter = theParameter+\",\"+f.GetName\n end\n SELF.SetTag(theParameter)\n\nelse \n\n ' Get label field names from Control Tag Property\n \n the Fields = list.Make\n for each i in 1..(theParameter.Count - 1)\n if (theTheme.GetFtab.FindField(theParameter.Get(i)) <> NIL) then\n theFields.Add(theTheme.GetFtab.FindField(theParameter.Get(i)))\n end\n if (theFields.IsEmpty) then\n return NIL\n end\n end \n\nend\n\n' Return list of record numbers where user clicks point, loop\n' to each record, return value strings for each label field, and\n' construct a string for label.\n\ntheRecList = theTheme.FindByPoint(pt1)\nif (theRecList.IsEmpty.Not) then \n rcount = 1\n for each rec in theRecList\n fcount = 1\n for each f in theFields\n if ((rcount = 1) and (fcount = 1)) then\n theString = theTheme.ReturnValueString(f.GetName,rec)\n elseif ((rcount > 1) and (fcount = 1)) then\n if (theTheme.ReturnValueString(f.GetName,rec).Count > 0) then\n theString = theString+NL+NL+theTheme.ReturnValueString(f.GetName,rec)\n else\n theString = theString+NL\n end\n else\n if (theTheme.ReturnValueString(f.Get Name,rec).Count > 0) then\n theString = theString+NL+theTheme.ReturnValueString(f.GetName,rec)\n end\n end\n fcount = fcount + 1\n end\n rcount = rcount + 1\n end\nelse\n System.Beep\n return NIL\nend\n\nt.SetText(theString)\nt.GetSymbol.SetFont(Font.Make(CFont,CStyle))\nt.GetSymbol.SetSize(CSize)\nt.GetSymbol.SetColor(CColor)\nt.SetName(\"Callout\")\nt.SetDisplay(theDoc.GetDisplay)\n\nif (t.gettext.count < 1) then return nil end\n\nBulletSymbol = av.GetSymbolWin.GetPalette.GetList(#PALETTE_LIST_ MARKER).Get(0)\nBulletSymbol.Setsize(3)\nBulletSymbol.SetColor(CColor)\ngb = GraphicShape.Make(pt1)\ngb.SetName(\"Callout\")\ngb.SetSymbol(BulletSymbol)\n\nLeaderPen = BasicPen.Make\nLeaderPen.SetColor(CColor)\nif (UseOutline) then\n LeaderPen.SetSize(COLWidth)\nelse\n LeaderPen.SetSize(0.25)\nend\ngl = GraphicShape.Make(ul)\ngl.SetName(\"Callout\")\ngl.SetSymbol(LeaderPen)\n\n\nBgFill = Rasterfill.Make\nBgFill.SetStyle(#RASTERFILL_STYLE_SOLID)\nBgFill.SetColor(CBGColor)\nif (UseOutLine) then\n BgFill.SetOutlined(true)\n BgFill.Se tOLColor(COLColor)\n BgFill.SetOLWidth(COLWidth)\nelse\n BgFill.SetOutLined(false)\nend\n\n'Determine which side of leader to position box\n\nCurrentTextWidth = t.GetBounds.GetWidth\nCurrentTextHeight = t.GetBounds.GetHeight\nCurrentTextOrigin = t.GetBounds.ReturnOrigin\nExpandDist = (CurrentTextHeight)/5\n\nx1 = pt1.GetX\nx2 = pt2.GetX\ny1 = pt1.GetY\ny2 = pt2.GetY\nxDiff = x1 - x2\nyDiff = y1 - y2\n \nif (xDiff.Abs < (yDiff/5).Abs ) then \n '** Means that the line was dragged a distance at least five times \n '** greater i n the y direction. So, center the label directly above \n '** or below pt2\n if (y1 > y2) then 'Below\n TXAdj = -CurrentTextWidth/2 \n TYAdj = -(CurrentTextHeight) \n elseif (y1 < y2) then 'Above\n TXAdj = -CurrentTextWidth/2 \n TYAdj = ExpandDist \n end\nelseif (yDiff.Abs < (xDiff/5).Abs ) then\n '** Means that the line was dragged a distance at least five times \n '** greater in the x direction. So, center the label directly to the \n '** right or left of pt2\n if (x1 > x2) then 'Left\n TXAdj = -(CurrentTextWidth - ExpandDist) \n TYAdj = -CurrentTextHeight/2 \n elseif (x1 < x2) then 'Right\n TXAdj = ExpandDist \n TYAdj = -CurrentTextHeight/2 \n end \nelse\n '** Means that while the line was not in a fairly vertical or \n '** horizontal direction, so there are four potential placements\n if ((x2 > x1) and (y2 > y1)) then 'Cartesian 1\n TXAdj = ExpandDist \n TYAdj = -((CurrentTextHeight/2) - ExpandDist) \n elseif ((x2 < x1) and (y2 > y1)) then 'Cartesia n 2\n TXAdj = -(CurrentTextWidth - ExpandDist) \n TYAdj = -((CurrentTextHeight/2) - ExpandDist) \n elseif ((x2 < x1) and (y2 < y1)) then 'Cartesian 3\n TXAdj = -(CurrentTextWidth - ExpandDist) \n TYAdj = -(CurrentTextHeight/2) \n elseif ((x2 > x1) and (y2 < y1)) then 'Cartesian 4\n TXAdj = ExpandDist \n TYAdj = -(CurrentTextHeight/2) \n end \nend \n\n\nNewTextOrigin = CurrentTextOrigin + (TXAdj@TYAdj)\n\n\nt.GetBounds.SetOrigin(NewTextOrigin) \n\n\nif (UseOutline) then\n BgRect = t.GetBounds.Clone.ExpandBy(t.GetBounds.GetWidth * 0.1)\n tbg = GraphicShape.Make(BgRect)\n tbg.SetName(\"Callout\")\n tbg.SetSymbol(BgFill)\n theDoc.GetGraphics.Add(tbg)\n tbg.SetSelected(false)\nend\ntheDoc.GetGraphics.Add(gb)\ntheDoc.GetGraphics.Add(gl)\ntheDoc.GetGraphics.Add(t)\n\ngb.SetSelected(false)\ngl.SetSelected(false) \nt.SetSelected(true)\ntheDoc.GetGraphics.MoveSelectedToFront\nt.SetSelected(false)\ngl.SetSelected(true)\ntheDoc.GetGraphics.MoveSelectedToBack\nt.SetSelecte d(true)\ngb.SetSelected(true)\nif (UseOutline) then\n tbg.SetSelected(true)\nend\ntheDoc.GetGraphics.GroupSelected\ntheDoc.GetGraphics.GetSelected.Get(0).SetName(\"Callout\")\nif(theDoc.Is(View)) then\n if (theDoc.GetActiveThemes.Count > 0) then\n theDoc.GetActiveThemes.Get(0).GetGraphics.Add(theDoc.getGraphics.GetSelected.Get(0))\n end\nend\ntheDoc.GetGraphics.GetSelected.Get(0).Invalidate\ntheDoc.GetGraphics.MoveSelectedToFront\ntheDoc.GetGraphics.GetSelected.Get(0).SetUniformScaling(true)\ntheDoc.GetGraphics.Unsele ctAll\n\n" ) (Script.12 Name: "zLabelStacked.CalloutTool" SourceCode: "' Name zLabelStacked.CalloutTool\n' File zLabelStackedCalloutTool.txt\n' Application Stacked Label Tool (zlabstak.avx)\n' Function Labels active theme with stacked callout labels where user clicks\n' Parameters \n' Returns NIL upon error\n' Called by\n' Calls to View.Return Color\n' Requires Active feature theme, \"Graphic.Label Defaults\" dialog\n' Variables\n' History (Symbology setting technique from ESRI's View.CalloutLabelTool script)\n' 1-99 Howie Sternberg, State of Con necticut, DEP \n' Version 3.1\n' Desc An Apply event script for a Tool control in a view DocGUI that\n' adds callout stacked labels to features. Callout stacked labels annotate features\n' with more than one field value. This script labels the first active theme in the\n' View. The stacked label fields are chosen from a Msgbox and are valid for as long \n' as the theme remains active. To label a theme, make it active, click on a \n' feature, drag a line to where you want the callout label, and choose the fields\n' to label it with from the Msgbox that opens. Continue labeling other features \n' with the same set of stacked label fields by leaving the theme active and clicking\n' on features and dragging lines to callouts with this tool. To label the same active\n' theme with a different set of label fields, hold down the Shift Key while using\n' this tool and choose a new set of fields from the Msgbox that opens. Label a\n' different theme by making it active and then use this tool. Note, this script uses\n' the Tool control's Tag property to store the name of the theme and stack label\n' fields. There is no need to set the Tag property in advance or at any time during\n' or after using this script.\n\n' Stacked Callout Labels are symbolized with same text and graphic symbols used \n' for normal Callout Labels in ArcView. Modify these symbols in the Graphics>Text\n' and Label Defaults dialog by clicking on the \"Callout Tag Tool\" icon.\n\n' Apply: zLabelStacked.CalloutTool\n' Tag: zLabelStacked .ToolUpdate\n\n' Get Graphic Text default settings for Callout Tag Tool (\"Ltool2\" object tag)\n\nCPC = av.FindDialog(\"Graphic.Label Defaults\")\nIconList = CPC.FindByName(\"CalloutIcons\")\nthePrefs = IconList.GetObjectTag.Get(\"Ltool2\")\n\n '(0) Font Family (String) \n '(1) Font Style (String)\n '(2) Font Size (Number)\n '(3) Font Color (String)\n '(4) Fill Color (String)\n '(5) HasOutline (Boolean)\n '(6) OLColor (String)\n '(7) OLWidth (Number)\n '(8) HasDropShadow (Boolean)\n '(9) DSColor (String)\n '(10) UseDefFont (Boolean)\n\nCFont = thePrefs.Get(0)\nCStyle = thePrefs.Get(1)\nif (FontManager.The.ReturnFamilies.FindByValue(CFont) = -1) then\n CFont = av.GetSymbolWin.ReturnCurrentSymbol(#SYMBOL_TEXT).Clone.GetFont.GetFamily\n CStyle = av.GetSymbolWin.ReturnCurrentSymbol(#SYMBOL_TEXT).Clone.GetFont.GetStyle\nend\n\nCSize = thePrefs.Get(2)\nif (thePrefs.Get(3) = \"Unnamed Color\") then\n CColor = av.GetSymbolwin.ReturnCur rentSymbol(#SYMBOL_TEXT).Clone.GetColor\nelse \n CColor = av.Run(\"View.Return Color\",thePrefs.Get(3))\nend\nCBGColor = av.Run(\"View.Return Color\",thePrefs.Get(4))\nUseOutline = thePrefs.Get(5)\nCOLColor = av.Run(\"View.Return Color\",thePrefs.Get(6))\nCOLWidth = thePrefs.Get(7)\nCDS = thePrefs.Get(8)\nDSColor = av.Run(\"View.Return Color\",thePrefs.Get(9))\nUseDef = thePrefs.Get(10)\nif (UseDef) then\n ts = av.GetSymbolWin.ReturnCurrentSymbol(#SYMBOL_TEXT).Clone\n CFont = ts.GetFont.GetFamily\n CStyle = ts.GetFont.GetStyle\n CSize = ts.GetSize\n CColor = ts.GetColor\nend\n\ncbox=NIL\ntheView = av.GetActiveDoc\n\nif (theView.GetGraphics.EditText) then\n return nil\nend\n\nul = theView.ReturnUserLine\nif (ul.IsNull) then return nil end\n\npt1 = ul.ReturnStart\npt2 = ul.ReturnEnd\nt = GraphicText.Make(\"\", pt2)\nt.SetDisplay(theView.GetDisplay)\ntheView.GetDisplay.HookUpSymbol(t.GetSymbol)\ntheView.GetGraphics.UnselectAll\nt.SetSelected(TRUE)\n\n' Get parameter from SELF\n\nif (SELF.is(control)) then\n theParameter = SELF.GetTag .AsTokens(\",\")\nelse\n return NIL\nend\n\n' Exit if no active theme\n\ntheView = av.GetActiveDoc\nif ((theView.GetActiveThemes.Count) = 0) then\n return NIL\nend\ntheTheme = theView.GetActiveThemes.Get(0)\nif ((theTheme.IsVisible.Not) or (theTheme.CanLabel.Not)) then\n return NIL\nend\n \n' If the name of the active theme and the theme name stored\n' in the Control's tag property are the same and the Shift\n' Key is not down, then set the flag to not open a MsgBox to \n' select label fields.\n\nselect = TRUE\nif (theParame ter.Count > 0 ) then\n theThemeName = theParameter.Get(0)\n if ((theTheme.GetName = theThemeName) and (System.IsShiftKeyDown.Not)) then\n select = FALSE\n end\nend\n\nif (select) then\n\n ' Exit if no visible fields\n\n theFieldsVisible = List.Make\n for each f in theTheme.GetFtab.GetFields\n if ((f.IsVisible) and (f.IsTypeShape.Not)) then\n theFieldsVisible.Add(f)\n end\n end\n if (theFieldsVisible.IsEmpty) then\n theMsg = \"No visible fields\"\n msgbox.Error(theMsg,theTheme.GetName)\n av.ShowMsg( \"\")\n return NIL\n end\n\n ' Open Msgbox and select label fields\n\n theMsg = \"Select label fields\"\n theTitle = \"Label\"++theTheme.GetName\n theFields = Msgbox.MultiListAsString(theFieldsVisible,theMsg,theTitle)\n if (theFields = NIL) then\n SELF.SetTag(\"\")\n return NIL\n end \n\n ' Store theme and label field names as Control Tag property\n \n theParameter = theTheme.GetName\n for each f in theFields\n theParameter = theParameter+\",\"+f.GetName\n end\n SELF.SetTag(theParameter)\n\nelse \n\n ' Get label field names from Control Tag Property\n \n theFields = list.Make\n for each i in 1..(theParameter.Count - 1)\n if (theTheme.GetFtab.FindField(theParameter.Get(i)) <> NIL) then\n theFields.Add(theTheme.GetFtab.FindField(theParameter.Get(i)))\n end\n if (theFields.IsEmpty) then\n return NIL\n end\n end \n\nend\n\n' Return list of record numbers where user clicks point, loop\n' to each record, return value strings for each label field, and\n' construct a string for the stacked callout label.\n\ntheR ecList = theTheme.FindByPoint(pt1)\nif (theRecList.IsEmpty.Not) then \n rcount = 1\n for each rec in theRecList\n fcount = 1\n for each f in theFields\n if ((rcount = 1) and (fcount = 1)) then\n theString = theTheme.ReturnValueString(f.GetName,rec)\n elseif ((rcount > 1) and (fcount = 1)) then\n if (theTheme.ReturnValueString(f.GetName,rec).Count > 0) then\n theString = theString+NL+NL+theTheme.ReturnValueString(f.GetName,rec)\n else\n theString = theString+NL\n end\n else\n if (theTheme.ReturnValueString(f.GetName,rec).Count > 0) then\n theString = theString+NL+theTheme.ReturnValueString(f.GetName,rec)\n end\n end\n fcount = fcount + 1\n end\n rcount = rcount + 1\n end\nelse\n System.Beep\n return NIL\nend\n\nt.SetText(theString)\nif (t.gettext.count < 1) then return nil end \nt.GetSymbol.SetFont(Font.Make(CFont,CStyle))\nt.GetSymbol.SetSize(CSize)\nt.GetSymbol.SetColor(CColor)\nt.SetName(\"Callout\") \ntheView.GetGraphics.Add(t )\n \nif ((pt1.GetX <= pt2.GetX) and (pt1.GetY <= pt2.GetY)) then \n bb = t.GetBounds.Clone.ExpandBy(t.GetBounds.GetHeight * 0.1)\n bo_x = bb.ReturnOrigin.GetX\n bo_y = bb.ReturnOrigin.GetY\n bw = ((bb.GetWidth) * 1.08)\n bh = ((bb.GetHeight) * 1.1)\n boxoriginx = bo_x - (bw / 10)\n boxoriginy = bo_y - (bh / 5) \n ur = ((boxoriginx + bw)@(boxoriginy + bh))\n lr = ((boxoriginx + bw)@boxoriginy)\n ul = (boxoriginx@(boxoriginy + bh))\n o = (boxoriginx@boxoriginy)\n if ((pt1.GetY >= (pt2.GetY - bh)) and (pt1.GetY <= (pt2.GetY + bh))) then\n llo = (boxoriginx@(boxoriginy + (bh*0.31)))\n rlo = (boxoriginx@(boxoriginy + (bh/2)))\n cbox = Polygon.Make({{(pt1),(llo),(o),(lr),(ur),(ul),(rlo)}})\n else\n llo = ((boxoriginx + (bw/6))@boxoriginy)\n rlo = ((boxoriginx + ((bw/6)*2))@(boxoriginy))\n cbox = Polygon.Make({{(pt1),(llo),(o),(ul),(ur),(lr),(rlo)}})\n end\n BgRect = Rect.MakeXY(boxoriginx,boxoriginy,(boxoriginx + bw),(boxoriginy + bh))\nelseif ((pt1.GetX >= pt2.GetX) and (pt1.GetY <= pt2.GetY)) then \n nt x = t.GetBounds.GetWidth * 1.1\n t.SetOrigin(((t.GetOrigin.GetX - ntx)@t.GetOrigin.GetY))\n bb = t.GetBounds.Clone.ExpandBy(t.GetBounds.GetHeight * 0.1)\n bo_x = bb.ReturnOrigin.GetX\n bo_y = bb.ReturnOrigin.GetY\n bw = ((bb.GetWidth) * 1.05)\n bh = ((bb.GetHeight) * 1.1)\n boxoriginx = bo_x - (bw / 10)\n boxoriginy = bo_y - (bh / 5)\n o = (boxoriginx@boxoriginy)\n ul = (boxoriginx@(boxoriginy + bh))\n ur = ((boxoriginx + bw)@(boxoriginy + bh))\n lr = ((boxoriginx + bw)@boxoriginy)\n if ((pt1.GetY >= (pt2.G etY - bh)) and (pt1.GetY <= (pt2.GetY + bh))) then\n llo = ((boxoriginx + bw)@(boxoriginy + (bh*0.31)))\n rlo = ((boxoriginx + bw)@(boxoriginy + (bh/2)))\n cbox = Polygon.Make({{(pt1),(llo),(lr),(o),(ul),(ur),(rlo)}})\n else\n llo = ((boxoriginx + ((bw/6)*5))@boxoriginy)\n rlo = ((boxoriginx + ((bw/6)*4))@(boxoriginy))\n cbox = Polygon.Make({{(pt1),(llo),(lr),(ur),(ul),(o),(rlo)}}) \n end\n BgRect = Rect.MakeXY(boxoriginx,boxoriginy,(boxoriginx + bw),(boxoriginy + bh))\nelseif ((pt1.GetX <= pt2.GetX) and (pt1.GetY > pt2.GetY)) then\n ntx = t.GetBounds.GetHeight * 1.1\n t.SetOrigin((t.GetOrigin.GetX@(t.GetOrigin.GetY - ntx)))\n bb = t.GetBounds.Clone.ExpandBy(t.GetBounds.GetHeight * 0.1)\n bo_x = bb.ReturnOrigin.GetX\n bo_y = bb.ReturnOrigin.GetY\n bw = ((bb.GetWidth) * 1.05)\n bh = ((bb.GetHeight) * 1.1)\n boxoriginx = bo_x - (bw / 10)\n boxoriginy = bo_y - (bh / 5)\n o = ((boxoriginx )@(boxoriginy))\n ul = ((boxoriginx)@(boxoriginy+bh))\n ur = ((boxoriginx + bw)@(boxoriginy + bh))\n if ((pt1. GetY >= (pt2.GetY - bh)) and (pt1.GetY <= (pt2.GetY + bh))) then\n ull = ((boxoriginx)@(boxoriginy + (bh*0.31)))\n lr = ((boxoriginx + bw)@(boxoriginy))\n rlo = ((boxoriginx)@(boxoriginy + (bh/2)))\n cbox = Polygon.Make({{(pt1),(ull),(o),(lr),(ur),(ul),(rlo)}})\n else\n ull = ((boxoriginx + (bw/12))@(boxoriginy+bh))\n ll = ((boxoriginx + bw)@boxoriginy)\n rlo = ((boxoriginx + ((bw/12)*2))@(boxoriginy + bh))\n cbox = Polygon.Make({{(pt1),(ull),(ul),(o),(ll),(ur),(rlo)}})\n end\n BgRect = Rect .MakeXY(boxoriginx,boxoriginy,(boxoriginx + bw),(boxoriginy + bh))\nelseif ((pt1.GetX > pt2.GetX) and (pt1.GetY > pt2.GetY)) then\n ntx = t.GetBounds.GetWidth * 1.1\n t.SetOrigin(((t.GetOrigin.GetX - ntx)@t.GetOrigin.GetY))\n bb = t.GetBounds.Clone.ExpandBy(t.GetBounds.GetHeight * 0.1)\n bo_x = bb.ReturnOrigin.GetX\n bo_y = bb.ReturnOrigin.GetY\n bw = ((bb.GetWidth) * 1.05)\n bh = ((bb.GetHeight) * 1.1)\n boxoriginx = bo_x - (bw / 10)\n boxoriginy = bo_y - (bh / 5)\n if ((pt1.GetY >= (pt2.GetY - bh)) and (pt 1.GetY <= (pt2.GetY + bh))) then\n o = ((boxoriginx)@(boxoriginy))\n llo = ((boxoriginx + bw)@(boxoriginy + (bh*0.31)))\n ul = ((boxoriginx)@(boxoriginy + bh))\n ur = ((boxoriginx + bw)@(boxoriginy + bh))\n lr = ((boxoriginx + bw)@(boxoriginy))\n rlo = ((boxoriginx + bw)@(boxoriginy + (bh/2)))\n cbox = Polygon.Make({{(pt1),(llo),(lr),(o),(ul),(ur),(rlo)}})\n else\n o = ((boxoriginx + bw)@(boxoriginy + bh))\n llo = ((boxoriginx + ((bw/12)*10))@(boxoriginy + bh))\n ul = ((boxoriginx + bw)@ (boxoriginy))\n ur = ((boxoriginx)@(boxoriginy))\n lr = ((boxoriginx)@(boxoriginy + bh))\n rlo = ((boxoriginx + ((bw/12)*11))@(boxoriginy + bh))\n cbox = Polygon.Make({{(pt1),(llo),(lr),(ur),(ul),(o),(rlo)}})\n end\n BgRect = Rect.MakeXY(boxoriginx,boxoriginy,(boxoriginx + bw),(boxoriginy + bh))\nend\n\nNumLines = t.GetText.AsTokens(nl).Count\nif (NumLines > 1) then\n NumLines = 2\nend\nBgRect = t.GetBounds.Clone.ExpandBy(t.GetBounds.GetHeight * 0.1) \nCurrentWidth = BgRect.GetWidth \nCurrentHeight = BgRect.GetHeight\nBgO = BgRect.ReturnOrigin\nadjustment = ((CurrentWidth*(-(0.05)))@( (CurrentHeight*(-(0.05*((NumLines*NumLines)*0.9))))/(2)))\nt.GetBounds.SetOrigin(BgO + adjustment)\n\n'do foreground box color\n\ncboxgs = GraphicShape.Make(cbox)\nfs = RasterFill.Make\nfs.SetStyle(#RASTERFILL_STYLE_SOLID)\nfs.SetColor(CBGColor)\nif (UseOutline) then\n fs.SetOLColor(COLColor)\n fs.SetOLWidth(COLWidth)\nelse\n fs.SetOutlined(false)\nend\ncboxgs.SetSymbol(fs)\n\n'Do Background box color\n\nif (CDS) then\n ShdAdj = t.GetBounds .GetHeight/5\n sPts = cbox.AsList\n nPts = {}\n for each p in sPts.Get(0)\n if ((p.GetX = pt1.GetX) and (p.GetY = pt1.GetY)) then\n nPts.Add(p.Clone)\n else\n np = p + (ShdAdj@(-ShdAdj))\n nPts.Add(np)\n end\n end \n sbox = Polygon.Make({nPts})\n bs = RasterFill.Make\n changebox=Graphicshape.make(sbox)\n bs.SetStyle(#RASTERFILL_STYLE_OPAQUESTIPPLE)\n bgbg = color.Make\n bgbg.SetTransparent(true)\n bs.SetColor(bgbg)\n bs.SetBGColor(DSColor)\n bs.SetOutLined(FALSE)\n changebox.setsymbol(bs) \n theView.GetGraphics.Add(changebox)\n changebox.SetName(\"Callout\")\nend\n\ntheView.GetGraphics.Add(cboxgs)\ncboxgs.SetName(\"Callout\")\ncboxgs.SetSelected(false)\nt.SetSelected(true)\ntheView.GetGraphics.MoveSelectedToFront\n\n\nif (CDS) then\n changebox.setselected(true)\nend\n\ncboxgs.SetSelected(true)\ntheView.GetGraphics.GroupSelected\ntheView.GetGraphics.GetSelected.Get(0).SetName(\"Callout\")\nif(theView.Is(View)) then\n if (theView.GetActiveThemes.Count > 0) then\n theView.GetActiveThemes.Get(0).GetGraphics.Add(t heView.getGraphics.GetSelected.Get(0))\n end\nend\n\ntheView.GetGraphics.MoveSelectedToFront\ntheView.GetGraphics.GetSelected.Get(0).SetUniformScaling(true)\ntheView.GetGraphics.GetSelected.Get(0).Invalidate\ntheView.GetGraphics.UnselectAll" ) (Script.13 Name: "zLabelStacked.ShadowBoxTool" SourceCode: "' Name zLabelStacked.ShadowBoxTool\n' File zLabelStackedShadowBoxTool.txt\n' Application Stacked Label Tool (zlabstak.avx)\n' Function Labels active theme with stacked shadow box labels where user clicks\n' Parameters \n' Returns NIL upon error\n' Called by\n' Calls to View.Return Color\n' Requires Active feature theme, \"Graphic.Label Defaults\" dialog\n' Variables\n' History (Symbology setting technique from ESRI's View.ShadowBoxLabelTool script)\n' 1-99 Howie Sternberg, Sta te of Connecticut, DEP \n' Version 3.1\n' Desc An Apply event script for a Tool control in a view DocGUI that\n' adds shadow box stacked labels to features. Stacked labels annotate features\n' with more than one field value. This script labels the first active theme in the\n' View. The stacked label fields are chosen from a Msgbox and are valid for as long \n' as the theme remains active. To label a theme, make it active, click on a \n' feature, and choose the fields to label it with from the Msgbox t hat opens. Continue\n' labeling other features with the same set of label fields by leaving the theme active\n' and clicking them. To label the same active theme with a different set of label\n' fields, hold down the Shift Key while using this tool and choose a new set of fields\n' from the Msgbox that opens. Label a different theme by making it active and then\n' use this tool. Note, this script uses the Tool control's Tag property to store \n' the name of the theme and stack label fields. There is no need to set the Tag \n' property in advance or at any time during or after using this script.\n\n' Stacked ShadowBox Labels are symbolized with the same text and graphic symbols \n' used for normal ShadowBox Labels in ArcView. Modify these symbols in the \n' Graphics>Text and Label Defaults dialog by clicking on the \"Banner Tag Tool\" icon.\n\n' Apply: zLabelStacked.ShadowBoxTool\n' Tag: zLabelStacked.ToolUpdate\n\n' Get Graphic Text default settings for Banner Tag Tool (\"Ltool4\" object tag)\n\nCPC = av.FindDialog(\"Graphic.Label Defaults\")\nIconList = CPC.FindByName(\"CalloutIcons\")\nthePrefs = IconList.GetObjectTag.Get(\"Ltool4\")\n\n '(0) Font Family (String) \n '(1) Font Style (String)\n '(2) Font Size (Number)\n '(3) Font Color (String)\n '(4) Fill Color (String)\n '(5) HasOutline (Boolean)\n '(6) OLColor (String)\n '(7) OLWidth (Number)\n '(8) HasDropShadow (Boolean)\n '(9) DSColor (String)\n '(10) UseDefFont (Bo olean)\n\nCFont = thePrefs.Get(0)\nCStyle = thePrefs.Get(1)\nif (FontManager.The.ReturnFamilies.FindByValue(CFont) = -1) then\n CFont = av.GetSymbolWin.ReturnCurrentSymbol(#SYMBOL_TEXT).Clone.GetFont.GetFamily\n CStyle = av.GetSymbolWin.ReturnCurrentSymbol(#SYMBOL_TEXT).Clone.GetFont.GetStyle\nend\n\n\nCSize = thePrefs.Get(2)\nif (thePrefs.Get(3) = \"Unnamed Color\") then\n CColor = av.GetSymbolwin.ReturnCurrentSymbol(#SYMBOL_TEXT).Clone.GetColor\nelse \n CColor = av.Run(\"View.Return Color\",thePrefs.Get(3 ))\nend\nCBGColor = av.Run(\"View.Return Color\",thePrefs.Get(4))\nUseOutline = thePrefs.Get(5)\nCOLColor = av.Run(\"View.Return Color\",thePrefs.Get(6))\nCOLWidth = thePrefs.Get(7)\nCDS = thePrefs.Get(8)\nDSColor = av.Run(\"View.Return Color\",thePrefs.Get(9))\nUseDef = thePrefs.Get(10)\nif (UseDef) then\n ts = av.GetSymbolWin.ReturnCurrentSymbol(#SYMBOL_TEXT).Clone\n CFont = ts.GetFont.GetFamily\n CStyle = ts.GetFont.GetStyle\n CSize = ts.GetSize\n CColor = ts.GetColor\nend\n\n\n\ncbox=NIL\ntheDoc = av.Get ActiveDoc\nif(theDoc.GetGraphics.EditText) then\n return nil\nend\npt = theDoc.GetDisplay.ReturnUserPoint\nt = GraphicText.Make(\"\", pt)\nt.SetDisplay(theDoc.GetDisplay)\ntheDoc.GetDisplay.HookUpSymbol(t.GetSymbol)\ntheDoc.GetGraphics.UnselectAll\nt.SetSelected(TRUE)\n\n' Get parameter from SELF\n\nif (SELF.is(control)) then\n theParameter = SELF.GetTag.AsTokens(\",\")\nelse\n return NIL\nend\n\n' Exit if no active theme\n\ntheView = av.GetActiveDoc\nif ((theView.GetActiveThemes.Count) = 0) then\n return NIL\nend\ntheTheme = theVi ew.GetActiveThemes.Get(0)\nif ((theTheme.IsVisible.Not) or (theTheme.CanLabel.Not)) then\n return NIL\nend\n \n' If the name of the active theme and the theme name stored\n' in the Control's tag property are the same and the Shift\n' Key is not down, then set the flag to not open a MsgBox to \n' select label fields.\n\nselect = TRUE\nif (theParameter.Count > 0 ) then\n theThemeName = theParameter.Get(0)\n if ((theTheme.GetName = theThemeName) and (System.IsShiftKeyDown.Not)) then\n select = FALSE\n end\nend\n\nif ( select) then\n\n ' Exit if no visible fields\n\n theFieldsVisible = List.Make\n for each f in theTheme.GetFtab.GetFields\n if ((f.IsVisible) and (f.IsTypeShape.Not)) then\n theFieldsVisible.Add(f)\n end\n end\n if (theFieldsVisible.IsEmpty) then\n theMsg = \"No visible fields\"\n msgbox.Error(theMsg,theTheme.GetName)\n av.ShowMsg(\"\")\n return NIL\n end\n\n ' Open Msgbox and select label fields\n\n theMsg = \"Select label fields\"\n theTitle = \"Label\"++theTheme.GetName\n theFields = Msgbox.MultiListA sString(theFieldsVisible,theMsg,theTitle)\n if (theFields = NIL) then\n SELF.SetTag(\"\")\n return NIL\n end \n\n ' Store theme and label field names as Control Tag property\n \n theParameter = theTheme.GetName\n for each f in theFields\n theParameter = theParameter+\",\"+f.GetName\n end\n SELF.SetTag(theParameter)\n\nelse \n\n ' Get label field names from Control Tag Property\n \n theFields = list.Make\n for each i in 1..(theParameter.Count - 1)\n if (theTheme.GetFtab.FindField(theParameter.Get(i)) <> N IL) then\n theFields.Add(theTheme.GetFtab.FindField(theParameter.Get(i)))\n end\n if (theFields.IsEmpty) then\n return NIL\n end\n end \n\nend\n\n' Return list of record numbers where user clicks point, loop\n' to each record, return value strings for each label field, and\n' construct a string for the stacked label.\n\ntheRecList = theTheme.FindByPoint(pt)\nif (theRecList.IsEmpty.Not) then \n rcount = 1\n for each rec in theRecList\n fcount = 1\n for each f in theFields\n if ((rcount = 1) and (fcount = 1)) then\n theString = theTheme.ReturnValueString(f.GetName,rec)\n elseif ((rcount > 1) and (fcount = 1)) then\n if (theTheme.ReturnValueString(f.GetName,rec).Count > 0) then\n theString = theString+NL+NL+theTheme.ReturnValueString(f.GetName,rec)\n else\n theString = theString+NL\n end\n else\n if (theTheme.ReturnValueString(f.GetName,rec).Count > 0) then\n theString = theString+NL+theTheme.ReturnValueString(f.GetName,rec)\n e nd\n end\n fcount = fcount + 1\n end\n rcount = rcount + 1\n end\nelse\n System.Beep\n return NIL\nend\n\nt.SetText(theString)\nt.GetSymbol.SetFont(Font.Make(CFont,CStyle))\nt.GetSymbol.SetSize(CSize)\nt.GetSymbol.SetColor(CColor)\nt.SetName(\"Callout\")\n\nif (t.gettext.count<1) then return nil end\ntheDoc.GetGraphics.Add(t)\n\nfgcolor = CBGColor\nNumLines = t.GetText.AsTokens(nl).Count\nboxgsfill = RasterFill.Make\nboxgsfill.SetStyle(#RASTERFILL_STYLE_SOLID)\nboxgsfill.SetColor(fgcolor)\nif (UseOutline) then\n bo xgsfill.SetOutlined(true)\n boxgsfill.SetOLWidth(COLWidth)\n boxgsfill.SetOLColor(COLColor)\nelse\n boxgsfill.SetOutlined(false)\nend\nBgRect = t.GetBounds.Clone.ExpandBy(t.GetBounds.GetWidth * 0.1)\nCurrentHeight = t.GetBounds.GetHeight\nExpandDist = (CurrentHeight/NumLines)/5\nBgO = BgRect.ReturnOrigin\nBgRect.SetOrigin(BgO - (0@ExpandDist) )\nboxgs = GraphicShape.Make(BgRect)\nboxgs.SetName(\"Callout\")\nboxgs.SetSymbol(boxgsfill)\nboxgs.SetDisplay(theDoc.GetDisplay)\nif (CDS) then\n sbox = BgRect.Clone\n sbox.Move(Ex pandDist,-ExpandDist)\n shbox = GraphicShape.Make(sbox)\n shbox.SetName(\"Callout\")\n shboxfill = RasterFill.Make\n shboxfill.SetStyle(#RASTERFILL_STYLE_OPAQUESTIPPLE)\n shboxfill.SetOutlined(false)\n transc = Color.Make\n transc.SetTransparent(true)\n shboxfill.SetColor(transc)\n shboxfill.SetBGColor(DSColor)\n shbox.SetSymbol(shboxfill)\n shbox.SetDisplay(theDoc.GetDisplay)\nend\nif(CDS) then\n theDoc.GetGraphics.Add(shbox)\n shbox.SetSelected(FALSE)\nend\nthedoc.GetGraphics.Add(boxgs)\nboxgs.SetSelected(FALSE) \nt.SetSelected(TRUE)\ntheDoc.GetGraphics.MoveSelectedToFront\nif(CDS) then\n shbox.SetSelected(TRUE)\nend \nboxgs.SetSelected(TRUE)\ntheDoc.GetGraphics.GroupSelected\ntheDoc.GetGraphics.GetSelected.Get(0).SetName(\"Callout\")\nif(theDoc.Is(View)) then\n if (theDoc.GetActiveThemes.Count > 0) then\n theDoc.GetActiveThemes.Get(0).GetGraphics.Add(theDoc.getGraphics.GetSelected.Get(0))\n end\nend\ntheDoc.GetGraphics.GetSelected.Get(0).SetUniformScaling(true)\n\ntheDoc.getgraphics.unselectall\n" ) (Script.14 Name: "zLabelStacked.Tool" SourceCode: "' Name zLableStacked.Tool\n' File zLableStackedTool.txt\n' Application Stacked Label Tool (zlabstak.avx)\n' Function Labels active theme with stacked labels where user clicks\n' Parameters \n' Returns NIL upon error\n' Called by\n' Calls to View.Return Color\n' Requires Active feature theme, \"Graphic.Label Defaults\" dialog\n' Variables\n' History (Symbology setting technique from ESRI's View.LabelTool script)\n' 1-99 Howie Sternberg, State of Connecticut, DEP \n' Version 3.1\n' Desc An Apply event script for a Tool control in a view DocGUI that\n' adds stacked labels to features. Stacked labels annotate features with more \n' than one field value. This script labels the first active theme in the View.\n' The stacked label fields are chosen from a Msgbox and are valid for as long \n' as the theme remains active. To label a theme, make it active, click on a \n' feature, and choose the fields to label it with from the Msgbox that opens. \n' Continue labeling other features w ith the same set of stacked label fields\n' by leaving the theme active and clicking on features with this tool. To label \n' the same active theme with a different set of stack label fields, hold down \n' the Shift Key while using this tool and choose a new set of fields from the \n' Msgbox that opens. Label a different theme by making it active and then use\n' this tool. Note, this script uses the Tool control's Tag property to store \n' the name of the theme and stack label fields. There is no need to set the Tag \n' property in advance or at any time during or after using this script.\n\n' Stacked Labels are symbolized with the same text symbol used for normal Labels\n' in ArcView. Modify this text symbol in the Graphics>Text and Label Defaults\n' dialog by clicking on the \"Tag Tool\" icon.\n\n' Apply: zLabelStacked.Tool\n' Tag: zLabelStacked.ToolUpdate\n\n' Get Graphic Text default settings for Tag Tool (\"Ltool1\" object tag)\n \nCPC = av.FindDialog(\"Graphic.Label Defaults\")\nIconList = CPC.FindByN ame(\"CalloutIcons\")\nthePrefs = IconList.GetObjectTag.Get(\"Ltool1\")\n\n '(0) Font Family (String) \n '(1) Font Style (String)\n '(2) Font Size (Number)\n '(3) Font Color (String)\n '(10) UseDefFont (Boolean)\n\nCFont = thePrefs.Get(0)\nCStyle = thePrefs.Get(1)\nCSize = thePrefs.Get(2)\nUseDef = thePrefs.Get(10)\nif (thePrefs.Get(3) = \"Unnamed Color\") then\n CColor = av.GetSymbolwin.ReturnCurrentSymbol(#SYMBOL_TEXT).Clone.GetColor\nelse \n CColor = av.Run(\"View .Return Color\",thePrefs.Get(3))\nend\n\n' Get parameter from SELF\n\nif (SELF.is(control)) then\n theParameter = SELF.GetTag.AsTokens(\",\")\nelse\n return NIL\nend\n\n' Exit if no active theme\n\ntheView = av.GetActiveDoc\nif ((theView.GetActiveThemes.Count) = 0) then\n return NIL\nend\ntheTheme = theView.GetActiveThemes.Get(0)\nif ((theTheme.IsVisible.Not) or (theTheme.CanLabel.Not)) then\n return NIL\nend\n \n' If the name of the active theme and the theme name stored\n' in the Control's tag property are the same and the Shift\n' Key is not down, then set the flag to not open a MsgBox to \n' select label fields.\n\nselect = TRUE\nif (theParameter.Count > 0 ) then\n theThemeName = theParameter.Get(0)\n if ((theTheme.GetName = theThemeName) and (System.IsShiftKeyDown.Not)) then\n select = FALSE\n end\nend\n\nif (select) then\n\n ' Exit if no visible fields\n\n theFieldsVisible = List.Make\n for each f in theTheme.GetFtab.GetFields\n if ((f.IsVisible) and (f.IsTypeShape.Not)) then\n theFieldsVisible.Add(f)\n end\n end\n if ( theFieldsVisible.IsEmpty) then\n theMsg = \"No visible fields\"\n msgbox.Error(theMsg,theTheme.GetName)\n av.ShowMsg(\"\")\n return NIL\n end\n\n ' Open Msgbox and select label fields\n\n theMsg = \"Select label fields\"\n theTitle = \"Label\"++theTheme.GetName\n theFields = Msgbox.MultiListAsString(theFieldsVisible,theMsg,theTitle)\n if (theFields = NIL) then\n SELF.SetTag(\"\")\n return NIL\n end \n\n ' Store theme and label field names as Control Tag property\n \n theParameter = theTheme.GetName\n for each f in theFields\n theParameter = theParameter+\",\"+f.GetName\n end\n SELF.SetTag(theParameter)\n\nelse \n\n ' Get label field names from Control Tag Property\n \n theFields = list.Make\n for each i in 1..(theParameter.Count - 1)\n if (theTheme.GetFtab.FindField(theParameter.Get(i)) <> NIL) then\n theFields.Add(theTheme.GetFtab.FindField(theParameter.Get(i)))\n end\n if (theFields.IsEmpty) then\n return NIL\n end\n end \n\nend\n\n' Get Shape Field\n\nfor each f in theTheme.GetFtab.GetFields\n i f (f.isTypeShape) then\n theShapeField = f\n break\n end\nend\n\n' Return list of record numbers where user clicks point, loop\n' to each record, return value strings for each label field, and\n' construct a string for the stacked label.\n\npt = theView.GetDisplay.ReturnUserPoint \ntheRecList = theTheme.FindByPoint(pt)\nif (theRecList.IsEmpty.Not) then \n rcount = 1\n for each rec in theRecList\n fcount = 1\n for each f in theFields\n if ((rcount = 1) and (fcount = 1)) then\n theSymSize = theThe me.ReturnSymbolSize(rec)\n theShape = theTheme.GetFtab.ReturnValue(theShapeField,rec)\n theString = theTheme.ReturnValueString(f.GetName,rec)\n elseif ((rcount > 1) and (fcount = 1)) then\n if (theTheme.ReturnValueString(f.GetName,rec).Count > 0) then\n theString = theString+NL+NL+theTheme.ReturnValueString(f.GetName,rec)\n else\n theString = theString+NL\n end\n else\n if (theTheme.ReturnValueString(f.GetName,rec).Count > 0) then\n theStri ng = theString+NL+theTheme.ReturnValueString(f.GetName,rec)\n end\n end\n fcount = fcount + 1\n end\n rcount = rcount + 1\n end\nelse\n System.Beep\n return NIL\nend\n\n' Make graphic text. Symbolize the text with either the default text\n' symbol or the one set in the Graphics>Text and Label Defaults dialog \n' for the Tag Tool. Position it relative to the feature's shape using\n' the theme's text positioner.\n\ntheView.GetGraphics.UnselectAll\nt = GraphicText.Make(theString, pt)\nt.SetSelected(TRUE )\nt.SetDisplay(theView.GetDisplay)\nif (theTheme.GetFixedSizeText.Not) then\n theView.GetDisplay.HookupSymbol(t.GetSymbol)\nend\nif (not UseDef) then\n t.GetSymbol.SetFont(Font.make(Cfont,CStyle))\n t.GetSymbol.SetSize(CSize)\n t.GetSymbol.SetColor(CColor)\n t.Invalidate\nend\ntp = theTheme.GetTextPositioner\ntp.Calculate(theShape,t.GetExtent,theSymSize,pt)\nt.SetOrigin(tp.GetOrigin)\nt.SetAngle(tp.GetAngle)\ntheView.GetGraphics.Add(t)\n\nav.GetProject.SetModified(true)" ) (Script.15 Name: "zLabelStacked.ToolUpdate" SourceCode: "' zLabelStacked.ToolUpdate\n\ntheView = av.GetActiveDoc\nif (Extension.GetExtensions.Get(\"Label & Text Tools\") = NIL) then\n SELF.SetEnabled(FALSE)\n return nil\nend \nif (theView.GetEditableTheme <> NIL) then\n SELF.SetEnabled(FALSE)\n return nil\nend\nts = theView.GetActiveThemes\nif (ts.IsEmpty.Not) then\n t = ts.Get(0)\n if (t.IsVisible and (t.CanLabel) and (t.GetLabelField <> NIL)) then\n SELF.SetEnabled(TRUE)\n return nil\n end\nend\nSELF.SetEnabled(FALSE)\n" ) (Script.16 Name: "install" SourceCode: "' File install.txt\n\n' Make sure there is a project\n\nif (av.GetProject = nil) then\n return nil\nend\n\n' Add Control after select tool \n\nfor each g in av.GetProject.FindGUIsfor(View)\n tb = g.GetToolBar\n tc = tb.FindByScript(\"View.LabelTool\")\n if (tc = nil) then\n tb.Add(self.Get(0), tb.GetControls.count)\n else\n tb.Add(self.Get(0), (tb.GetControls.Find(tc) - 1))\n end\nend" ) (Script.17 Name: "uninstall" SourceCode: "' File Uninstal.txt\n\n' Make sure there is a project\n\nif (av.GetProject = nil) then\n return nil\nend\n\n' Uninstall only if the project is not closing\n\nif (av.GetProject.IsClosing) then\n return nil\nend\n\n' Remove GUIs\n\nfor each g in av.GetProject.FindGUIsfor(View)\n g.GetToolBar.Remove(self.Get(0))\nend" )