Free cookie consent management tool by TermsFeed Policy Generator

Changeset 569


Ignore:
Timestamp:
09/14/08 16:52:55 (16 years ago)
Author:
gkronber
Message:

fixed a bug in multiple selection #270

Location:
trunk/sources/HeuristicLab.CEDMA.Charting
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.CEDMA.Charting/BubbleChart.cs

    r567 r569  
    230230        double maxX = Math.Max(a.X, b.X);
    231231        double maxY = Math.Max(a.Y, b.Y);
    232         HeuristicLab.Charting.Rectangle r = new HeuristicLab.Charting.Rectangle(this, minX, minY, maxX, maxY);
     232        HeuristicLab.Charting.Rectangle rect = new HeuristicLab.Charting.Rectangle(this, minX, minY, maxX, maxY);
    233233
    234234        List<IPrimitive> primitives = new List<IPrimitive>();
     
    236236
    237237        foreach(FixedSizeCircle p in primitives) {
    238           if(r.ContainsPoint(p.Point)) {
    239             primitiveToRecordDictionary[p].ToggleSelected();
     238          if(rect.ContainsPoint(p.Point)) {
     239            Record r;
     240            primitiveToRecordDictionary.TryGetValue(p, out r);
     241            if(r != null) r.ToggleSelected();
    240242          }
    241243        }
     244        results.FireChanged();
    242245      } else {
    243246        base.MouseDrag(start, end, button);
    244247      }
    245248    }
     249
     250    public override void MouseClick(Point point, MouseButtons button) {
     251      if(button == MouseButtons.Left) {
     252        Record r = GetRecord(point);
     253        if(r != null) r.ToggleSelected();
     254        results.FireChanged();
     255      } else {
     256        base.MouseClick(point, button);
     257      }
     258    }
     259
     260    public override void MouseDoubleClick(Point point, MouseButtons button) {
     261      if(button == MouseButtons.Left) {
     262        Record r = GetRecord(point);
     263        if(r != null) r.OpenModel();
     264      } else {
     265        base.MouseDoubleClick(point, button);
     266      }
     267    }
    246268  }
    247269}
  • trunk/sources/HeuristicLab.CEDMA.Charting/BubbleChartControl.cs

    r567 r569  
    3535    private bool renderingRequired;
    3636    private Point mousePosition;
    37     private Record clickedRecord;
    3837    private Point buttonDownPoint;
    3938
     
    8281
    8382    private void pictureBox_MouseDown(object sender, MouseEventArgs e) {
    84       clickedRecord = null;
    8583      buttonDownPoint = e.Location;
    86       if(e.Button == MouseButtons.Left || e.Button == MouseButtons.Right) {
    87         clickedRecord = Chart.GetRecord(buttonDownPoint);
    88       }
    8984    }
    9085    private void pictureBox_MouseUp(object sender, MouseEventArgs e) {
     
    176171
    177172    private void pictureBox_MouseClick(object sender, MouseEventArgs e) {
    178       if(clickedRecord != null) clickedRecord.ToggleSelected();
     173      Chart.MouseClick(e.Location, e.Button);
    179174    }
    180175
    181176    private void pictureBox_MouseDoubleClick(object sender, MouseEventArgs e) {
    182       if(clickedRecord != null) clickedRecord.OpenModel();
     177      Chart.MouseDoubleClick(e.Location, e.Button);
    183178    }
    184179  }
  • trunk/sources/HeuristicLab.CEDMA.Charting/Record.cs

    r567 r569  
    9494    public void ToggleSelected() {
    9595      selected = !selected;
    96       if(OnSelectionChanged != null) OnSelectionChanged(this, new EventArgs());
    97       resultList.FireChanged();
     96      if(OnSelectionChanged != null) OnSelectionChanged(this, new EventArgs());     
    9897    }
    9998
Note: See TracChangeset for help on using the changeset viewer.