26 #include "ITouchEventReceiver.h" 27 #include "Decorator.h" 28 #include "IDialogClosedEventReceiver.h" 29 #include "Environment.h" 60 Window(
const __FlashStringHelper * name,
int left,
int top,
int width,
int height):
73 _touchEventReceiver=NULL;
78 _decorators=decorators;
88 if(_decorators == NULL)
89 _decorators=
new DecoratorList();
90 _decorators->Add(decorator);
92 Dialog *FindDialog(
const __FlashStringHelper *
id);
93 void RegisterDialog(
const __FlashStringHelper *
id,
Dialog *dlg);
94 IDialogClosedEventReceiver::DialogResults DoDialog(
Dialog *dlg);
104 _touchEventReceiver=touchEventReceiver;
109 return _touchEventReceiver!=NULL;
116 dc->SetColor(Color::Red);
124 if(_touchEventReceiver!=NULL)
136 while(parent->
Parent()!=NULL)
149 virtual void Move(
int left,
int top,
int width,
int height)
167 const __FlashStringHelper *Name()
196 window->SetParent(
this);
197 _children.Add(window);
207 _isVisible=isVisible;
215 while (retCode && crWnd->
Parent() != NULL)
235 if(_decorators!=NULL)
237 for(
int i=0;i<_decorators->Count();i++)
239 (*_decorators)[i]->Draw(dc,0,0,_width,_height);
268 void SetParent(
Window *window)
bool IsDirty()
Returns true if window has to be updated.
Definition: Window.h:162
void RegisterTouchEventReceiver(ITouchEventReceiver *touchEventReceiver)
Registers receiver for touch event.
Definition: Window.h:102
DecoratorList * GetDecorators()
Returns window decorators list.
Definition: Window.h:81
Base class for all window objects. Provides basic window functionality.
Definition: Window.h:34
virtual bool IsAwaitTouch()
Returns true if window await touch action (like button) or false if touch manager should ignore this ...
Definition: Window.h:107
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
DecoratorList * _decorators
contains list of drawig commands. If they are shared between more than one window -> SRAM usage optim...
Definition: Window.h:48
Window * RootWindow()
Returns pointer to root window. MainWindow does not have any parents.
Definition: Window.h:133
ITouchEventReceiver * _touchEventReceiver
call back event receiver for touch actions
Definition: Window.h:49
virtual bool OnTouch(int x, int y)
Touch manager calls this function right after touch is released.
Definition: Window.h:121
virtual void NotifyTouch(Window *window)=0
Has to be implemented in target class.
int _height
window height
Definition: Window.h:40
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 * _parent
pointer to parent window
Definition: Window.h:43
LinkedList< Window > _children
list of children windows. All children window are positioned relative to parent window ...
Definition: Window.h:42
void PrepareDC(DC *dc)
Setups window coordinate system. This function called by window manager right before window has to be...
Definition: Window.h:249
LinkedList< Window > & Children()
Returns list of children window.
Definition: Window.h:223
Base class for dialog objects. See Dialogs example Provides basic window functionality.
Definition: Dialog.h:25
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
Base class for window decorators. This concept allows sharing of drawing setting among more than one ...
Definition: Decorator.h:24
int _top
window top coordinate relative to the parent window
Definition: Window.h:38
Window(const __FlashStringHelper *name, int left, int top, int width, int height)
Constructor.
Definition: Window.h:60
void Offset(int offset_x, int offset_y)
Initializes drawing coordinate system offset.
Definition: DC.h:84
bool _isVisible
if this variable is false this window and all child windows are not visualized
Definition: Window.h:41
virtual void OnDraw(DC *dc)
If derived class needs to draw something in window client area, this function has to be ovverriden...
Definition: Window.h:263
bool IsVisible()
Returns true if window visible and false is hidden.
Definition: Window.h:211
void AddChild(Window *window)
Adds window child window.
Definition: Window.h:194
void Reset()
Resets device context into initial condition.
Definition: DC.h:72
void SetVisible(bool isVisible)
Sets window visibility status.
Definition: Window.h:205
void AddDecorator(Decorator *decorator)
Adds decorator to the decaorator list.
Definition: Window.h:86
int Top()
Returns window top coordinate relative to the parent window.
Definition: Window.h:179
virtual void SetDecorators(DecoratorList *decorators)
Sets window decorators list.
Definition: Window.h:76
int _width
window width
Definition: Window.h:39
bool _isDirty
if true than window manager will redraw this window.
Definition: Window.h:47
void DrawRoundRect(int left, int top, int right, int bottom)
Draws rounded rectangle. Input coordinates have to be defined in the window coordinate system...
Definition: DC.h:156
Interface that provides screen touch notifications. If you want receive this notification in the targ...
Definition: ITouchEventReceiver.h:24
virtual void OnTouching(DC *dc)
Touch manager calls this function in the loop as long as touch action proceeds.
Definition: Window.h:112
int Width()
Returns window width.
Definition: Window.h:184
int _left
window left coordinate relative to the parent window
Definition: Window.h:37