Changeset 569 for trunk/sources/HeuristicLab.CEDMA.Charting
- Timestamp:
- 09/14/08 16:52:55 (16 years ago)
- Location:
- trunk/sources/HeuristicLab.CEDMA.Charting
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.CEDMA.Charting/BubbleChart.cs
r567 r569 230 230 double maxX = Math.Max(a.X, b.X); 231 231 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); 233 233 234 234 List<IPrimitive> primitives = new List<IPrimitive>(); … … 236 236 237 237 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(); 240 242 } 241 243 } 244 results.FireChanged(); 242 245 } else { 243 246 base.MouseDrag(start, end, button); 244 247 } 245 248 } 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 } 246 268 } 247 269 } -
trunk/sources/HeuristicLab.CEDMA.Charting/BubbleChartControl.cs
r567 r569 35 35 private bool renderingRequired; 36 36 private Point mousePosition; 37 private Record clickedRecord;38 37 private Point buttonDownPoint; 39 38 … … 82 81 83 82 private void pictureBox_MouseDown(object sender, MouseEventArgs e) { 84 clickedRecord = null;85 83 buttonDownPoint = e.Location; 86 if(e.Button == MouseButtons.Left || e.Button == MouseButtons.Right) {87 clickedRecord = Chart.GetRecord(buttonDownPoint);88 }89 84 } 90 85 private void pictureBox_MouseUp(object sender, MouseEventArgs e) { … … 176 171 177 172 private void pictureBox_MouseClick(object sender, MouseEventArgs e) { 178 if(clickedRecord != null) clickedRecord.ToggleSelected();173 Chart.MouseClick(e.Location, e.Button); 179 174 } 180 175 181 176 private void pictureBox_MouseDoubleClick(object sender, MouseEventArgs e) { 182 if(clickedRecord != null) clickedRecord.OpenModel();177 Chart.MouseDoubleClick(e.Location, e.Button); 183 178 } 184 179 } -
trunk/sources/HeuristicLab.CEDMA.Charting/Record.cs
r567 r569 94 94 public void ToggleSelected() { 95 95 selected = !selected; 96 if(OnSelectionChanged != null) OnSelectionChanged(this, new EventArgs()); 97 resultList.FireChanged(); 96 if(OnSelectionChanged != null) OnSelectionChanged(this, new EventArgs()); 98 97 } 99 98
Note: See TracChangeset
for help on using the changeset viewer.