| 0: | // Tools.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: | ||
| 29: | using SharpDevelop.Actions; | |
| 30: | using SharpDevelop.Gui; | |
| 31: | using SharpDevelop.Gui.Edit.Text; | |
| 32: | using SharpDevelop.Gui.Dialogs; | |
| 33: | using SharpDevelop.Gui.Dialogs.OptionPanels; | |
| 34: | using SharpDevelop.Gui.Window; | |
| 35: | using SharpDevelop.Tool.Data; | |
| 36: | using SharpDevelop.Internal.Project; | |
| 37: | using SharpDevelop.Internal.Text; | |
| 38: | using SharpDevelop.Internal.Messages; | |
| 39: | using SharpDevelop.Internal.Messages.Standard; | |
| 40: | ||
| 41: | namespace SharpDevelop.Actions.Menu { | |
| 42: | ||
| 43: | public class ShowIDEOptions : ISdPlugin | |
| 44: | { | |
| 45: | public ISdMessageHandler MessageHandler { | |
| 46: | get { | |
| 47: | return null; | |
| 48: | } | |
| 49: | } | |
| 50: | ||
| 51: | public void Execute(ISdPluginExecutor executor) | |
| 52: | { | |
| 53: | // TODO : TabbedOptions config | |
| 54: | TreeViewOptions o = new TreeViewOptions(executor.Main); | |
| 55: | o.Height = 460; | |
| 56: | o.FormBorderStyle = FormBorderStyle.FixedDialog; | |
| 57: | ||
| 58: | o.AddOptionPanel(new IDEOptionPanel(executor.Main, Resource.GetString("Dialog.Options.IDEOptions.SelectCulture.PanelName")), Resource.GetString("Dialog.Options.IDEOptions.UIOptionsText")); | |
| 59: | o.AddOptionPanel(new SelectMenuStylePanel(executor.Main, Resource.GetString("Dialog.Options.IDEOptions.SelectMenuStyle.PanelName")), Resource.GetString("Dialog.Options.IDEOptions.UIOptionsText")); | |
| 60: | ||
| 61: | o.AddOptionPanel(new CodeTemplatePane(executor.Main), Resource.GetString("Dialog.Options.IDEOptions.CodingOptionsText")); | |
| 62: | ||
| 63: | ||
| 64: | ||
| 65: | BufferOptions obj = (BufferOptions)Options.GetProperty("SharpDevelop.Internal.Text.TextBuffer.BufferOptions", new BufferOptions()); | |
| 66: | o.AddOptionPanel(new GeneralTextEditorPanel(obj, Resource.GetString("Dialog.Options.IDEOptions.TextEditor.General.PanelName")), Resource.GetString("Dialog.Options.IDEOptions.TextEditorOptionsText")); | |
| 67: | o.AddOptionPanel(new MarkersTextEditorPanel(obj, Resource.GetString("Dialog.Options.IDEOptions.TextEditor.Markers.PanelName")), Resource.GetString("Dialog.Options.IDEOptions.TextEditorOptionsText")); | |
| 68: | o.AddOptionPanel(new BehaviorTextEditorPanel(obj, Resource.GetString("Dialog.Options.IDEOptions.TextEditor.Behaviour.PanelName")), Resource.GetString("Dialog.Options.IDEOptions.TextEditorOptionsText")); | |
| 69: | ||
| 70: | o.AddOptionPanel(new ExternalToolPane(), Resource.GetString("Dialog.Options.IDEOptions.ToolsOptionsText")); | |
| 71: | ||
| 72: | o.AddOptionPanel(new HelpGeneratingPanel(Resource.GetString("Dialog.Options.IDEOptions.HelpGeneratingPanelText")), Resource.GetString("Dialog.Options.IDEOptions.ToolsOptionsText")); | |
| 73: | ||
| 74: | // send ShowOptionsMessage | |
| 75: | ShowOptionsMessage msg = new ShowOptionsMessage(ShowOptionsMessage.ShowOptions, o); | |
| 76: | Messenger.SendMessage(msg); | |
| 77: | ||
| 78: | o.ShowDialog(); | |
| 79: | o.Dispose(); | |
| 80: | } | |
| 81: | } | |
| 82: | ||
| 83: | public class ShowBufferOptions : ISdPlugin | |
| 84: | { | |
| 85: | public ISdMessageHandler MessageHandler { | |
| 86: | get { | |
| 87: | return null; | |
| 88: | } | |
| 89: | } | |
| 90: | ||
| 91: | public void Execute(ISdPluginExecutor executor) | |
| 92: | { | |
| 93: | if (executor.Main.ActiveContentWindow != null) { | |
| 94: | TabbedOptions o = new TabbedOptions(executor.Main); | |
| 95: | ||
| 96: | o.Icon = Resource.GetIcon("Icons.16x16.PropertiesIcon"); | |
| 97: | o.Text = Resource.GetString("Dialog.Options.BufferOptions"); | |
| 98: | o.Width = 450; | |
| 99: | o.Height = 425; | |
| 100: | o.FormBorderStyle = FormBorderStyle.FixedDialog; | |
| 101: | o.AddOptionPanel(new GeneralTextEditorPanel(executor.Main.ActiveContentWindow.TextArea.Options, Resource.GetString("Dialog.Options.IDEOptions.TextEditor.General.PanelName"))); | |
| 102: | o.AddOptionPanel(new MarkersTextEditorPanel(executor.Main.ActiveContentWindow.TextArea.Options, Resource.GetString("Dialog.Options.IDEOptions.TextEditor.Markers.PanelName"))); | |
| 103: | o.AddOptionPanel(new BehaviorTextEditorPanel(executor.Main.ActiveContentWindow.TextArea.Options, Resource.GetString("Dialog.Options.IDEOptions.TextEditor.Behaviour.PanelName"))); | |
| 104: | o.ShowDialog(); | |
| 105: | o.Dispose(); | |
| 106: | } | |
| 107: | } | |
| 108: | } | |
| 109: | ||
| 110: | public class ShowColorDialog : ISdPlugin | |
| 111: | { | |
| 112: | public ISdMessageHandler MessageHandler { | |
| 113: | get { | |
| 114: | return null; | |
| 115: | } | |
| 116: | } | |
| 117: | ||
| 118: | public void Execute(ISdPluginExecutor executor) | |
| 119: | { | |
| 120: | if (executor.Main.ActiveContentWindow == null || !executor.Main.ActiveContentWindow.HasTextArea) | |
| 121: | return; | |
| 122: | ||
| 123: | TextAreaControl textarea = executor.Main.ActiveContentWindow.TextArea; | |
| 124: | ||
| 125: | ColorDialog cd = new ColorDialog(); | |
| 126: | if (cd.ShowDialog() == DialogResult.OK) { | |
| 127: | string colorstr = "#" + cd.Color.ToArgb().ToString("X"); | |
| 128: | if (cd.Color.IsKnownColor) | |
| 129: | colorstr = cd.Color.ToKnownColor().ToString(); | |
| 130: | ||
| 131: | textarea.Buffer.Insert(textarea.Caret.CaretPos, colorstr); | |
| 132: | textarea.UpdateLines(textarea.Caret.CaretPos.Y, textarea.Caret.CaretPos.Y); | |
| 133: | } | |
| 134: | cd.Dispose(); | |
| 135: | ||
| 136: | } | |
| 137: | } | |
| 138: | } |
This page was automatically generated by SharpDevelop.