home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 February / Chip_2000-02_cd.bin / tema / ArcData / www / download / INTERS~1.ZIP / intersnap.avx next >
Encoding:
Text File  |  1999-10-14  |  6.6 KB  |  75 lines

  1. /3.1
  2. (Extension.1
  3.     Name:    "Interaktivnφ zachycovßnφ"
  4.     FirstRootClassName:    "Script"
  5.     Roots:    2
  6.     Roots:    3
  7.     Roots:    4
  8.     Roots:    5
  9.     Roots:    6
  10.     Roots:    7
  11.     Roots:    8
  12.     Roots:    9
  13.     Roots:    10
  14.     Roots:    11
  15.     Version:    31
  16.     InstallScript:    2
  17.     UninstallScript:    4
  18. )
  19.  
  20. (Script.2
  21.     Name:    "snappingExt.install"
  22.     SourceCode:    "thePMenu = av.FindGui(\"View\").GetPopUps\ns = thePMenu.GetControls.Get(0).FindByScript(\"View.ToggleInteractiveSnap\")\n\nif (s<>nil) then\n s.SetClick(\"View.ThemeSnapUpdate\")\nend\n\nfor each d in av.getproject.getdocs\n  if (d.Is(View)) then\n    for each t in d.GetThemes\n      if (t.Is(Ftheme)) then\n        if (t.IsInteractiveSnapping) then\n          t.SetInteractiveSnapping(False)\n        end\n      end\n    end\n  end\nend"
  23. )
  24.  
  25. (Script.3
  26.     Name:    "snappingExt.make"
  27.     SourceCode:    "snappingExt = extension.Make(\n  \"$AVEXT/intersnap.avx\".asfilename,\n  \"Interaktivnφ zachycovßnφ\",\n  av.FindScript(\"snappingExt.Install\"),\n  av.FindScript(\"snappingExt.Uninstall\"),\n  {})\n\nfor each aDoc in av.getproject.getdocs\n if (adoc.is(SEd)) then\n   if (adoc.iscompiled.not) then\n     adoc.compile\n   end\n   snappingExt.add(av.FindScript(adoc.getname))\n end\nend\n\nsnappingExt.Commit"
  28. )
  29.  
  30. (Script.4
  31.     Name:    "snappingExt.uninstall"
  32.     SourceCode:    "thePMenu = av.FindGui(\"View\").GetPopUps\ns = thePMenu.GetControls.Get(0).FindByScript(\"View.ThemeSnapUpdate\")\n\nif (s <> nil) then\n s.SetClick(\"View.ToggleInteractiveSnap\")\nend\n\ns = thePMenu.GetControls.Get(0).FindByScript(\"snappingExt.uninstall\")\n\nif (s <> nil) then\n s.SetClick(\"View.ToggleInteractiveSnap\")\nend\n\nthePop = thePMenu.GetControls.Get(0)\n\nfor each x in thePop.GetControls.Clone\n if (x.GetTag.Contains(\"ThemeSnap\")) then \n  thePop.Remove(x)\n end\nend\n\nfor each d in av.getproject.getdocs\n  if (d.Is(Vie
  33. w)) then\n    for each t in d.GetThemes\n      if (t.Is(Ftheme)) then\n        if (t.IsInteractiveSnapping) then\n          t.SetInteractiveSnapping(False)\n        end\n      end\n    end\n  end\nend"
  34. )
  35.  
  36. (Script.5
  37.     Name:    "View.InteractiveSnapTool"
  38.     SourceCode:    "theView = av.GetActiveDoc\n\nc = theView.ReturnUserCircle\nchoiceList = theView.GetThemes\n\nif (choiceList.Count < 1) then\n  exit\nend\n\n\nif (c.IsNull) then\n  return nil\nelse \n for each t in choicelist \n   if (t.Is(Ftheme)) then\n     t.SetInteractiveSnapTolerance (c.getradius) \n   end\n end\nend\n"
  39. )
  40.  
  41. (Script.6
  42.     Name:    "View.InteractiveSnapUpdate"
  43.     SourceCode:    "SELF.SetVisible(FALSE)\nSELF.SetEnabled(FALSE)\n'theView = av.GetActiveDoc\n'theTheme = theView.GetEditableTheme\n\n'if (theTheme <> nil) then\n'  if (theTheme.IsInteractiveSnapping) then\n'    theTool = av.GetActiveGUI.GetToolBar.GetActive\n'    if ((theTool.GetApply.AsString = \"View.PolyLineTool\") or \n'        (theTool.GetApply.AsString = \"View.PolyTool\") or\n'        (theTool.GetApply.AsString = \"View.AutoCompleteTool\") or\n'        (theTool.GetApply.AsString = \"View.SplitTool\")) then\n'      SELF.SetVisible(theThe
  44. me.IsInteractiveSnapping)\n'      SELF.SetEnabled(theTheme.IsInteractiveSnapping)\n'    end\n'  end\n'end\n\n\n'theView = av.GetActiveDoc\n'theView.SetInteractiveSnappingPersistent (FALSE)\n'theTheme =  theView.GetEditableTheme\n\n'if (theTheme <> nil) then\n'  if (theTheme.IsInteractiveSnapping) then\n'    theTheme.SetInteractiveSnapping(False)\n'  else\n"
  45. )
  46.  
  47. (Script.7
  48.     Name:    "View.ThemeSnap"
  49.     SourceCode:    "snapTheme = SELF.GetObjectTag\ntheView = av.GetActiveDoc\nif(SELF.GetTag.Contains( \"Hranice\")) then\n snaptype = #POINT_SNAP_BOUNDARY\nelseif (SELF.GetTag.Contains( \"Vrchol\")) then \n snaptype = #POINT_SNAP_VERTEX\nelseif (SELF.GetTag.Contains( \"Pr∙seΦφk\")) then \n snaptype = #POINT_SNAP_INTERSECTION \nelse\n snaptype = #POINT_SNAP_NONE\nend\n\ntheView.SetInterActiveSnapping(snapTheme,snaptype)\ntheView.SetInteractiveSnappingPersistent (TRUE)\n\n"
  50. )
  51.  
  52. (Script.8
  53.     Name:    "View.ThemeSnapDistance"
  54.     SourceCode:    "snapTheme = SELF.GetObjectTag\nthesnapdist = msgbox.Input(\"Set Interactive snap distance\",\"ArcView\", \"50\").asnumber\nsnapTheme.SetInteractiveSnapTolerance(thesnapdist)\n"
  55. )
  56.  
  57. (Script.9
  58.     Name:    "View.ThemeSnapOff"
  59.     SourceCode:    "'View.ThemeSnapOff\n\nsnapTheme = SELF.GetObjectTag\ntheView = av.GetActiveDoc\ntheView.SetInterActiveSnapping(snapTheme,#POINT_SNAP_NONE)\n\n"
  60. )
  61.  
  62. (Script.10
  63.     Name:    "View.ThemeSnapUpdate"
  64.     SourceCode:    "'View.ThemeSnapUpdate\n\ntheView = av.GetActiveDoc\ntheView.SetInteractiveSnappingPersistent (FALSE)\n\nif(System.IsShiftKeyDown) then\n  snaptype =\"Hranice\"\nelseif (System.IsAltKeyDown) then\n  snaptype =\"Pr∙seΦφk\"\nelse\n  snaptype =\"Vrchol\"\nend\n\n' Get the list of active themes to be used for choices...\n\nchoiceList2 = theView.GetThemes\n\nif (choiceList2.Count < 1) then\n  exit\nend\n\nsnapList = {}\nchoiceList = {}\n\nfor each t in choicelist2\n  if (t.Is(Ftheme)) then\n    choicelist.Add(t)\n  end\nend\n\nfor each t in choicel
  65. ist\n\n   t.SetInteractiveSnapping (true)\n\n   if (t.IsInteractiveSnapping ) then\n     snaplist.add(t)\n   end\nend\n\nif (snapList.Count < 1) then\n  MsgBox.Error(\"No Snap themes in view\",\"\")\n  exit\nend\n\nthePMenu = av.GetActiveGui.GetPopUps\nthePop = thePMenu.GetControls.Get(0)\n\n' Clear old items\n\nfor each x in thePop.GetControls.Clone\n if (x.GetTag.Contains(\"ThemeSnap\")) then \n  thePop.Remove(x)\n end\nend\n\n' For each snapple theme, add a choice and set control properties...\n\nthePop = thePMenu.GetControls.Get(0)\nind
  66. ex = 3\n\nfor each c in snapList\n  theChoice = thePop.New( index )\n  theChoice.SetLabel(\"Zachytit k \"+c.GetName + \"  -  \" + snaptype)\n  theChoice.SetClick(\"View.ThemeSnap\")\n  theChoice.SetHelp(\"Snap to theme\"++c.GetName )\n  theChoice.SetTag(\"ThemeSnap\" ++ snaptype)\n  theChoice.SetObjectTag(c)\n  theChoice.SetUpdate(\"View.ThemeSnapUpdate\")\n  index = index +1\nend\n\ntheChoice = Space.Make\ntheChoice.SetTag(\"ThemeSnap\")\nthePop.Add(theChoice,index )\n"
  67. )
  68.  
  69. (Script.11
  70.     Name:    "View.ToggleInteractiveSnapUpdate"
  71.     SourceCode:    "theView = av.GetActiveDoc\nactive = theView.GetEditableTheme\nif (active <> nil) then\n  if (active.IsInteractiveSnapping) then\n    SELF.SetLabel(\"Deaktivovat interaktivnφ zachycovßnφ\")\n    SELF.SetHelp(\"Deaktivuje interaktivnφ zachycovßnφ\")\n    SELF.SetClick(\"snappingExt.uninstall\")\n  else\n    SELF.SetLabel(\"Aktivovat interaktivnφ zachycovßnφ\")\n    SELF.SetHelp(\"Aktivuje interaktivnφ zachycovßnφ\")\n    SELF.SetClick(\"View.ThemeSnapUpdate\")\n  end\n  SELF.SetVisible(TRUE)\n  SELF.SetEnabled(TRUE)\nelse\n  SELF.SetCl
  72. ick(\"View.ToggleInteractiveSnap\")\n  av.run(\"snappingExt.uninstall\",{})\n  SELF.SetVisible(FALSE)\n  SELF.SetEnabled(FALSE)\nend        "
  73. )
  74.  
  75.