예제 #1
0
 public void AddGlobalItem(IEditorComponent component, MenuCommand command)
 {
     ToolStripButton button = new ToolStripButton(string.Empty, Factory.GUIController.ImageList.Images[command.IconKey], new EventHandler(ToolbarEventHandler), command.ID);
     button.Tag = component;
     button.ToolTipText = command.Name;
     _toolBar.Items.Add(button);
 }
예제 #2
0
		public ContentDocument(EditorContentPanel control, string name, 
            IEditorComponent owner, string iconKey,
            Dictionary<string, object> propertyGridObjectList)
			: this(control, name, owner, iconKey)
		{
			_propertyGridObjectList = propertyGridObjectList;
		}
예제 #3
0
 public ContentDocument(EditorContentPanel control, string name, IEditorComponent owner)
 {
     _control = control;
     _name = name;
     _owner = owner;
     _toolbarCommands = null;
 }
예제 #4
0
        public void AddGlobalItems(IEditorComponent component, List<MenuCommand> commands)
        {
            if (_toolBar.Items.Count > 0)
            {
                _toolBar.Items.Add(new ToolStripSeparator());
            }

            foreach (MenuCommand command in commands)
            {
                AddGlobalItem(component, command);
            }
        }
예제 #5
0
 private void RegisterTreeNode(string id, IEditorComponent plugin)
 {
     if (_treeNodes.ContainsKey(id))
     {
         if (_treeNodes[id] != plugin)
         {
             throw new AGSEditorException("Tree node " + id + " is already registered to another component!");
         }
     }
     else
     {
         _treeNodes.Add(id, plugin);
     }
 }
예제 #6
0
        public ProjectTreeItem AddTreeBranch(IEditorComponent component, string id, string name, string iconKey)
        {
            RegisterTreeNode(id, component);

            iconKey = SetDefaultIconIfNoneProvided(iconKey);
            if (_lastAddedNode != null)
            {
                _lastAddedNode = _lastAddedNode.Nodes.Add(id, name, iconKey, iconKey);
            }
            else
            {
                _lastAddedNode = this._projectTree.Nodes.Add(id, name, iconKey, iconKey);
            }
            ProjectTreeItem newItem = new ProjectTreeItem(id, _lastAddedNode);
            _lastAddedNode.Tag = newItem;
            return newItem;
        }
예제 #7
0
        private string RegisterMenuCommand(string id, IEditorComponent component)
        {
            id = GetMenuCommandID(id, component);

            if (!_menuItems.ContainsKey(id))
            {
                _menuItems.Add(id, component);
            }

            return id;
        }
예제 #8
0
 public void SetMenuItemEnabled(IEditorComponent plugin, string id, bool enabled)
 {
     string commandID = GetMenuCommandID(id, plugin);
     _menuManager.SetMenuItemEnabled(commandID, enabled);
 }
예제 #9
0
 //Kept for plugins
 public ContentDocument(EditorContentPanel control, string name,
     IEditorComponent owner) : this(control, name, owner, (string)null)
 { }
예제 #10
0
        public IProjectTreeItem AddTreeLeaf(IEditorComponent component, string id, string name, string iconKey, bool greyedOut)
        {
            RegisterTreeNode(id, component);

            TreeNode newNode;
            iconKey = SetDefaultIconIfNoneProvided(iconKey);
            if (_lastAddedNode != null)
            {
                newNode = _lastAddedNode.Nodes.Add(id, name, iconKey, iconKey);
            }
            else
            {
                newNode = this._projectTree.Nodes.Add(id, name, iconKey, iconKey);
            }
            if (greyedOut)
            {
                newNode.ForeColor = Color.Gray;
            }
            ProjectTreeItem newItem = new ProjectTreeItem(id, newNode);
            newNode.Tag = newItem;
            return newItem;
        }
예제 #11
0
 public void StartFromNode(IEditorComponent plugin, string id)
 {
     TreeNode[] results = _projectTree.Nodes.Find(id, true);
     if (results.Length > 0)
     {
         _lastAddedNode = results[0];
     }
     else
     {
         throw new AGSEditorException("Unable to select node " + id);
     }
 }
예제 #12
0
 public void ChangeNodeIcon(IEditorComponent plugin, string id, string newIconKey)
 {
     TreeNode[] results = _projectTree.Nodes.Find(id, true);
     if (results.Length > 0)
     {
         results[0].ImageKey = newIconKey;
         results[0].SelectedImageKey = newIconKey;
     }
 }
예제 #13
0
 public void RemoveAllChildNodes(IEditorComponent plugin, string parentID)
 {
     TreeNode[] results = _projectTree.Nodes.Find(parentID, true);
     if (results.Length > 0)
     {
         results[0].Nodes.Clear();
     }
 }
