/3.1 (Extension.1 Name: "Shapefile Description Dialog" Dependencies: "$AVBIN/avdlog.dll\n" FirstRootClassName: "AVDLog" Roots: 2 Roots: 60 Roots: 61 Roots: 62 Roots: 63 Version: 31 About: "Opens a dialog with information about a shapefile theme. (v.1a)" CanUnloadScript: 64 UnloadScript: 65 InstallScript: 66 UninstallScript: 67 ExtVersion: 1 ) (AVDLog.2 Name: "ShpDesc.Dialog" X: 26 Y: 52 W: 348 H: 427 ConstrainedControlNames: 3 Constraints: 4 Server: 5 ControlPanel: 6 Title: "Shapefile Information" EscapeEnabled: 1 Modal: 1 Resizable: 1 AlwaysOnTop: 1 HasTitleBar: 1 Closeable: 1 Open: "ShpDesc.Open" DefaultButton: 59 ) (AVStr.3 S: "Close" ) (Numb.4 N: 102.00000000000000 ) (Nil.5 ) (CPanel.6 Child: 7 Child: 8 Child: 9 Child: 10 Child: 11 Child: 12 Child: 13 Child: 14 Child: 15 Child: 18 Child: 19 Child: 20 Child: 21 Child: 22 Child: 23 Child: 24 Child: 25 Child: 26 Child: 27 Child: 28 Child: 29 Child: 30 Child: 31 Child: 32 Child: 33 ResBox: 34 ResBox: 35 ResBox: 36 ResBox: 37 ResBox: 38 ResBox: 39 ResBox: 40 ResBox: 41 ResBox: 42 ResBox: 43 ResBox: 44 ResBox: 45 ResBox: 46 ResBox: 47 ResBox: 48 ResBox: 49 ResBox: 50 ResBox: 51 ResBox: 52 ResBox: 53 ResBox: 54 ResBox: 55 ResBox: 56 ResBox: 57 ResBox: 58 Listening: 1 ) (TextLabel.7 InternalName: "txtName" Constraints: 0x55 Label: "Theme name:" Listening: 1 ) (TextLabel.8 InternalName: "txtSource" Constraints: 0x55 Label: "Shapefile source:" Listening: 1 ) (TextLabel.9 InternalName: "txtNumber" Constraints: 0x55 Label: "Number of features:" Listening: 1 ) (TextLabel.10 InternalName: "txtType" Constraints: 0x55 Label: "Feature type:" Listening: 1 ) (TextLabel.11 InternalName: "txtSpatial" Constraints: 0x55 Label: "Spatial index?" Listening: 1 ) (TextLabel.12 InternalName: "txtLocked" Constraints: 0x55 Label: "Locked?" Listening: 1 ) (TextLabel.13 InternalName: "txtFieldNames" Constraints: 0x55 Label: "Attribute field names and types:" Listening: 1 ) (LButn.14 InternalName: "Close" Help: " " Label: "Close" Click: "ShpDesc.Close" ) (AVLBox.15 InternalName: "lbxFieldList" Help: "Shows the field names and field types." NextControl: 16 ContentKind: 4 Constraints: 0x33 ColumnCount: 1 HorizontalScroll: 1 Listening: 1 VerticalScroll: 1 SelectionStyle: 17 ) (Nil.16 ) (AVEnum.17 Name: "LISTBOX_SELECTION_SINGLECELL" ) (TextLabel.18 InternalName: "txtShowName" Constraints: 0x53 Label: " " Listening: 1 ) (TextLabel.19 InternalName: "txtShowSource" Constraints: 0x53 Label: " " Listening: 1 ) (TextLabel.20 InternalName: "txtShowType" Constraints: 0x55 Label: " " Listening: 1 ) (TextLabel.21 InternalName: "txtShowSIndex" Constraints: 0x55 Label: " " Listening: 1 ) (TextLabel.22 InternalName: "txtShowLocked" Constraints: 0x55 Label: " " Listening: 1 ) (TextLabel.23 InternalName: "txtShowNumber" Constraints: 0x53 Label: " " Listening: 1 ) (TextLabel.24 InternalName: "txtShowNumSel" Constraints: 0x53 Label: " " Listening: 1 ) (TextLabel.25 InternalName: "txtNumSel" Constraints: 0x55 Label: "Number of features selected:" Listening: 1 ) (TextLabel.26 InternalName: "txtShowExtent" Constraints: 0x33 Label: " " Listening: 1 ) (TextLabel.27 InternalName: "txtExtent" Constraints: 0x55 Label: "Theme extent:" Listening: 1 ) (TextLabel.28 InternalName: "txtShowDef" Constraints: 0x33 Label: " " Listening: 1 ) (TextLabel.29 InternalName: "txtDefinition" Constraints: 0x55 Label: "Definition?" Listening: 1 ) (TextLabel.30 InternalName: "txtShowHotLinks" Constraints: 0x55 Label: " " Listening: 1 ) (TextLabel.31 InternalName: "txtHotLinks" Constraints: 0x55 Label: "Hot Links?" Listening: 1 ) (TextLabel.32 InternalName: "txtShowMatchable" Constraints: 0x55 Label: " " Listening: 1 ) (TextLabel.33 InternalName: "txtMatchable" Constraints: 0x55 Label: "Matchable?" Listening: 1 ) (RectD.34 Left: 17.00000000000000 Top: 26.00000000000000 Right: 119.00000000000000 Bottom: 9.00000000000000 ) (RectD.35 Left: 17.00000000000000 Top: 50.00000000000000 Right: 133.00000000000000 Bottom: 33.00000000000000 ) (RectD.36 Left: 17.00000000000000 Top: 98.00000000000000 Right: 191.00000000000000 Bottom: 81.00000000000000 ) (RectD.37 Left: 17.00000000000000 Top: 74.00000000000000 Right: 119.00000000000000 Bottom: 57.00000000000000 ) (RectD.38 Left: 19.00000000000000 Top: 195.00000000000000 Right: 125.00000000000000 Bottom: 178.00000000000000 ) (RectD.39 Left: 192.00000000000000 Top: 195.00000000000000 Right: 279.00000000000000 Bottom: 178.00000000000000 ) (RectD.40 Left: 19.00000000000000 Top: 278.00000000000000 Right: 264.00000000000000 Bottom: 261.00000000000000 ) (RectD.41 Left: 237.00000000000000 Top: 416.00000000000000 Right: 333.00000000000000 Bottom: 388.00000000000000 ) (RectD.42 Left: 19.00000000000000 Top: 382.00000000000000 Right: 333.00000000000000 Bottom: 280.00000000000000 ) (RectD.43 Left: 141.00000000000000 Top: 26.00000000000000 Right: 333.00000000000000 Bottom: 9.00000000000000 ) (RectD.44 Left: 141.00000000000000 Top: 49.00000000000000 Right: 333.00000000000000 Bottom: 33.00000000000000 ) (RectD.45 Left: 141.00000000000000 Top: 74.00000000000000 Right: 289.00000000000000 Bottom: 57.00000000000000 ) (RectD.46 Left: 137.00000000000000 Top: 194.00000000000000 Right: 175.00000000000000 Bottom: 178.00000000000000 ) (RectD.47 Left: 299.00000000000000 Top: 195.00000000000000 Right: 333.00000000000000 Bottom: 178.00000000000000 ) (RectD.48 Left: 218.00000000000000 Top: 97.00000000000000 Right: 333.00000000000000 Bottom: 81.00000000000000 ) (RectD.49 Left: 218.00000000000000 Top: 121.00000000000000 Right: 333.00000000000000 Bottom: 104.00000000000000 ) (RectD.50 Left: 17.00000000000000 Top: 121.00000000000000 Right: 214.00000000000000 Bottom: 104.00000000000000 ) (RectD.51 Left: 143.00000000000000 Top: 179.00000000000000 Right: 333.00000000000000 Bottom: 129.00000000000000 ) (RectD.52 Left: 17.00000000000000 Top: 146.00000000000000 Right: 143.00000000000000 Bottom: 129.00000000000000 ) (RectD.53 Left: 138.00000000000000 Top: 259.00000000000000 Right: 326.00000000000000 Bottom: 221.00000000000000 ) (RectD.54 Left: 19.00000000000000 Top: 237.00000000000000 Right: 104.00000000000000 Bottom: 221.00000000000000 ) (RectD.55 Left: 299.00000000000000 Top: 216.00000000000000 Right: 333.00000000000000 Bottom: 199.00000000000000 ) (RectD.56 Left: 192.00000000000000 Top: 216.00000000000000 Right: 279.00000000000000 Bottom: 199.00000000000000 ) (RectD.57 Left: 137.00000000000000 Top: 215.00000000000000 Right: 175.00000000000000 Bottom: 199.00000000000000 ) (RectD.58 Left: 19.00000000000000 Top: 216.00000000000000 Right: 124.00000000000000 Bottom: 199.00000000000000 ) (Nil.59 ) (Script.60 Name: "ShpDesc.Close" SourceCode: "self.GetDialog.Close" ) (Script.61 Name: "ShpDesc.Open" SourceCode: "' Shapefile description\n' Works on the first active FTheme in the view.\n\n' initialize some variables\nv = av.GetActiveDoc\nt = v.GetActiveThemes.Get(0)\nf = t.GetFTab\nnameText = self.FindByName(\"txtShowName\")\n nameText.SetLabel(t.GetName)\nsrcText = self.FindByName(\"txtShowSource\")\n srcText.SetLabel(t.GetSrcName.GetDataSource)\ntypeText = self.FindByName(\"txtShowType\")\n fs = f.FindField(\"Shape\")\n typeText.SetLabel(t.GetSrcName.GetSubName)\nnumText = self.FindByName(\"txtShowNumber\")\n nu mText.SetLabel(f.GetNumRecords.asString)\nnumselText = self.FindByName(\"txtShowNumSel\")\n numselText.SetLabel(f.GetNumSelRecords.asString)\nextText = self.FindByName(\"txtShowExtent\")\n e = t.ReturnExtent\n lx = e.GetLeft\n lx.SetFormat(\"d.d\")\n lx = lx.asString\n ly = e.GetBottom\n ly.SetFormat(\"d.d\")\n ly = ly.asString\n hx = e.GetRight\n hx.SetFormat(\"d.d\")\n hx = hx.asString\n hy = e.GetTop\n hy.SetFormat(\"d.d\")\n hy = hy.asString\n extText.SetLabel(lx+\",\"++ly+NL+hx+\",\"++hy)\ndefText = self.FindByName(\"t xtShowDef\")\n if (f.GetDefinition.IsNull) then\n defText.SetLabel(\"None\")\n else\n defText.SetLabel(f.getdefinition)\n end\nsindText = self.FindByName(\"txtShowSIndex\")\n if (f.IsFieldIndexed(fs)) then\n sindText.SetLabel(\"Yes\")\n else\n sindText.SetLabel(\"No\")\n end\nmatchText = self.FindByName(\"txtShowMatchable\")\n if (t.IsMatchable) then\n matchText.SetLabel(\"Yes\")\n else\n matchText.SetLabel(\"No\")\n end\nlockText = self.FindByName(\"txtShowLocked\")\n if (t.IsLocked) then\n lockText.SetLabel(\"Ye s\")\n else\n lockText.SetLabel(\"No\")\n end\nhlText = self.FindByName(\"txtShowHotLinks\")\n if ((t.GetHotField <> Nil) and (t.GetHotScriptName <> Nil)) then\n hlText.SetLabel(\"Yes\")\n else\n hlText.SetLabel(\"No\")\n end\nfldListBox = self.FindByName(\"lbxFieldList\")\n fldListBox.InsertRows(f.GetFields.Count)\n fldListBox.InsertColumns(10)\n l = {{\"Field Name\",\"Alias\",\"Field Type\",\"Width\",\"Precision\",\"Status\",\n \"Pixel Width\",\"Editable\",\"Redefined\",\"Visible\"}}\n for each i in f.GetFields\n fname = i .GetName\n falias = i.GetAlias\n ftype = i.GetType\n fwidth = i.GetWidth\n fprec = i.GetPrecision\n fstat = i.GetStatus\n fpwidth = i.GetPixelWidth\n feditable = i.IsEditable\n fredef = i.IsRedefined\n fisvis = i.IsVisible\n l.Add({fname,falias,ftype.AsString,fwidth.AsString,\n fprec.AsString,fstat.AsString,fpwidth.AsString,\n feditable.AsString,fredef.AsString,fisvis.AsString})\n end\n fldListBox.DefineFromList(l)" ) (Script.62 Name: "ShpDesc.Run" SourceCode: "av.FindDialog(\"ShpDesc.Dialog\").Open" ) (Script.63 Name: "ShpDesc.ButtonUpdate" SourceCode: "themes = av.GetActiveDoc.GetActiveThemes\nif (themes.count = 0) then\n self.SetEnabled( FALSE )\n return nil\nend\n'\n' there must be some active themes\n'\nfor each t in themes\n if (t.Is(FTheme)) then\n self.SetEnabled( TRUE )\n return nil\n end\nend\n\nSelf.SetEnabled( FALSE )" ) (Script.64 Name: "ShpDesc.CanUnload" SourceCode: "return (true)" ) (Script.65 Name: "ShpDesc.Unload" SourceCode: "Dialog.DetachFromExtension(SELF)" ) (Script.66 Name: "ShpDesc.Install" SourceCode: "mybutton = SELF.get(0).clone\nmybutton.setname(\"ShpDesc\")\n\n' ShpDesc.Install\nif (av.getproject = nil) then return nil end\n\nif(SELF.GetPreferences.Get(\"Loaded\") = true) then\n 'msgbox.info(\"are we there yet\",\"loaded = true\")\n return nil\nend\n\ntheviewGUI = av.GetProject.FindGUI(\"View\")\nif (theviewGUI = nil) then\n Msgbox.Info(\"Cannot find a ViewGUI for the Shapefile Description dialog button.\",\n \"Shapefile Description\")\n return nil\nend\n\n'** View GUI, Button bar\nctlSet = av.FindGUI(\"View\").GetButtonBar\nnIdx = (ctlSet.GetControls.Count - 2)\nsHlp = \"Describes a shapefile theme\"\nicCur = Icon.MakeFromResName(\"Icons.FrameText\")\nctl = Button.Make\nctl.SetClick(\"ShpDesc.Run\")\nctl.SetUpdate(\"ShpDesc.ButtonUpdate\")\nctl.SetHelp(sHlp+\"//\"+sHlp)\nctl.SetName(\"ShpDesc\")\nctl.SetHelpTopic(\"\")\nctl.SetIcon(icCur)\nctlSet.Add(ctl.clone,nIdx)\n\ntheviewGUI.SetModified(true)\nSELF.GetPreferences.Set(\"Loaded\", true)\nav.GetProject.SetModified(true)\n" ) (Script.67 Name: "ShpDesc.UnInstall" SourceCode: "' Don't uninstall if there is no project\nif (av.GetProject = nil) then return nil end\n\n' Clean up even if the project is closing\n' don't uninstall extension objects if project is closing\nif (av.GetProject.IsClosing) then return nil end\n\n'** View GUI, Button bar\nViewGUI = av.GetProject.FindGUI(\"View\")\nx = nil\n\nif (viewGUI <> nil) then\n ctlSet = viewGUI.GetButtonBar\n for each b in ctlSet\n if (b.GetName = \"ShpDesc\") then\n x = b\n break\n end\n end\n if (x <> Nil) then\n ctlSet.Remove(x)\n end \nend\n" )