Changeset 3365
- Timestamp:
- 04/16/10 03:40:45 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Parameters.Views/3.3
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Parameters.Views/3.3/ConstrainedValueParameterView.cs
r3191 r3365 94 94 Caption = "ConstrainedValueParameter"; 95 95 viewHost.Content = null; 96 valueGroupBox.Enabled = false;97 96 FillValueComboBox(); 98 97 } else { 99 98 Caption = Content.Name + " (" + Content.GetType().Name + ")"; 100 valueGroupBox.Enabled = true;101 99 FillValueComboBox(); 102 100 viewHost.ViewType = null; 103 101 viewHost.Content = Content.Value; 104 102 } 103 SetEnabledStateOfControls(); 104 } 105 106 protected override void OnReadOnlyChanged() { 107 base.OnReadOnlyChanged(); 108 SetEnabledStateOfControls(); 109 } 110 111 private void SetEnabledStateOfControls() { 112 valueGroupBox.Enabled = Content != null; 113 valueComboBox.Enabled = (valueComboBox.Items.Count > 0) && !ReadOnly; 114 viewHost.ReadOnly = ReadOnly; 105 115 } 106 116 … … 118 128 valueComboBox.Items.Add(item.ToString()); 119 129 } 120 valueComboBox.Enabled = valueComboBox.Items.Count > 0;130 valueComboBox.Enabled = (valueComboBox.Items.Count > 0) && !ReadOnly; 121 131 valueComboBox.SelectedIndex = valueComboBoxItems.IndexOf(Content.Value); 122 132 } -
trunk/sources/HeuristicLab.Parameters.Views/3.3/LookupParameterView.cs
r2917 r3365 83 83 Caption = "LookupParameter"; 84 84 actualNameTextBox.Text = "-"; 85 actualNameTextBox.Enabled = false;86 85 } else { 87 86 Caption = Content.Name + " (" + Content.GetType().Name + ")"; 88 87 actualNameTextBox.Text = Content.ActualName; 89 actualNameTextBox.Enabled = true;90 88 } 89 SetEnabledStateOfControls(); 90 } 91 92 protected override void OnReadOnlyChanged() { 93 base.OnReadOnlyChanged(); 94 SetEnabledStateOfControls(); 95 } 96 97 private void SetEnabledStateOfControls() { 98 actualNameTextBox.Enabled = Content != null; 99 actualNameTextBox.ReadOnly = ReadOnly; 91 100 } 92 101 -
trunk/sources/HeuristicLab.Parameters.Views/3.3/ParameterView.cs
r2917 r3365 65 65 Caption = "Parameter"; 66 66 dataTypeTextBox.Text = "-"; 67 dataTypeTextBox.Enabled = false;68 67 } else { 69 68 Caption = Content.Name + " (" + Content.GetType().Name + ")"; 70 69 dataTypeTextBox.Text = Content.DataType.GetPrettyName(); 71 dataTypeTextBox.Enabled = true;72 70 } 71 SetEnabledStateOfControls(); 72 } 73 74 protected override void OnReadOnlyChanged() { 75 base.OnReadOnlyChanged(); 76 SetEnabledStateOfControls(); 77 } 78 79 private void SetEnabledStateOfControls() { 80 dataTypeTextBox.Enabled = Content != null; 73 81 } 74 82 } -
trunk/sources/HeuristicLab.Parameters.Views/3.3/ValueLookupParameterView.cs
r2949 r3365 88 88 Caption = "ValueLookupParameter"; 89 89 actualNameTextBox.Text = "-"; 90 actualNameTextBox.Enabled = false;91 setValueButton.Enabled = false;92 clearValueButton.Enabled = false;93 valueGroupBox.Enabled = false;94 90 viewHost.Content = null; 95 91 } else { 96 92 Caption = Content.Name + " (" + Content.GetType().Name + ")"; 97 93 actualNameTextBox.Text = Content.ActualName; 98 actualNameTextBox.Enabled = true;99 setValueButton.Enabled = true;100 clearValueButton.Enabled = Content.Value != null;101 valueGroupBox.Enabled = true;102 94 viewHost.ViewType = null; 103 95 viewHost.Content = Content.Value; 104 96 } 97 SetEnabledStateOfControls(); 98 } 99 100 protected override void OnReadOnlyChanged() { 101 base.OnReadOnlyChanged(); 102 SetEnabledStateOfControls(); 103 } 104 105 private void SetEnabledStateOfControls() { 106 actualNameTextBox.Enabled = Content != null; 107 actualNameTextBox.ReadOnly = ReadOnly; 108 setValueButton.Enabled = Content != null && !ReadOnly; 109 clearValueButton.Enabled = Content != null && Content.Value != null && !ReadOnly; 110 valueGroupBox.Enabled = Content != null; 111 viewHost.ReadOnly = ReadOnly; 105 112 } 106 113 … … 115 122 Invoke(new EventHandler(Content_ValueChanged), sender, e); 116 123 else { 117 clearValueButton.Enabled = Content.Value != null ;124 clearValueButton.Enabled = Content.Value != null && !ReadOnly; 118 125 viewHost.ViewType = null; 119 126 viewHost.Content = Content.Value; … … 139 146 e.Effect = DragDropEffects.None; 140 147 Type type = e.Data.GetData("Type") as Type; 141 if ( (type != null) && (Content.DataType.IsAssignableFrom(type))) {148 if (!ReadOnly && (type != null) && (Content.DataType.IsAssignableFrom(type))) { 142 149 if ((e.KeyState & 8) == 8) e.Effect = DragDropEffects.Copy; // CTRL key 143 150 else if ((e.KeyState & 4) == 4) e.Effect = DragDropEffects.Move; // SHIFT key -
trunk/sources/HeuristicLab.Parameters.Views/3.3/ValueParameterView.cs
r2949 r3365 86 86 if (Content == null) { 87 87 Caption = "ValueParameter"; 88 setValueButton.Enabled = false;89 88 clearValueButton.Visible = true; 90 clearValueButton.Enabled = false;91 89 viewHost.Content = null; 92 valueGroupBox.Enabled = false;93 90 } else { 94 91 Caption = Content.Name + " (" + Content.GetType().Name + ")"; 95 setValueButton.Enabled = true;96 92 clearValueButton.Visible = !(Content is ValueParameter<T>); 97 clearValueButton.Enabled = Content.Value != null;98 valueGroupBox.Enabled = true;99 93 viewHost.ViewType = null; 100 94 viewHost.Content = Content.Value; 101 95 } 96 SetEnabledStateOfControls(); 97 } 98 99 protected override void OnReadOnlyChanged() { 100 base.OnReadOnlyChanged(); 101 SetEnabledStateOfControls(); 102 } 103 104 private void SetEnabledStateOfControls() { 105 setValueButton.Enabled = Content != null && !ReadOnly; 106 clearValueButton.Enabled = Content != null && Content.Value != null && !ReadOnly; 107 valueGroupBox.Enabled = Content != null; 108 viewHost.ReadOnly = ReadOnly; 102 109 } 103 110 … … 106 113 Invoke(new EventHandler(Content_ValueChanged), sender, e); 107 114 else { 108 clearValueButton.Enabled = Content.Value != null ;115 clearValueButton.Enabled = Content.Value != null && !ReadOnly; 109 116 viewHost.ViewType = null; 110 117 viewHost.Content = Content.Value; … … 127 134 e.Effect = DragDropEffects.None; 128 135 Type type = e.Data.GetData("Type") as Type; 129 if ( (type != null) && (Content.DataType.IsAssignableFrom(type))) {136 if (!ReadOnly && (type != null) && (Content.DataType.IsAssignableFrom(type))) { 130 137 if ((e.KeyState & 8) == 8) e.Effect = DragDropEffects.Copy; // CTRL key 131 138 else if ((e.KeyState & 4) == 4) e.Effect = DragDropEffects.Move; // SHIFT key
Note: See TracChangeset
for help on using the changeset viewer.