Browse Source

Remove duplicated InputBox.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@3362 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 17 years ago
parent
commit
61f9ddce50
  1. 19
      src/AddIns/Misc/HighlightingEditor/Project/Src/Nodes/KeywordListNode.cs
  2. 27
      src/AddIns/Misc/HighlightingEditor/Project/Src/Nodes/KeywordListsNode.cs
  3. 28
      src/AddIns/Misc/HighlightingEditor/Project/Src/Nodes/MarkersNode.cs
  4. 33
      src/AddIns/Misc/HighlightingEditor/Project/Src/Nodes/PropertiesNode.cs
  5. 27
      src/AddIns/Misc/HighlightingEditor/Project/Src/Nodes/RuleSetsNode.cs
  6. 20
      src/AddIns/Misc/HighlightingEditor/Project/Src/Nodes/SpansNode.cs
  7. 4
      src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj
  8. 50
      src/Main/Base/Project/Resources/InputBox.xfrm
  9. 8
      src/Main/Base/Project/Src/Commands/MenuItemBuilders.cs
  10. 40
      src/Main/Base/Project/Src/Gui/Dialogs/InputBox.cs

19
src/AddIns/Misc/HighlightingEditor/Project/Src/Nodes/KeywordListNode.cs

@ -179,18 +179,15 @@ namespace ICSharpCode.SharpDevelop.AddIns.HighlightingEditor.Nodes @@ -179,18 +179,15 @@ namespace ICSharpCode.SharpDevelop.AddIns.HighlightingEditor.Nodes
void addBtnClick(object sender, EventArgs e)
{
using (InputBox box = new InputBox()) {
box.Label.Text = ResourceService.GetString("Dialog.HighlightingEditor.KeywordList.EnterName");
if (box.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm) == DialogResult.Cancel) return;
if (box.TextBox.Text == "") return;
foreach (string item in listBox.Items) {
if (item == box.TextBox.Text)
return;
}
listBox.Items.Add(box.TextBox.Text);
string result = MessageService.ShowInputBox("", "${res:Dialog.HighlightingEditor.KeywordList.EnterName}", "");
if (string.IsNullOrEmpty(result))
return;
foreach (string item in listBox.Items) {
if (item == result)
return;
}
listBox.Items.Add(result);
}
void removeBtnClick(object sender, EventArgs e)

27
src/AddIns/Misc/HighlightingEditor/Project/Src/Nodes/KeywordListsNode.cs

@ -80,22 +80,19 @@ namespace ICSharpCode.SharpDevelop.AddIns.HighlightingEditor.Nodes @@ -80,22 +80,19 @@ namespace ICSharpCode.SharpDevelop.AddIns.HighlightingEditor.Nodes
void addClick(object sender, EventArgs e)
{
using (InputBox box = new InputBox()) {
box.Label.Text = ResourceService.GetString("Dialog.HighlightingEditor.KeywordLists.EnterName");
if (box.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm) == DialogResult.Cancel) return;
if (box.TextBox.Text == "") return;
foreach (ListViewItem item in listView.Items) {
if (item.Text == box.TextBox.Text)
return;
}
KeywordListNode kwn = new KeywordListNode(box.TextBox.Text);
ListViewItem lv = new ListViewItem(box.TextBox.Text);
lv.Tag = kwn;
parent.Nodes.Add(kwn);
listView.Items.Add(lv);
string result = MessageService.ShowInputBox("", "${res:Dialog.HighlightingEditor.KeywordList.EnterName}", "");
if (string.IsNullOrEmpty(result))
return;
foreach (ListViewItem item in listView.Items) {
if (item.Text == result)
return;
}
KeywordListNode kwn = new KeywordListNode(result);
ListViewItem lv = new ListViewItem(result);
lv.Tag = kwn;
parent.Nodes.Add(kwn);
listView.Items.Add(lv);
}
void removeClick(object sender, EventArgs e)

28
src/AddIns/Misc/HighlightingEditor/Project/Src/Nodes/MarkersNode.cs

