- Timestamp:
- 04/16/10 03:40:45 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.