Browse Source
git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@2120 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61shortcuts
19 changed files with 989 additions and 77 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,145 @@
@@ -0,0 +1,145 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
|
||||
// <version>$Revision: 1965 $</version>
|
||||
// </file>
|
||||
|
||||
namespace ICSharpCode.SharpDevelop.Gui |
||||
{ |
||||
partial class AddNewConfigurationDialog : System.Windows.Forms.Form |
||||
{ |
||||
/// <summary>
|
||||
/// Designer variable used to keep track of non-visual components.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null; |
||||
|
||||
/// <summary>
|
||||
/// Disposes resources used by the form.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing) |
||||
{ |
||||
if (disposing) { |
||||
if (components != null) { |
||||
components.Dispose(); |
||||
} |
||||
} |
||||
base.Dispose(disposing); |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// This method is required for Windows Forms designer support.
|
||||
/// Do not change the method contents inside the source code editor. The Forms designer might
|
||||
/// not be able to load this method if it was changed manually.
|
||||
/// </summary>
|
||||
private void InitializeComponent() |
||||
{ |
||||
this.label1 = new System.Windows.Forms.Label(); |
||||
this.nameTextBox = new System.Windows.Forms.TextBox(); |
||||
this.label2 = new System.Windows.Forms.Label(); |
||||
this.copyFromComboBox = new System.Windows.Forms.ComboBox(); |
||||
this.createInAllCheckBox = new System.Windows.Forms.CheckBox(); |
||||
this.okButton = new System.Windows.Forms.Button(); |
||||
this.cancelButton = new System.Windows.Forms.Button(); |
||||
this.SuspendLayout(); |
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.Location = new System.Drawing.Point(12, 9); |
||||
this.label1.Name = "label1"; |
||||
this.label1.Size = new System.Drawing.Size(237, 23); |
||||
this.label1.TabIndex = 0; |
||||
this.label1.Text = "${res:Dialog.NewProject.NameLabelText}"; |
||||
//
|
||||
// nameTextBox
|
||||
//
|
||||
this.nameTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) |
||||
| System.Windows.Forms.AnchorStyles.Right))); |
||||
this.nameTextBox.Location = new System.Drawing.Point(12, 26); |
||||
this.nameTextBox.Name = "nameTextBox"; |
||||
this.nameTextBox.Size = new System.Drawing.Size(237, 20); |
||||
this.nameTextBox.TabIndex = 1; |
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.Location = new System.Drawing.Point(12, 49); |
||||
this.label2.Name = "label2"; |
||||
this.label2.Size = new System.Drawing.Size(237, 23); |
||||
this.label2.TabIndex = 2; |
||||
this.label2.Text = "Copy &settings from:"; |
||||
//
|
||||
// copyFromComboBox
|
||||
//
|
||||
this.copyFromComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; |
||||
this.copyFromComboBox.FormattingEnabled = true; |
||||
this.copyFromComboBox.Location = new System.Drawing.Point(12, 65); |
||||
this.copyFromComboBox.Name = "copyFromComboBox"; |
||||
this.copyFromComboBox.Size = new System.Drawing.Size(237, 21); |
||||
this.copyFromComboBox.TabIndex = 3; |
||||
//
|
||||
// createInAllCheckBox
|
||||
//
|
||||
this.createInAllCheckBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) |
||||
| System.Windows.Forms.AnchorStyles.Right))); |
||||
this.createInAllCheckBox.Location = new System.Drawing.Point(12, 92); |
||||
this.createInAllCheckBox.Name = "createInAllCheckBox"; |
||||
this.createInAllCheckBox.Size = new System.Drawing.Size(237, 24); |
||||
this.createInAllCheckBox.TabIndex = 4; |
||||
this.createInAllCheckBox.Text = "&Create this configuration in all projects"; |
||||
this.createInAllCheckBox.UseVisualStyleBackColor = true; |
||||
//
|
||||
// okButton
|
||||
//
|
||||
this.okButton.Enabled = false; |
||||
this.okButton.Location = new System.Drawing.Point(93, 127); |
||||
this.okButton.Name = "okButton"; |
||||
this.okButton.Size = new System.Drawing.Size(75, 23); |
||||
this.okButton.TabIndex = 5; |
||||
this.okButton.Text = "${res:Global.OKButtonText}"; |
||||
this.okButton.UseVisualStyleBackColor = true; |
||||
this.okButton.Click += new System.EventHandler(this.OkButtonClick); |
||||
//
|
||||
// cancelButton
|
||||
//
|
||||
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; |
||||
this.cancelButton.Location = new System.Drawing.Point(174, 127); |
||||
this.cancelButton.Name = "cancelButton"; |
||||
this.cancelButton.Size = new System.Drawing.Size(75, 23); |
||||
this.cancelButton.TabIndex = 6; |
||||
this.cancelButton.Text = "${res:Global.CancelButtonText}"; |
||||
this.cancelButton.UseVisualStyleBackColor = true; |
||||
//
|
||||
// AddNewConfigurationDialog
|
||||
//
|
||||
this.AcceptButton = this.okButton; |
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); |
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; |
||||
this.CancelButton = this.cancelButton; |
||||
this.ClientSize = new System.Drawing.Size(263, 162); |
||||
this.Controls.Add(this.cancelButton); |
||||
this.Controls.Add(this.okButton); |
||||
this.Controls.Add(this.createInAllCheckBox); |
||||
this.Controls.Add(this.copyFromComboBox); |
||||
this.Controls.Add(this.label2); |
||||
this.Controls.Add(this.nameTextBox); |
||||
this.Controls.Add(this.label1); |
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; |
||||
this.MaximizeBox = false; |
||||
this.MinimizeBox = false; |
||||
this.Name = "AddNewConfigurationDialog"; |
||||
this.ShowInTaskbar = false; |
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; |
||||
this.Text = "AddNewConfigurationDialog"; |
||||
this.ResumeLayout(false); |
||||
this.PerformLayout(); |
||||
} |
||||
private System.Windows.Forms.Button cancelButton; |
||||
private System.Windows.Forms.Button okButton; |
||||
private System.Windows.Forms.CheckBox createInAllCheckBox; |
||||
private System.Windows.Forms.ComboBox copyFromComboBox; |
||||
private System.Windows.Forms.Label label2; |
||||
private System.Windows.Forms.TextBox nameTextBox; |
||||
private System.Windows.Forms.Label label1; |
||||
} |
||||
} |
@ -0,0 +1,88 @@
@@ -0,0 +1,88 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Drawing; |
||||
using System.Windows.Forms; |
||||
using ICSharpCode.Core; |
||||
|
||||
namespace ICSharpCode.SharpDevelop.Gui |
||||
{ |
||||
/// <summary>
|
||||
/// Dialog for adding a new configuration or platform to a solution or project.
|
||||
/// </summary>
|
||||
public partial class AddNewConfigurationDialog |
||||
{ |
||||
Predicate<string> checkNameValid; |
||||
|
||||
public AddNewConfigurationDialog(bool solution, bool editPlatforms, |
||||
IEnumerable<string> availableSourceItems, |
||||
Predicate<string> checkNameValid) |
||||
{ |
||||
this.checkNameValid = checkNameValid; |
||||
|
||||
//
|
||||
// The InitializeComponent() call is required for Windows Forms designer support.
|
||||
//
|
||||
InitializeComponent(); |
||||
|
||||
foreach (Control ctl in this.Controls) { |
||||
ctl.Text = StringParser.Parse(ctl.Text); |
||||
} |
||||
|
||||
createInAllCheckBox.Visible = solution; |
||||
nameTextBox.TextChanged += delegate { |
||||
okButton.Enabled = nameTextBox.TextLength > 0; |
||||
}; |
||||
copyFromComboBox.Items.Add("<Empty>"); |
||||
copyFromComboBox.Items.AddRange(Linq.ToArray(availableSourceItems)); |
||||
copyFromComboBox.SelectedIndex = 0; |
||||
|
||||
if (solution) { |
||||
if (editPlatforms) |
||||
this.Text = "Add Solution Platform"; |
||||
else |
||||
this.Text = "Add Solution Configuration"; |
||||
} else { |
||||
if (editPlatforms) |
||||
this.Text = "Add Project Platform"; |
||||
else |
||||
this.Text = "Add Project Configuration"; |
||||
} |
||||
} |
||||
|
||||
public bool CreateInAllProjects { |
||||
get { |
||||
return createInAllCheckBox.Checked; |
||||
} |
||||
} |
||||
|
||||
public string CopyFrom { |
||||
get { |
||||
if (copyFromComboBox.SelectedIndex <= 0) |
||||
return null; |
||||
else |
||||
return copyFromComboBox.SelectedItem.ToString(); |
||||
} |
||||
} |
||||
|
||||
public string NewName { |
||||
get { |
||||
return nameTextBox.Text; |
||||
} |
||||
} |
||||
|
||||
void OkButtonClick(object sender, EventArgs e) |
||||
{ |
||||
if (checkNameValid(nameTextBox.Text)) { |
||||
this.DialogResult = DialogResult.OK; |
||||
Close(); |
||||
} |
||||
} |
||||
} |
||||
} |
Binary file not shown.
Loading…
Reference in new issue