@ -84,22 +84,20 @@ namespace ICSharpCode.SharpDevelop.AddIns.HighlightingEditor.Nodes @@ -84,22 +84,20 @@ namespace ICSharpCode.SharpDevelop.AddIns.HighlightingEditor.Nodes
void addClick(object sender, EventArgs e)
{
using (InputBox box = new InputBox()) {
box.Label.Text = ResourceService.GetString("Dialog.HighlightingEditor.Markers.EnterName");
if (box.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm) == DialogResult.Cancel) return;
if (box.TextBox.Text == "") return;
foreach (ListViewItem item in listView.Items) {
if (item.Text == box.TextBox.Text)
return;
}
MarkerNode rsn = new MarkerNode(box.TextBox.Text, previous);
ListViewItem lv = new ListViewItem(box.TextBox.Text);
lv.Tag = rsn;
parent.Nodes.Add(rsn);
listView.Items.Add(lv);
string result = MessageService.ShowInputBox("", "${res:Dialog.HighlightingEditor.Markers.EnterName}", "");
if (string.IsNullOrEmpty(result))
return;
foreach (ListViewItem item in listView.Items) {
if (item.Text == result)
return;
}
MarkerNode rsn = new MarkerNode(result, previous);
ListViewItem lv = new ListViewItem(result);
lv.Tag = rsn;
parent.Nodes.Add(rsn);
listView.Items.Add(lv);
}
void removeClick(object sender, EventArgs e)

33
src/AddIns/Misc/HighlightingEditor/Project/Src/Nodes/PropertiesNode.cs

@ -94,17 +94,16 @@ namespace ICSharpCode.SharpDevelop.AddIns.HighlightingEditor.Nodes @@ -94,17 +94,16 @@ namespace ICSharpCode.SharpDevelop.AddIns.HighlightingEditor.Nodes
void addClick(object sender, EventArgs e)
{
using (InputBox box = new InputBox()) {
box.Label.Text = ResourceService.GetString("Dialog.HighlightingEditor.Properties.EnterName");
if (box.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm) == DialogResult.Cancel) return;
foreach (ListViewItem item in listView.Items) {
if (item.Text == box.TextBox.Text)
return;
}
listView.Items.Add(new ListViewItem(new string[] {box.TextBox.Text, ""}));
string result = MessageService.ShowInputBox("", "${res:Dialog.HighlightingEditor.Properties.EnterName}", "");
if (string.IsNullOrEmpty(result))
return;
foreach (ListViewItem item in listView.Items) {
if (item.Text == result)
return;
}
listView.Items.Add(new ListViewItem(new string[] {result, ""}));
}
void removeClick(object sender, EventArgs e)
@ -118,13 +117,13 @@ namespace ICSharpCode.SharpDevelop.AddIns.HighlightingEditor.Nodes @@ -118,13 +117,13 @@ namespace ICSharpCode.SharpDevelop.AddIns.HighlightingEditor.Nodes
{
if (listView.SelectedItems.Count != 1) return;
using (InputBox box = new InputBox()) {
box.Text = ResourceService.GetString("Dialog.HighlightingEditor.EnterText");
box.Label.Text = String.Format(ResourceService.GetString("Dialog.HighlightingEditor.Properties.EnterValue"), listView.SelectedItems[0].Text);
if (box.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm) == DialogResult.Cancel) return;
listView.SelectedItems[0].SubItems[1].Text = box.TextBox.Text;
}
string result = MessageService.ShowInputBox("${res:Dialog.HighlightingEditor.EnterText}",
String.Format(ResourceService.GetString("Dialog.HighlightingEditor.Properties.EnterValue"), listView.SelectedItems[0].Text),
"");
if (string.IsNullOrEmpty(result))
return;
listView.SelectedItems[0].SubItems[1].Text = result;
}
}
}

27
src/AddIns/Misc/HighlightingEditor/Project/Src/Nodes/RuleSetsNode.cs

