Changeset 6827 for trunk/sources/HeuristicLab.MainForm.WindowsForms
- Timestamp:
- 09/25/11 21:02:58 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/MainForms/MainForm.cs
r5463 r6827 31 31 public partial class MainForm : Form, IMainForm { 32 32 private bool initialized; 33 private int appStartingCursors; 34 private int waitingCursors; 33 35 34 36 protected MainForm() … … 39 41 this.initialized = false; 40 42 this.showContentInViewHost = false; 43 appStartingCursors = 0; 44 waitingCursors = 0; 41 45 } 42 46 … … 447 451 } 448 452 #endregion 453 454 #region Cursor Handling 455 public void SetAppStartingCursor() { 456 if (InvokeRequired) 457 Invoke(new Action(SetAppStartingCursor)); 458 else { 459 appStartingCursors++; 460 SetCursor(); 461 } 462 } 463 public void ResetAppStartingCursor() { 464 if (InvokeRequired) 465 Invoke(new Action(ResetAppStartingCursor)); 466 else { 467 appStartingCursors--; 468 SetCursor(); 469 } 470 } 471 public void SetWaitCursor() { 472 if (InvokeRequired) 473 Invoke(new Action(SetWaitCursor)); 474 else { 475 waitingCursors++; 476 SetCursor(); 477 } 478 } 479 public void ResetWaitCursor() { 480 if (InvokeRequired) 481 Invoke(new Action(ResetWaitCursor)); 482 else { 483 waitingCursors--; 484 SetCursor(); 485 } 486 } 487 private void SetCursor() { 488 if (waitingCursors > 0) Cursor = Cursors.WaitCursor; 489 else if (appStartingCursors > 0) Cursor = Cursors.AppStarting; 490 else Cursor = Cursors.Default; 491 } 492 #endregion 449 493 } 450 494 }
Note: See TracChangeset
for help on using the changeset viewer.