24 #include "ICriticalProcess.h" 28 virtual void loop()=0;
33 const __FlashStringHelper *ID;
42 LinkedList<DialogEntry> _dialogs;
43 LinkedList<ATimer> _timers;
44 DialogResults _lastDialogResults;
45 bool _isModalDialogActive;
52 MainWindow(
int width,
int height):
Window(F(
"Main"),0,0,width,height),_isModalDialogActive(false)
63 dlgEntry->DlgWindow=widnow;
64 _dialogs.Add(dlgEntry);
71 for(
int i=0;i<_dialogs.Count();i++)
74 if(AHelper::compare_F(
id, _dialogs[i]->ID))
75 return _dialogs[i]->DlgWindow;
84 _isModalDialogActive=
true;
85 Window *lastModalWindow=ModalWnd();
90 while(_isModalDialogActive)
95 _isModalDialogActive=lastModalWindow!=NULL?
true:
false;
96 SetModalWindow(lastModalWindow);
98 if(lastModalWindow!=NULL)
101 _idleProcess->loop();
104 return _lastDialogResults;
106 void RegisterTimer(
ATimer *timer)
110 LinkedList<ATimer> &Timers()
116 _idleProcess=process;
122 _isModalDialogActive=
false;
123 _lastDialogResults=results;
133 _modalWindow=modalWindow;
136 void Move(
int left,
int top,
int width,
int height)
Definition: MainWindow.h:30
void SetModalWindow(Window *modalWindow)
Sets active modal (window that received all user input, like dialog window) window.
Definition: MainWindow.h:131
Base class for all window objects. Provides basic window functionality.
Definition: Window.h:34
void RegisterEndDialogEventReceiver(IDialogClosedEventReceiver *receiver)
Registers extern interface that will be called if dialog is closed.
Definition: Dialog.h:70
void NotifyDialogClosed(Window *window, DialogResults results)
Process dialog closed notification.
Definition: MainWindow.h:119
Text box for numbers.
Definition: TextBoxNumber.h:24
virtual void Move(int left, int top, int width, int height)
Moves and resizes window relativly to the parent window.
Definition: Window.h:149
Window * ModalWnd()
Returns pointer to active modal (window that received all user input, like dialog window) window...
Definition: MainWindow.h:126
void Move(int left, int top, int width, int height)
Changes position and size.
Definition: MainWindow.h:136
Base class for dialog objects. See Dialogs example Provides basic window functionality.
Definition: Dialog.h:25
DialogResults ProcessDoDialog(Window *dlg)
Starts dialog.
Definition: MainWindow.h:81
void Invalidate()
If function is called than the window manager updates the window.
Definition: Window.h:157
Definition: MainWindow.h:25
Dialog * FindDialog(const __FlashStringHelper *id)
Finds registered dialog by the name.
Definition: MainWindow.h:69
void SetVisible(bool isVisible)
Sets window visibility status.
Definition: Window.h:205
MainWindow(int width, int height)
Constructor.
Definition: MainWindow.h:52
Interface that provides dialog closed notifications (user closes dialog window, by pressing OK or can...
Definition: IDialogClosedEventReceiver.h:24
Base class for main application window. Each application has to have one main window, which is root parent for all other application windows.
Definition: MainWindow.h:38
void RegisterDialog(const __FlashStringHelper *id, Dialog *widnow)
Registers dialog window. All application dialogs have to be registered.
Definition: MainWindow.h:57