@ -82,22 +82,19 @@ namespace ICSharpCode.SharpDevelop.AddIns.HighlightingEditor.Nodes @@ -82,22 +82,19 @@ namespace ICSharpCode.SharpDevelop.AddIns.HighlightingEditor.Nodes
void addClick(object sender, EventArgs e)
{
using (InputBox box = new InputBox()) {
box.Label.Text = ResourceService.GetString("Dialog.HighlightingEditor.RuleSets.EnterName");
if (box.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm) == DialogResult.Cancel) return;
if (box.TextBox.Text == "") return;
foreach (ListViewItem item in listView.Items) {
if (item.Text == box.TextBox.Text)
return;
}
RuleSetNode rsn = new RuleSetNode(box.TextBox.Text, "&<>~!@%^*()-+=|\\#/{}[]:;\"' , .?", "", '\0', false);
ListViewItem lv = new ListViewItem(box.TextBox.Text);
lv.Tag = rsn;
parent.Nodes.Add(rsn);
listView.Items.Add(lv);
string result = MessageService.ShowInputBox("", "${res:Dialog.HighlightingEditor.RuleSets.EnterName}", "");
if (string.IsNullOrEmpty(result))
return;
foreach (ListViewItem item in listView.Items) {
if (item.Text == result)
return;
}
RuleSetNode rsn = new RuleSetNode(result, "&<>~!@%^*()-+=|\\#/{}[]:;\"' , .?", "", '\0', false);
ListViewItem lv = new ListViewItem(result);
lv.Tag = rsn;
parent.Nodes.Add(rsn);
listView.Items.Add(lv);
}
void removeClick(object sender, EventArgs e)

20
src/AddIns/Misc/HighlightingEditor/Project/Src/Nodes/SpansNode.cs

@ -78,18 +78,14 @@ namespace ICSharpCode.SharpDevelop.AddIns.HighlightingEditor.Nodes @@ -78,18 +78,14 @@ namespace ICSharpCode.SharpDevelop.AddIns.HighlightingEditor.Nodes
void addClick(object sender, EventArgs e)
{
using (InputBox box = new InputBox()) {
box.Label.Text = ResourceService.GetString("Dialog.HighlightingEditor.Spans.EnterName");
if (box.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm) == DialogResult.Cancel) return;
if (box.TextBox.Text == "") return;
SpanNode rsn = new SpanNode(box.TextBox.Text);
ListViewItem lv = new ListViewItem(rsn.Text);
lv.Tag = rsn;
parent.Nodes.Add(rsn);
listView.Items.Add(lv);
}
string result = MessageService.ShowInputBox("", "${res:Dialog.HighlightingEditor.Spans.EnterName}", "");
if (string.IsNullOrEmpty(result))
return;
SpanNode rsn = new SpanNode(result);
ListViewItem lv = new ListViewItem(rsn.Text);
lv.Tag = rsn;
parent.Nodes.Add(rsn);
listView.Items.Add(lv);
}
void removeClick(object sender, EventArgs e)

4
src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj

@ -325,9 +325,6 @@ @@ -325,9 +325,6 @@
<Compile Include="Src\Gui\Components\LocalizedPropertyGrid\LocalizedProperty.cs" />
<Compile Include="Src\Internal\ConditionEvaluators\IsProcessRunningEvaluator.cs" />
<Compile Include="Src\Internal\Doozers\PadDoozer.cs" />
<Compile Include="Src\Gui\Dialogs\InputBox.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Src\Gui\Pads\CompilerMessageView\MessageViewCategory.cs" />
<Compile Include="Src\Gui\Dialogs\OptionPanels\IDEOptions\TaskListOptions.cs">
<SubType>UserControl</SubType>
@ -454,7 +451,6 @@ @@ -454,7 +451,6 @@
<EmbeddedResource Include="Resources\ExternalToolOptions.xfrm" />
<EmbeddedResource Include="Resources\FontSelectionPanel.xfrm" />
<EmbeddedResource Include="Resources\NewFileWithNameDialog.xfrm" />
<EmbeddedResource Include="Resources\InputBox.xfrm" />
<EmbeddedResource Include="Resources\LoadSaveOptionPanel.xfrm" />
<EmbeddedResource Include="Resources\NewFileDialog.xfrm" />
<EmbeddedResource Include="Resources\OutputWindowOptionsPanel.xfrm" />

