Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/05/15 13:07:08 (9 years ago)
Author:
jkarder
Message:

#1265: worked on visualization

  • added default chart mode
  • updated SelectChartMode
Location:
branches/HeuristicLab.Visualization/HeuristicLab.Visualization/3.3
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Visualization/HeuristicLab.Visualization/3.3/ChartControl.cs

    r13115 r13122  
    5555
    5656    private ChartMode mode;
     57    private ChartMode defaultMode;
    5758    public ChartMode Mode {
    5859      get { return mode; }
     
    6061        if (mode == value) return;
    6162        mode = value;
     63        if (defaultMode == null) defaultMode = mode;
     64        if (mode == null) mode = defaultMode;
    6265        SetModeButtonCheckedState();
    6366        SetModeMenuItemCheckedState();
  • branches/HeuristicLab.Visualization/HeuristicLab.Visualization/3.3/ChartMode.cs

    r13115 r13122  
    4545    }
    4646
    47     public virtual void HandleOnKeyDown(object sender, KeyEventArgs e) { }
     47    public void Select() { chartControl.Mode = this; }
     48    public void Deselect() { chartControl.Mode = null; }
     49
     50    public virtual void HandleOnKeyDown(object sender, KeyEventArgs e) {
     51      switch (e.KeyCode) {
     52        case Keys.Escape:
     53          Deselect();
     54          break;
     55      }
     56    }
     57
    4858    public virtual void HandleOnKeyUp(object sender, KeyEventArgs e) { }
    4959    public virtual void HandleOnMouseClick(object sender, MouseEventArgs e) { }
    5060    public virtual void HandleOnMouseDoubleClick(object sender, MouseEventArgs e) { }
    51     public virtual void HandleOnMouseWheel(object sender, MouseEventArgs e) { }
    5261
    5362    public virtual void HandleOnMouseDown(object sender, MouseEventArgs e) {
     
    6271    }
    6372
     73    public virtual void HandleOnMouseWheel(object sender, MouseEventArgs e) { }
    6474    public virtual void HandleOnMouseEnter(object sender, EventArgs e) { }
    6575    public virtual void HandleOnMouseLeave(object sender, EventArgs e) { }
  • branches/HeuristicLab.Visualization/HeuristicLab.Visualization/3.3/ChartModes/SelectChartMode.cs

    r13115 r13122  
    3737        switch (e.KeyCode) {
    3838          case Keys.Delete:
    39             if (e.KeyCode == Keys.Delete) {
    40               try {
    41                 chartControl.SuspendRendering();
    42                 foreach (var primitive in chartControl.Chart.Group.SelectedPrimitives)
    43                   chartControl.Chart.Group.Remove(primitive);
    44               } finally { chartControl.ResumeRendering(); }
    45             }
     39            try {
     40              chartControl.SuspendRendering();
     41              foreach (var primitive in chartControl.Chart.Group.SelectedPrimitives)
     42                chartControl.Chart.Group.Remove(primitive);
     43            } finally { chartControl.ResumeRendering(); }
     44
    4645            break;
    4746        }
Note: See TracChangeset for help on using the changeset viewer.