Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/25/10 03:32:18 (14 years ago)
Author:
swagner
Message:

Worked on OKB (#1174)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/OKB/HeuristicLab.Clients.OKB-3.3/Views/DataTypeView.cs

    r4466 r4492  
    2121
    2222using System;
     23using System.Linq;
    2324using System.Windows.Forms;
    24 using System.Linq;
    25 using HeuristicLab.Core.Views;
    2625using HeuristicLab.MainForm;
    2726using HeuristicLab.MainForm.WindowsForms;
     
    4948      if (Content == null) {
    5049        nameTextBox.Text = string.Empty;
    51         sqlNameTextBox.Text = string.Empty;
     50        sqlNameComboBox.SelectedIndex = -1;
    5251        platformComboBox.SelectedIndex = -1;
    5352        if (ViewAttribute.HasViewAttribute(this.GetType()))
     
    5756      } else {
    5857        nameTextBox.Text = Content.Name;
    59         sqlNameTextBox.Text = Content.SqlName;
     58        sqlNameComboBox.Text = Content.SqlName;
    6059        platformComboBox.SelectedItem = Administrator.Instance.Platforms.FirstOrDefault(p => p.Id == Content.PlatformId);
    6160        Caption = Content.Name;
     
    6564    protected override void SetEnabledStateOfControls() {
    6665      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;
    7870    }
    7971
     
    8577          break;
    8678        case "SqlName":
    87           sqlNameTextBox.Text = Content.SqlName;
     79          sqlNameComboBox.Text = Content.SqlName;
    8880          break;
    8981        case "PlatformId":
     
    10597        Content.Name = nameTextBox.Text;
    10698    }
    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;
    113102      }
    114     }
    115     private void sqlNameTextBox_TextChanged(object sender, EventArgs e) {
    116       if (sqlNameTextBox.Text != Content.SqlName)
    117         Content.SqlName = sqlNameTextBox.Text;
    118103    }
    119104    private void platformComboBox_SelectedValueChanged(object sender, System.EventArgs e) {
Note: See TracChangeset for help on using the changeset viewer.