Changeset 1059 for trunk/sources/HeuristicLab.Visualization
- Timestamp:
- 12/23/08 16:18:41 (16 years ago)
- Location:
- trunk/sources/HeuristicLab.Visualization
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Visualization/LineChart.Designer.cs
r1058 r1059 45 45 this.canvas.MouseDown += new System.Windows.Forms.MouseEventHandler(this.canvasUI1_MouseDown); 46 46 this.canvas.MouseWheel += new System.Windows.Forms.MouseEventHandler(this.canvasUI1_MouseWheel); 47 this.canvas.KeyDown += new System.Windows.Forms.KeyEventHandler(this.canvasUI1_KeyDown); 47 48 // 48 49 // LineChart -
trunk/sources/HeuristicLab.Visualization/LineChart.cs
r1058 r1059 161 161 162 162 SetLineClippingArea(newClippingArea); 163 historyStack.Push(newClippingArea); 163 164 } 164 165 … … 273 274 #endregion 274 275 276 #region Zooming / Panning 277 278 private readonly Stack<RectangleD> historyStack = new Stack<RectangleD>(); 275 279 private RectangleShape rectangleShape; 280 281 private void canvasUI1_KeyDown(object sender, KeyEventArgs e) { 282 if(e.KeyCode == Keys.Back && historyStack.Count > 1) { 283 historyStack.Pop(); 284 285 RectangleD clippingArea = historyStack.Peek(); 286 287 SetNewClippingArea(clippingArea); 288 canvas.Invalidate(); 289 } 290 } 276 291 277 292 private void canvasUI1_MouseDown(object sender, MouseEventArgs e) { … … 312 327 canvas.MouseEventListener = null; 313 328 314 SetLineClippingArea(rectangleShape.Rectangle); 329 RectangleD clippingArea = rectangleShape.Rectangle; 330 331 SetLineClippingArea(clippingArea); 332 historyStack.Push(clippingArea); 333 315 334 linesShape.RemoveShape(rectangleShape); 316 335 … … 329 348 330 349 panListener.SetNewClippingArea += SetNewClippingArea; 331 panListener.OnMouseUp += delegate { canvas.MouseEventListener = null; }; 350 panListener.OnMouseUp += delegate { 351 historyStack.Push(linesShape.ClippingArea); 352 canvas.MouseEventListener = null; 353 }; 332 354 333 355 canvas.MouseEventListener = panListener; … … 340 362 canvas.Invalidate(); 341 363 } 364 365 #endregion 342 366 } 343 367 }
Note: See TracChangeset
for help on using the changeset viewer.