24 #include "MainWindow.h" 25 #include "ICriticalProcess.h" 48 _mainWindow->Invalidate();
49 _mainWindow->SetLoopProcess(
this);
55 if(MainWnd()->ModalWnd()!=NULL)
56 return HitTest(MainWnd()->ModalWnd(),x,y);
67 for(
int i=0;i<window->
Children().Count();i++)
80 for (
int i = 0;i < MainWnd()->Timers().Count();i++)
81 MainWnd()->Timers()[i]->loop();
82 if(MainWnd()->ModalWnd() == NULL)
84 if(MainWnd()->ModalWnd() != NULL)
85 redraw(MainWnd()->ModalWnd(),MainWnd()->ModalWnd()->IsDirty());
107 if(window == MainWnd()->ModalWnd() && window->
IsDirty() && isForceRedraw ==
false)
109 bool needRedraw=isForceRedraw || window->
IsDirty();
112 for(
int i=0;i<window->
Children().Count();i++)
124 if (_touch->dataAvailable())
127 int x=_touch->getX();
128 int y=_touch->getY();
141 crWindow=crWindow->
Parent();
152 while (_touch->dataAvailable())
158 Window *crWindow=touchWnd;
161 crWindow=crWindow->
Parent();
bool IsDirty()
Returns true if window has to be updated.
Definition: Window.h:162
Base class for all window objects. Provides basic window functionality.
Definition: Window.h:34
Window * HitTest(int x, int y)
Returns topmost window that lais under x,y screen coordinate.
Definition: WindowsManager.h:53
virtual bool IsAwaitTouch()
Returns true if window await touch action (like button) or false if touch manager should ignore this ...
Definition: Window.h:107
void Initialize()
Initialization procedure. Has to be call once.
Definition: WindowsManager.h:45
int Left()
Returns window left coordinate relative to the parent window.
Definition: Window.h:174
void Redraw(DC *dc)
Performs full window redraw.
Definition: Window.h:231
Window * Parent()
Returns Parent window.
Definition: Window.h:200
WindowsManager(UTFT *lcd, UTouch *touch=NULL)
Constructor.
Definition: WindowsManager.h:40
static Environment * Get()
Returns singltone instance of environment.
Definition: Environment.h:44
DC * GetDC()
Returns device context (interface class to UTFT library)
Definition: WindowsManager.h:92
LinkedList< Window > & Children()
Returns list of children window.
Definition: Window.h:223
Device context. Abstraction layer to the device specific drawing code. Coordinates in drawing functio...
Definition: DC.h:29
int Height()
Returns window height.
Definition: Window.h:189
void Invalidate()
If function is called than the window manager updates the window.
Definition: Window.h:157
Definition: MainWindow.h:25
void redraw(Window *window, bool isForceRedraw)
Internal draw code.
Definition: WindowsManager.h:104
int DeviceWidth()
Returns screen width.
Definition: DC.h:62
bool IsVisible()
Returns true if window visible and false is hidden.
Definition: Window.h:211
void Idle()
If nothing happens, the touch event is checked.
Definition: WindowsManager.h:97
int Top()
Returns window top coordinate relative to the parent window.
Definition: Window.h:179
Window * HitTest(Window *window, int x, int y)
For defined window return topmost child window that lais under x,y screen coordinate.
Definition: WindowsManager.h:61
Main window manager. Implement core funcctionality of AWind library. It is tempate class that has to ...
Definition: WindowsManager.h:29
void loop()
Main loop where drawing code only for "dirty" window is called.
Definition: WindowsManager.h:78
virtual void OnTouching(DC *dc)
Touch manager calls this function in the loop as long as touch action proceeds.
Definition: Window.h:112
int DeviceHeight()
Returns screen height.
Definition: DC.h:67
void loopTouch()
Checks touch event.
Definition: WindowsManager.h:121
int Width()
Returns window width.
Definition: Window.h:184