Free cookie consent management tool by TermsFeed Policy Generator

Changeset 3460 for trunk/sources


Ignore:
Timestamp:
04/21/10 14:00:01 (15 years ago)
Author:
mkommend
Message:

corrected ReadOnly & Locked state in AntTrailView (ticket #952)

Location:
trunk/sources/HeuristicLab.Problems.ArtificialAnt.Views/3.3
Files:
2 edited

Legend:

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

    r3239 r3460  
    9090      this.Name = "AntTrailView";
    9191      this.Size = new System.Drawing.Size(392, 310);
    92       this.EnabledChanged += new System.EventHandler(this.AntTrailView_EnabledChanged);
    9392      ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).EndInit();
    9493      this.ResumeLayout(false);
  • trunk/sources/HeuristicLab.Problems.ArtificialAnt.Views/3.3/AntTrailView.cs

    r3454 r3460  
    6363        GenerateImage();
    6464      }
    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;
     65    }
     66
     67    protected override void OnLockedChanged() {
     68      this.playButton.Enabled = !Locked;
     69      base.OnLockedChanged();
    7670    }
    7771
    7872    private void GenerateImage() {
    79       playButton.Enabled = this.Enabled && !ReadOnly;
    8073      animationTimer.Stop();
    8174      if ((pictureBox.Width > 0) && (pictureBox.Height > 0)) {
     
    228221        } else {
    229222          animationTimer.Stop();
    230           playButton.Enabled = this.Enabled && !ReadOnly;
     223          playButton.Enabled = true;
    231224        }
    232225      }
    233226    }
    234227    #endregion
    235 
    236     private void AntTrailView_EnabledChanged(object sender, EventArgs e) {
    237       if (this.Enabled) playButton.Enabled = !ReadOnly;
    238       else playButton.Enabled = false;
    239     }
    240228  }
    241229}
Note: See TracChangeset for help on using the changeset viewer.