Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/21/10 06:14:03 (14 years ago)
Author:
swagner
Message:

Adapted views according the new read-only property (#973)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.ArtificialAnt.Views/3.3/AntTrailView.cs

    r3239 r3454  
    6060      if (Content == null) {
    6161        pictureBox.Image = null;
    62         pictureBox.Enabled = false;
    6362      } else {
    64         pictureBox.Enabled = true;
    6563        GenerateImage();
    6664      }
     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;
    6776    }
    6877
    6978    private void GenerateImage() {
    70       playButton.Enabled = this.Enabled;
     79      playButton.Enabled = this.Enabled && !ReadOnly;
    7180      animationTimer.Stop();
    7281      if ((pictureBox.Width > 0) && (pictureBox.Height > 0)) {
     
    219228        } else {
    220229          animationTimer.Stop();
    221           playButton.Enabled = this.Enabled;
     230          playButton.Enabled = this.Enabled && !ReadOnly;
    222231        }
    223232      }
     
    226235
    227236    private void AntTrailView_EnabledChanged(object sender, EventArgs e) {
    228       if (this.Enabled) playButton.Enabled = true;
     237      if (this.Enabled) playButton.Enabled = !ReadOnly;
    229238      else playButton.Enabled = false;
    230239    }
Note: See TracChangeset for help on using the changeset viewer.