| 0: | // EditTemplateDialog.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 System; | |
| 18: | using System.Drawing; | |
| 19: | using System.ComponentModel; | |
| 20: | using System.Windows.Forms; | |
| 21: | ||
| 22: | using SharpDevelop.Gui; | |
| 23: | using SharpDevelop.Internal.Templates; | |
| 24: | using SharpDevelop.Tool.Data; | |
| 25: | ||
| 26: | namespace SharpDevelop.Gui.Dialogs { | |
| 27: | ||
| 28: | public class EditTemplateDialog : Form | |
| 29: | { | |
| 30: | ||
| 31: | private System.ComponentModel.Container components; | |
| 32: | private Button cancelButton; | |
| 33: | private Button button1; | |
| 34: | private TextBox descriptionTextBox; | |
| 35: | private Label label2; | |
| 36: | private TextBox ShortCutTextBox; | |
| 37: | private Label label1; | |
| 38: | CodeTemplate t; | |
| 39: | ||
| 40: | void CloseEvent(object sender, EventArgs e) | |
| 41: | { | |
| 42: | t.Shortcut = ShortCutTextBox.Text; | |
| 43: | t.Description = descriptionTextBox.Text; | |
| 44: | } | |
| 45: | ||
| 46: | public EditTemplateDialog(CodeTemplate t) { | |
| 47: | ||
| 48: | this.t = t; | |
| 49: | // Required for Win Form Designer support | |
| 50: | InitializeComponent(); | |
| 51: | ||
| 52: | ShortCutTextBox.Text = t.Shortcut; | |
| 53: | descriptionTextBox.Text = t.Description; | |
| 54: | AcceptButton = button1; | |
| 55: | CancelButton = cancelButton; | |
| 56: | button1.Click += new EventHandler(CloseEvent); | |
| 57: | TopMost = true; | |
| 58: | ShortCutTextBox.Select(); | |
| 59: | StartPosition = FormStartPosition.CenterParent; | |
| 60: | MaximizeBox = MinimizeBox = false; | |
| 61: | ShowInTaskbar = false; | |
| 62: | Icon = null; | |
| 63: | StartPosition = FormStartPosition.CenterParent; | |
| 64: | ||
| 65: | } | |
| 66: | ||
| 67: | /// <summary> | |
| 68: | /// Clean up any resources being used. | |
| 69: | /// </summary> | |
| 70: | protected override void Dispose(bool disposing) | |
| 71: | { | |
| 72: | if (disposing) { | |
| 73: | if (components != null){ | |
| 74: | components.Dispose(); | |
| 75: | } | |
| 76: | } | |
| 77: | base.Dispose(disposing); | |
| 78: | } | |
| 79: | ||
| 80: | ||
| 81: | /// <summary> | |
| 82: | /// Required method for Designer support - do not modify | |
| 83: | /// the contents of this method with an editor | |
| 84: | /// </summary> | |
| 85: | private void InitializeComponent() | |
| 86: | { | |
| 87: | this.components = new System.ComponentModel.Container(); | |
| 88: | this.button1 = new Button(); | |
| 89: | this.label1 = new Label(); | |
| 90: | this.label2 = new Label(); | |
| 91: | this.ShortCutTextBox = new TextBox(); | |
| 92: | this.descriptionTextBox = new TextBox(); | |
| 93: | this.cancelButton = new Button(); | |
| 94: | ||
| 95: | button1.Location = new System.Drawing.Point(124, 72); | |
| 96: | button1.Size = new System.Drawing.Size(74, 24); | |
| 97: | button1.TabIndex = 4; | |
| 98: | button1.Text = Resource.GetString("Global.OKButtonText"); | |
| 99: | ||
| 100: | label1.Location = new System.Drawing.Point(8, 11); | |
| 101: | label1.Text = Resource.GetString("Dialog.Options.CodeTemplate.Template"); | |
| 102: | label1.Size = new System.Drawing.Size(74, 16); | |
| 103: | label1.TabIndex = 0; | |
| 104: | ||
| 105: | label2.Location = new System.Drawing.Point(8, 43); | |
| 106: | label2.Text = Resource.GetString("Dialog.Options.CodeTemplate.Description"); | |
| 107: | label2.Size = new System.Drawing.Size(74, 16); | |
| 108: | label2.TabIndex = 2; | |
| 109: | ||
| 110: | ShortCutTextBox.Location = new System.Drawing.Point(80, 8); | |
| 111: | ShortCutTextBox.Text = ""; | |
| 112: | ShortCutTextBox.TabIndex = 1; | |
| 113: | ShortCutTextBox.Size = new System.Drawing.Size(200, 20); | |
| 114: | ||
| 115: | descriptionTextBox.Location = new System.Drawing.Point(80, 40); | |
| 116: | descriptionTextBox.Text = ""; | |
| 117: | descriptionTextBox.TabIndex = 3; | |
| 118: | descriptionTextBox.Size = new System.Drawing.Size(200, 20); | |
| 119: | ||
| 120: | this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); | |
| 121: | this.Text = "Edit Template"; | |
| 122: | //@design this.TrayLargeIcon = true; | |
| 123: | this.FormBorderStyle = FormBorderStyle.FixedDialog; | |
| 124: | //@design this.TrayHeight = 0; | |
| 125: | this.ClientSize = new System.Drawing.Size(290, 103); | |
| 126: | ||
| 127: | cancelButton.Location = new System.Drawing.Point(206, 72); | |
| 128: | cancelButton.Size = new System.Drawing.Size(74, 24); | |
| 129: | cancelButton.TabIndex = 5; | |
| 130: | cancelButton.Text = Resource.GetString("Global.CancelButtonText"); | |
| 131: | button1.DialogResult = DialogResult.OK; | |
| 132: | cancelButton.DialogResult = DialogResult.Cancel; | |
| 133: | ||
| 134: | this.Controls.Add(cancelButton); | |
| 135: | this.Controls.Add(button1); | |
| 136: | this.Controls.Add(descriptionTextBox); | |
| 137: | this.Controls.Add(label2); | |
| 138: | this.Controls.Add(ShortCutTextBox); | |
| 139: | this.Controls.Add(label1); | |
| 140: | } | |
| 141: | } | |
| 142: | } |
This page was automatically generated by SharpDevelop.