- Timestamp:
- 04/21/10 06:14:03 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.ArtificialAnt.Views/3.3/AntTrailView.cs
r3239 r3454 60 60 if (Content == null) { 61 61 pictureBox.Image = null; 62 pictureBox.Enabled = false;63 62 } else { 64 pictureBox.Enabled = true;65 63 GenerateImage(); 66 64 } 65 SetEnabledStateOfControls(); 66 } 67 68 protected override void OnReadOnlyChanged() { 69 base.OnReadOnlyChanged(); 70 SetEnabledStateOfControls(); 71 } 72 73 private void SetEnabledStateOfControls() { 74 pictureBox.Enabled = Content != null; 75 playButton.Enabled = Content != null && !ReadOnly; 67 76 } 68 77 69 78 private void GenerateImage() { 70 playButton.Enabled = this.Enabled ;79 playButton.Enabled = this.Enabled && !ReadOnly; 71 80 animationTimer.Stop(); 72 81 if ((pictureBox.Width > 0) && (pictureBox.Height > 0)) { … … 219 228 } else { 220 229 animationTimer.Stop(); 221 playButton.Enabled = this.Enabled ;230 playButton.Enabled = this.Enabled && !ReadOnly; 222 231 } 223 232 } … … 226 235 227 236 private void AntTrailView_EnabledChanged(object sender, EventArgs e) { 228 if (this.Enabled) playButton.Enabled = true;237 if (this.Enabled) playButton.Enabled = !ReadOnly; 229 238 else playButton.Enabled = false; 230 239 }
Note: See TracChangeset
for help on using the changeset viewer.