50
src/Main/Base/Project/Resources/InputBox.xfrm

@ -1,50 +0,0 @@ @@ -1,50 +0,0 @@
<Components version="1.0">
<System.Windows.Forms.Form>
<Name value="InputBox" />
<ShowInTaskbar value="False" />
<FormBorderStyle value="FixedDialog" />
<StartPosition value="CenterParent" />
<ClientSize value="{Width=418, Height=96}" />
<MinimizeBox value="False" />
<DockPadding value="" />
<AcceptButton value="acceptButton [System.Windows.Forms.Button], Text: ${res:Global.OKButtonText}" />
<CancelButton value="cancelButton [System.Windows.Forms.Button], Text: ${res:Global.CancelButtonText}" />
<MaximizeBox value="False" />
<Controls>
<System.Windows.Forms.Label>
<Name value="label" />
<Text value="&lt;&gt;" />
<Anchor value="Top, Left, Right" />
<TabIndex value="14" />
<ClientSize value="{Width=400, Height=16}" />
<Location value="{X=8,Y=8}" />
</System.Windows.Forms.Label>
<System.Windows.Forms.TextBox>
<Name value="textBox" />
<Anchor value="Top, Left, Right" />
<TabIndex value="0" />
<Location value="{X=8,Y=32}" />
<ClientSize value="{Width=396, Height=17}" />
<Text value="" />
</System.Windows.Forms.TextBox>
<System.Windows.Forms.Button>
<Name value="acceptButton" />
<Location value="{X=248,Y=64}" />
<ClientSize value="{Width=75, Height=23}" />
<Text value="${res:Global.OKButtonText}" />
<Anchor value="Bottom, Right" />
<TabIndex value="2" />
<DialogResult value="OK" />
</System.Windows.Forms.Button>
<System.Windows.Forms.Button>
<Name value="cancelButton" />
<Location value="{X=333,Y=64}" />
<ClientSize value="{Width=75, Height=23}" />
<Text value="${res:Global.CancelButtonText}" />
<Anchor value="Bottom, Right" />
<TabIndex value="1" />
<DialogResult value="Cancel" />
</System.Windows.Forms.Button>
</Controls>
</System.Windows.Forms.Form>
</Components>

8
src/Main/Base/Project/Src/Commands/MenuItemBuilders.cs

@ -257,13 +257,9 @@ namespace ICSharpCode.SharpDevelop.Commands @@ -257,13 +257,9 @@ namespace ICSharpCode.SharpDevelop.Commands
}
if (tool.PromptForArguments) {
InputBox box = new InputBox();
box.Text = tool.MenuCommand;
box.Label.Text = ResourceService.GetString("XML.MainMenu.ToolMenu.ExternalTools.EnterArguments");
box.TextBox.Text = args;
if (box.ShowDialog() != DialogResult.OK)
args = MessageService.ShowInputBox(tool.MenuCommand, "${res:XML.MainMenu.ToolMenu.ExternalTools.EnterArguments}", args);
if (args == null)
return;
args = box.TextBox.Text;
}
try {

40
src/Main/Base/Project/Src/Gui/Dialogs/InputBox.cs

@ -1,40 +0,0 @@ @@ -1,40 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
// created on 08.09.2003 at 22:11
using System;
using System.Windows.Forms;
using ICSharpCode.SharpDevelop.Gui.XmlForms;
namespace ICSharpCode.SharpDevelop.Gui {
public class InputBox : BaseSharpDevelopForm
{
Label label;
TextBox textBox;
public Label Label {
get {
return label;
}
}
public TextBox TextBox {
get {
return textBox;
}
}
public InputBox()
{
SetupFromXmlStream(this.GetType().Assembly.GetManifestResourceStream("Resources.InputBox.xfrm"));
label = (Label)ControlDictionary["label"];
textBox = (TextBox)ControlDictionary["textBox"];
}
}
}
Loading…
Cancel
Save