- Timestamp:
- 09/25/10 03:32:18 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OKB/HeuristicLab.Clients.OKB-3.3/Views/DataTypeView.cs
r4466 r4492 21 21 22 22 using System; 23 using System.Linq; 23 24 using System.Windows.Forms; 24 using System.Linq;25 using HeuristicLab.Core.Views;26 25 using HeuristicLab.MainForm; 27 26 using HeuristicLab.MainForm.WindowsForms; … … 49 48 if (Content == null) { 50 49 nameTextBox.Text = string.Empty; 51 sqlName TextBox.Text = string.Empty;50 sqlNameComboBox.SelectedIndex = -1; 52 51 platformComboBox.SelectedIndex = -1; 53 52 if (ViewAttribute.HasViewAttribute(this.GetType())) … … 57 56 } else { 58 57 nameTextBox.Text = Content.Name; 59 sqlName TextBox.Text = Content.SqlName;58 sqlNameComboBox.Text = Content.SqlName; 60 59 platformComboBox.SelectedItem = Administrator.Instance.Platforms.FirstOrDefault(p => p.Id == Content.PlatformId); 61 60 Caption = Content.Name; … … 65 64 protected override void SetEnabledStateOfControls() { 66 65 base.SetEnabledStateOfControls(); 67 if (Content == null) { 68 nameTextBox.Enabled = false; 69 sqlNameTextBox.Enabled = false; 70 platformComboBox.Enabled = false; 71 } else { 72 nameTextBox.Enabled = true; 73 nameTextBox.ReadOnly = ReadOnly; 74 sqlNameTextBox.Enabled = true; 75 sqlNameTextBox.ReadOnly = ReadOnly; 76 platformComboBox.Enabled = true; 77 } 66 nameTextBox.Enabled = Content != null; 67 nameTextBox.ReadOnly = ReadOnly; 68 sqlNameComboBox.Enabled = (Content != null) && !ReadOnly; 69 platformComboBox.Enabled = (Content != null) && !ReadOnly; 78 70 } 79 71 … … 85 77 break; 86 78 case "SqlName": 87 sqlName TextBox.Text = Content.SqlName;79 sqlNameComboBox.Text = Content.SqlName; 88 80 break; 89 81 case "PlatformId": … … 105 97 Content.Name = nameTextBox.Text; 106 98 } 107 private void sqlNameTextBox_KeyDown(object sender, KeyEventArgs e) { 108 if ((e.KeyCode == Keys.Enter) || (e.KeyCode == Keys.Return)) 109 sqlNameLabel.Focus(); // set focus on label to validate data 110 if (e.KeyCode == Keys.Escape) { 111 sqlNameTextBox.Text = Content.SqlName; 112 sqlNameLabel.Focus(); // set focus on label to validate data 99 private void sqlNameComboBox_SelectedValueChanged(object sender, EventArgs e) { 100 if (sqlNameComboBox.Text != Content.SqlName) { 101 Content.SqlName = sqlNameComboBox.Text; 113 102 } 114 }115 private void sqlNameTextBox_TextChanged(object sender, EventArgs e) {116 if (sqlNameTextBox.Text != Content.SqlName)117 Content.SqlName = sqlNameTextBox.Text;118 103 } 119 104 private void platformComboBox_SelectedValueChanged(object sender, System.EventArgs e) {
Note: See TracChangeset
for help on using the changeset viewer.