예제 #14
0
        public void AddTreeRoot(IEditorComponent plugin, string id, string name, string iconKey)
        {
            RegisterTreeNode(id, plugin);

            iconKey = SetDefaultIconIfNoneProvided(iconKey);
            _lastAddedNode = this._projectTree.Nodes.Add(id, name, iconKey, iconKey);

            ProjectTreeItem newItem = new ProjectTreeItem(id, _lastAddedNode);
            newItem.AllowLabelEdit = false;
            _lastAddedNode.Tag = newItem;
        }
예제 #15
0
 private string GetMenuCommandID(string id, IEditorComponent component)
 {
     if (!id.Contains(CONTROL_ID_SPLIT))
     {
         id = component.ComponentID + CONTROL_ID_SPLIT + id;
     }
     return id;
 }
예제 #16
0
 internal void RegisterContextMenuCommands(IList<MenuCommand> commands, IEditorComponent plugin)
 {
     foreach (MenuCommand command in commands)
     {
         if (command.ID != null)
         {
             command.ID = RegisterMenuCommand(command.ID, plugin);
         }
     }
 }
 public BeforeShowContextMenuEventArgs(string nodeId, IEditorComponent component, MenuCommands menuCommands)
 {
     _component = component;
     _menuCommands = menuCommands;
     _nodeId = nodeId;
 }
예제 #18
0
 //Kept for plugins
 public ContentDocument(EditorContentPanel control, string name,
     IEditorComponent owner, Dictionary<string, object> propertyGridObjectList)
     : this(control, name, owner, null, propertyGridObjectList)
 { }
예제 #19
0
 public void BeginLabelEdit(IEditorComponent plugin, string nodeID)
 {
     SelectNode(plugin, nodeID);
     TreeNode[] results = _projectTree.Nodes.Find(nodeID, true);
     if (results.Length > 0)
     {
         results[0].BeginEdit();
     }
 }
예제 #20
0
 public void AddMenu(IEditorComponent plugin, string id, string title)
 {
     _menuManager.AddMenu(id, title);
 }
예제 #21
0
 public void ExpandNode(IEditorComponent plugin, string id)
 {
     TreeNode[] results = _projectTree.Nodes.Find(id, true);
     if (results.Length > 0)
     {
         results[0].Expand();
     }
 }
예제 #22
0
 public void AddMenu(IEditorComponent plugin, string id, string title, string insertAfterMenu)
 {
     _menuManager.AddMenu(id, title, insertAfterMenu);
 }
예제 #23
0
 public void SelectNode(IEditorComponent plugin, string id)
 {
     TreeNode[] results = _projectTree.Nodes.Find(id, true);
     if (results.Length > 0)
     {
         _projectTree.SelectedNode = results[0];
     }
 }
예제 #24
0
 public void AddMenuItems(IEditorComponent plugin, MenuCommands commands)
 {
     if (commands.Commands.Count > 0)
     {
         foreach (MenuCommand command in commands.Commands)
         {
             if (command.ID != null)
             {
                 RegisterMenuCommand(command.ID, plugin);
             }
             command.IDPrefix = plugin.ComponentID + CONTROL_ID_SPLIT;
         }
         _menuManager.AddMenuCommandGroup(commands);
     }
 }
예제 #25
0
 private void AllowPluginsToModifyContextMenu(string nodeID, IList<MenuCommand> commands, IEditorComponent component)
 {
     if (BeforeShowContextMenu != null)
     {
         MenuCommands menuCommands = new MenuCommands(commands);
         BeforeShowContextMenu(new BeforeShowContextMenuEventArgs(nodeID, component, menuCommands));
         foreach (MenuCommand command in commands)
         {
             if (!command.IsSeparator)
             {
                 if (!Factory.GUIController.CanFindComponentFromMenuItemID(command.ID))
                 {
                     throw new AGSEditorException("A plugin or event handler has not used GUIController.CreateMenuCommand to create its menu command (ID '" + command.ID + "')");
                 }
             }
         }
     }
 }
예제 #26
0
 public MenuCommand CreateMenuCommand(IEditorComponent component, string commandID, string commandName)
 {
     MenuCommand newCommand = new MenuCommand(commandID, commandName);
     newCommand.ID = RegisterMenuCommand(commandID, component);
     return newCommand;
 }
예제 #27
0
 public IProjectTreeItem AddTreeLeaf(IEditorComponent plugin, string id, string name, string iconKey)
 {
     return AddTreeLeaf(plugin, id, name, iconKey, false);
 }
예제 #28
0
 public void RePopulateTreeView(IEditorComponent component, string selectedNode)
 {
     IRePopulatableComponent repopulatableComponent = component as IRePopulatableComponent;
     if (repopulatableComponent != null)
     {
         if (selectedNode == null)
         {
             repopulatableComponent.RePopulateTreeView();
         }
         else
         {
             repopulatableComponent.RePopulateTreeView(selectedNode);
         }
     }
 }
예제 #29
0
 void IAGSEditor.AddComponent(IEditorComponent component)
 {
     _componentController.AddComponent(component);
 }
예제 #30
0
 public void RePopulateTreeView(IEditorComponent component)
 {
     RePopulateTreeView(component, null);
 }