public void Shutdown(IApplication application) { m_myToolBarButton1 = m_myToolBarButton2 = null; application.ToolBars.Remove(m_myToolBar); m_myToolBar = null; m_myMenuItem = null; application.MenuStrip.DropDownMenus.Remove(m_myDropDownMenu); m_myDropDownMenu = null; }
public void Shutdown(IApplication application) { // TODO m_npcToolBarButton = m_eventToolBarButton = null; application.ToolBars.Remove(m_myToolBar); m_myToolBar = null; m_myMenuItem = null; application.MenuStrip.DropDownMenus.Remove(m_myDropDownMenu); m_myDropDownMenu = null; }
private SpButton CreateButton(IToolBarButton toolBarButton) { var button = new SpButton { Text = toolBarButton.Text, Size = btnLogout.Size }; button.ApplyTheme(_theme); button.Click += async(s, e) => await ToolBarCustomButtonClick(toolBarButton.Action); return(button); }
public void Remove(IToolBarButton toolBarButton) { ToolBarButtonBridge toolBarButtonBridge = (ToolBarButtonBridge)toolBarButton; if (!m_toolBarButtons.Contains(toolBarButtonBridge)) { throw new Exception( "Cannot remove a toolbar button that is not contained in this toolbar"); } if (toolBarButton.ReadOnly) { throw new Exception("Cannot remove a built-in toolbar"); } ToolStripButton toolStripButton = toolBarButtonBridge.ToolStripButton; toolStripButton.Owner.Items.Remove(toolStripButton); m_toolBarButtons.Remove(toolBarButtonBridge); }
public void Initialise(IApplication application) { m_myDropDownMenu = application.MenuStrip.DropDownMenus.Add("My Custom Menu"); m_myDropDownMenu.Image = Properties.Resources.Menu; m_myMenuItem = application.MenuStrip.DropDownMenus["My Custom Menu"].SubItems.Add("My Menu Item 1"); m_myMenuItem.Image = Properties.Resources.Action; m_myMenuItem.ShortcutKeys = (Keys)(Keys.Control | Keys.Z); m_myMenuItem.EventHandler = MyCustomAction; m_myToolBar = application.ToolBars.Add("MyToolBar"); m_myToolBarButton1 = m_myToolBar.Buttons.Add("Button1", Properties.Resources.Action); m_myToolBarButton1.ToolTipText = "My ToolStrip Button 1"; m_myToolBarButton1.Checked = true; m_myToolBarButton1.EventHandler = MyCustomAction; m_myToolBarButton2 = m_myToolBar.Buttons.Add("Button2", Properties.Resources.Action); m_myToolBarButton2.ToolTipText = "My second toolbar button"; m_myToolBarButton2.Enabled = false; application.Editor.MouseDown = OnEditorMouseDown; }
public void Initialise(IApplication application) { m_myDropDownMenu = application.MenuStrip.DropDownMenus.Add("My Custom Menu"); m_myDropDownMenu.Image = Properties.Resources.Menu; m_myMenuItem = application.MenuStrip.DropDownMenus["My Custom Menu"].SubItems.Add("My Menu Item 1"); m_myMenuItem.Image = Properties.Resources.Action; m_myMenuItem.ShortcutKeys = (Keys)(Keys.Control | Keys.Z); m_myMenuItem.EventHandler = MyCustomAction; m_myToolBar = application.ToolBars.Add("MyToolBar"); m_myToolBarButton1 = m_myToolBar.Buttons.Add("Button1", Properties.Resources.Action); m_myToolBarButton1.ToolTipText = "My ToolStrip Button 1"; m_myToolBarButton1.Checked = true; m_myToolBarButton1.EventHandler = MyCustomAction; m_myToolBarButton2 = m_myToolBar.Buttons.Add("Button2", Properties.Resources.Action); m_myToolBarButton2.ToolTipText = "My second toolbar button"; m_myToolBarButton2.Enabled = false; application.Editor.MouseDown = OnEditorMouseDown; }
public void Remove(IToolBarButton toolBarButton) { ToolBarButtonBridge toolBarButtonBridge = (ToolBarButtonBridge)toolBarButton; if (!m_toolBarButtons.Contains(toolBarButtonBridge)) throw new Exception( "Cannot remove a toolbar button that is not contained in this toolbar"); if (toolBarButton.ReadOnly) throw new Exception("Cannot remove a built-in toolbar"); ToolStripButton toolStripButton = toolBarButtonBridge.ToolStripButton; toolStripButton.Owner.Items.Remove(toolStripButton); m_toolBarButtons.Remove(toolBarButtonBridge); }
public void Initialise(IApplication application) { application.ToolBars.Clear(); m_myDropDownMenu = application.MenuStrip.DropDownMenus.Add("RPG"); m_myDropDownMenu.Image = Properties.Resources.Sword_32; m_myMenuItem = application.MenuStrip.DropDownMenus["RPG"].SubItems.Add("Project Settings"); m_myMenuItem.Image = Properties.Resources.ProjectSettings_32; m_myMenuItem.EventHandler = ProjectSettings; m_myMenuItem = application.MenuStrip.DropDownMenus["RPG"].SubItems.Add("Place NPC"); m_myMenuItem.Image = Properties.Resources.NPC_32; m_myMenuItem.EventHandler = NPCAction; m_myMenuItem = application.MenuStrip.DropDownMenus["RPG"].SubItems.Add("Place Event"); m_myMenuItem.Image = Properties.Resources.Event_32; m_myMenuItem.EventHandler = EventAction; m_myMenuItem = application.MenuStrip.DropDownMenus["RPG"].SubItems.Add("Eraser"); m_myMenuItem.Image = Properties.Resources.Eraser_32; m_myMenuItem.EventHandler = EventAction; //m_myMenuItem = application.MenuStrip.DropDownMenus["RPG"].SubItems.Add("TileSheet Meta"); //m_myMenuItem.Image = Properties.Resources.TileSheetMeta_32; //m_myMenuItem.ToolBarButtonHandler = TileSheetsAction; m_myToolBar = application.ToolBars.Add("RPG ToolBar"); m_projectSettingsToolBarButton = m_myToolBar.Buttons.Add("projectSettingsButton", Properties.Resources.ProjectSettings_16); m_projectSettingsToolBarButton.ToolTipText = "Project Settings"; m_projectSettingsToolBarButton.EventHandler = ProjectSettings; m_npcToolBarButton = m_myToolBar.Buttons.Add("Button1", Properties.Resources.NPC_16); m_npcToolBarButton.ToolTipText = "Place NPC"; m_npcToolBarButton.EventHandler = NPCAction; m_eventToolBarButton = m_myToolBar.Buttons.Add("Button2", Properties.Resources.Event_16); m_eventToolBarButton.ToolTipText = "Place Event"; m_eventToolBarButton.EventHandler = EventAction; m_tilesheetToolBarButton = m_myToolBar.Buttons.Add("Button3", Properties.Resources.TileSheetMeta_16); m_tilesheetToolBarButton.ToolTipText = "TileSheets"; m_tilesheetToolBarButton.ToolBarButtonHandler = TileSheetsAction; m_eraserToolBarButton = m_myToolBar.Buttons.Add("eraserButton", Properties.Resources.Eraser_16); m_eraserToolBarButton.ToolTipText = "TileSheets"; m_eraserToolBarButton.ToolBarButtonHandler = EraserAction; // pass application map to plugin m_projectId = application.Editor.ProjectId; if (string.IsNullOrEmpty(m_projectId)) { m_projectId = Prompt.ShowDialog("Project Name", "New Project"); } // load map meta data //var map = application.Editor.Map; //m_dataStore = new BinaryDataStore($"{Settings.ProjectFilePath}{m_projectId}\\"); m_dataStore = new BinaryDataStore(); //m_mapMeta = m_dataStore.Load<MapMeta>($"{map.Id}.MapMeta"); //if (m_mapMeta == null) // m_mapMeta = new MapMeta(map); m_actorManager = new ActorManager($"../../../MonoGame/Content/charset/"); // add plugin events to application application.Editor.MouseDown = OnEditorMouseDown; application.Editor.DrawTile = OnDrawTile; application.Editor.LayerNew = OnLayerNew; application.Editor.LayerDelete = OnLayerDelete; application.Editor.LayerProperties = OnLayerProperties; application.Editor.Save = OnSave; application.Editor.Load = OnLoad; }
public void Shutdown(IApplication application) { m_myToolBarButton1 = m_myToolBarButton2 = null; application.ToolBars.Remove(m_myToolBar); m_myToolBar = null; m_myMenuItem = null; application.MenuStrip.DropDownMenus.Remove(m_myDropDownMenu); m_myDropDownMenu = null; }