| 0: | // View.cs | |
| 1: | // Copyright (C) 2000 Mike Krueger | |
| 2: | // | |
| 3: | // This program is free software; you can redistribute it and/or modify | |
| 4: | // it under the terms of the GNU General Public License as published by | |
| 5: | // the Free Software Foundation; either version 2 of the License, or | |
| 6: | // (at your option) any later version. | |
| 7: | // | |
| 8: | // This program is distributed in the hope that it will be useful, | |
| 9: | // but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 10: | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 11: | // GNU General Public License for more details. | |
| 12: | // | |
| 13: | // You should have received a copy of the GNU General Public License | |
| 14: | // along with this program; if not, write to the Free Software | |
| 15: | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 16: | ||
| 17: | using Microsoft.Win32; | |
| 18: | using System; | |
| 19: | using System.Collections; | |
| 20: | using System.IO; | |
| 21: | using System.ComponentModel; | |
| 22: | using System.Windows.Forms; | |
| 23: | using System.Drawing; | |
| 24: | using System.Diagnostics; | |
| 25: | using System.CodeDom.Compiler; | |
| 26: | using System.Xml; | |
| 27: | using System.Reflection; | |
| 28: | using System.Text; | |
| 29: | ||
| 30: | using SharpDevelop.Actions; | |
| 31: | using SharpDevelop.Gui; | |
| 32: | using SharpDevelop.Gui.Edit.Text; | |
| 33: | using SharpDevelop.Gui.Dialogs; | |
| 34: | using SharpDevelop.Gui.Window; | |
| 35: | using SharpDevelop.Tool.Data; | |
| 36: | using SharpDevelop.Internal.Project; | |
| 37: | using SharpDevelop.Internal.Messages; | |
| 38: | ||
| 39: | namespace SharpDevelop.Actions.Menu { | |
| 40: | ||
| 41: | //////////// View Menu | |
| 42: | public class ToggleToolbar : ISdToggleablePlugin | |
| 43: | { | |
| 44: | public ISdMessageHandler MessageHandler { | |
| 45: | get { | |
| 46: | return null; | |
| 47: | } | |
| 48: | } | |
| 49: | ||
| 50: | public bool IsEnabled(ISdPluginExecutor executor) | |
| 51: | { | |
| 52: | return executor.Main.sharptoolbar.Visible; | |
| 53: | } | |
| 54: | ||
| 55: | public void Execute(ISdPluginExecutor executor) | |
| 56: | { | |
| 57: | executor.Main.sharptoolbar.Visible = !executor.Main.sharptoolbar.Visible; | |
| 58: | } | |
| 59: | } | |
| 60: | ||
| 61: | ||
| 62: | public class ToggleProjectExplorer : ISdToggleablePlugin | |
| 63: | { | |
| 64: | public ISdMessageHandler MessageHandler { | |
| 65: | get { | |
| 66: | return null; | |
| 67: | } | |
| 68: | } | |
| 69: | public bool IsEnabled(ISdPluginExecutor executor) | |
| 70: | { | |
| 71: | return executor.Main.dockedproject.DockState.Visible; | |
| 72: | } | |
| 73: | ||
| 74: | public void Execute(ISdPluginExecutor executor) | |
| 75: | { | |
| 76: | if (executor.Main.dockedproject.DockState.Visible) | |
| 77: | executor.Main.dockedproject.HideDockedControl(); | |
| 78: | else | |
| 79: | executor.Main.dockedproject.ShowDockedControl(); | |
| 80: | } | |
| 81: | } | |
| 82: | ||
| 83: | public class ToggleClassScout : ISdToggleablePlugin | |
| 84: | { | |
| 85: | public ISdMessageHandler MessageHandler { | |
| 86: | get { | |
| 87: | return null; | |
| 88: | } | |
| 89: | } | |
| 90: | public bool IsEnabled(ISdPluginExecutor executor) | |
| 91: | { | |
| 92: | return executor.Main.dockedproject.DockState.Visible; | |
| 93: | } | |
| 94: | ||
| 95: | public void Execute(ISdPluginExecutor executor) | |
| 96: | { | |
| 97: | if (executor.Main.dockedclassbrowser.DockState.Visible) | |
| 98: | executor.Main.dockedclassbrowser.HideDockedControl(); | |
| 99: | else | |
| 100: | executor.Main.dockedclassbrowser.ShowDockedControl(); | |
| 101: | } | |
| 102: | } | |
| 103: | ||
| 104: | public class ToggleFileBrowser : ISdToggleablePlugin | |
| 105: | { | |
| 106: | public ISdMessageHandler MessageHandler { | |
| 107: | get { | |
| 108: | return null; | |
| 109: | } | |
| 110: | } | |
| 111: | public bool IsEnabled(ISdPluginExecutor executor) | |
| 112: | { | |
| 113: | return executor.Main.dockedfilescout.DockState.Visible; | |
| 114: | } | |
| 115: | ||
| 116: | public void Execute(ISdPluginExecutor executor) | |
| 117: | { | |
| 118: | if (executor.Main.dockedfilescout.DockState.Visible) | |
| 119: | executor.Main.dockedfilescout.HideDockedControl(); | |
| 120: | else | |
| 121: | executor.Main.dockedfilescout.ShowDockedControl(); | |
| 122: | } | |
| 123: | } | |
| 124: | ||
| 125: | public class ToggleOpenFileView : ISdToggleablePlugin | |
| 126: | { | |
| 127: | public ISdMessageHandler MessageHandler { | |
| 128: | get { | |
| 129: | return null; | |
| 130: | } | |
| 131: | } | |
| 132: | public bool IsEnabled(ISdPluginExecutor executor) | |
| 133: | { | |
| 134: | return executor.Main.dockedopenfileview.DockState.Visible; | |
| 135: | } | |
| 136: | ||
| 137: | public void Execute(ISdPluginExecutor executor) | |
| 138: | { | |
| 139: | if (executor.Main.dockedopenfileview.DockState.Visible) | |
| 140: | executor.Main.dockedopenfileview.HideDockedControl(); | |
| 141: | else | |
| 142: | executor.Main.dockedopenfileview.ShowDockedControl(); | |
| 143: | } | |
| 144: | } | |
| 145: | ||
| 146: | public class ToggleSideBarView : ISdToggleablePlugin | |
| 147: | { | |
| 148: | public ISdMessageHandler MessageHandler { | |
| 149: | get { | |
| 150: | return null; | |
| 151: | } | |
| 152: | } | |
| 153: | public bool IsEnabled(ISdPluginExecutor executor) | |
| 154: | { | |
| 155: | return executor.Main.dockedsidebar.DockState.Visible; | |
| 156: | } | |
| 157: | ||
| 158: | public void Execute(ISdPluginExecutor executor) | |
| 159: | { | |
| 160: | if (executor.Main.dockedsidebar.DockState.Visible) | |
| 161: | executor.Main.dockedsidebar.HideDockedControl(); | |
| 162: | else | |
| 163: | executor.Main.dockedsidebar.ShowDockedControl(); | |
| 164: | } | |
| 165: | } | |
| 166: | ||
| 167: | public class ToggleOutputWindow : ISdToggleablePlugin | |
| 168: | { | |
| 169: | public ISdMessageHandler MessageHandler { | |
| 170: | get { | |
| 171: | return null; | |
| 172: | } | |
| 173: | } | |
| 174: | public bool IsEnabled(ISdPluginExecutor executor) | |
| 175: | { | |
| 176: | return executor.Main.dockedcompresview.DockState.Visible; | |
| 177: | } | |
| 178: | public void Execute(ISdPluginExecutor executor) | |
| 179: | { | |
| 180: | if (executor.Main.dockedcompresview.DockState.Visible) | |
| 181: | executor.Main.HideOutputWindow(); | |
| 182: | else | |
| 183: | executor.Main.ShowOutputWindow(); | |
| 184: | } | |
| 185: | } | |
| 186: | ||
| 187: | public class ToggleFullscreen : ISdToggleablePlugin | |
| 188: | { | |
| 189: | Rectangle oldbounds; | |
| 190: | public ISdMessageHandler MessageHandler { | |
| 191: | get { | |
| 192: | return null; | |
| 193: | } | |
| 194: | } | |
| 195: | public bool IsEnabled(ISdPluginExecutor executor) | |
| 196: | { | |
| 197: | return executor.Main.FullScreen; | |
| 198: | } | |
| 199: | ||
| 200: | public void Execute(ISdPluginExecutor executor) | |
| 201: | { | |
| 202: | if (executor.Main.FullScreen) { | |
| 203: | executor.Main.FormBorderStyle = FormBorderStyle.Sizable; | |
| 204: | executor.Main.Bounds = oldbounds; | |
| 205: | } else { | |
| 206: | executor.Main.FormBorderStyle = FormBorderStyle.None; | |
| 207: | oldbounds = executor.Main.Bounds; | |
| 208: | executor.Main.Bounds = Screen.PrimaryScreen.Bounds; | |
| 209: | } | |
| 210: | executor.Main.FullScreen = !executor.Main.FullScreen; | |
| 211: | } | |
| 212: | } | |
| 213: | } | |
| 214: |
This page was automatically generated by SharpDevelop.