AWind
Window Class Reference

Base class for all window objects. Provides basic window functionality. More...

#include <Window.h>

Inheritance diagram for Window:
ButtonWindow ChartWindow Dialog Gauge MainWindow SensorWindow TabControl TabManual TabTemperature TabVacuum TextBox Window1 Window1 Window2 Window2 Window3 Window3

Public Member Functions

 Window (const __FlashStringHelper *name, int left, int top, int width, int height)
 Constructor. More...
 
virtual void SetDecorators (DecoratorList *decorators)
 Sets window decorators list.
 
DecoratorList * GetDecorators ()
 Returns window decorators list.
 
void AddDecorator (Decorator *decorator)
 Adds decorator to the decaorator list.
 
DialogFindDialog (const __FlashStringHelper *id)
 
void RegisterDialog (const __FlashStringHelper *id, Dialog *dlg)
 
IDialogClosedEventReceiver::DialogResults DoDialog (Dialog *dlg)
 
void RegisterTouchEventReceiver (ITouchEventReceiver *touchEventReceiver)
 Registers receiver for touch event. More...
 
virtual bool IsAwaitTouch ()
 Returns true if window await touch action (like button) or false if touch manager should ignore this window during processing of touch events.
 
virtual void OnTouching (DC *dc)
 Touch manager calls this function in the loop as long as touch action proceeds.
 
virtual bool OnTouch (int x, int y)
 Touch manager calls this function right after touch is released.
 
WindowRootWindow ()
 Returns pointer to root window. MainWindow does not have any parents.
 
virtual void Move (int left, int top, int width, int height)
 Moves and resizes window relativly to the parent window. More...
 
void Invalidate ()
 If function is called than the window manager updates the window.
 
bool IsDirty ()
 Returns true if window has to be updated.
 
int Left ()
 Returns window left coordinate relative to the parent window.
 
int Top ()
 Returns window top coordinate relative to the parent window.
 
int Width ()
 Returns window width.
 
int Height ()
 Returns window height.
 
void AddChild (Window *window)
 Adds window child window.
 
WindowParent ()
 Returns Parent window.
 
void SetVisible (bool isVisible)
 Sets window visibility status.
 
bool IsVisible ()
 Returns true if window visible and false is hidden.
 
LinkedList< Window > & Children ()
 Returns list of children window.
 
void Redraw (DC *dc)
 Performs full window redraw. More...
 

Protected Member Functions

void PrepareDC (DC *dc)
 Setups window coordinate system. This function called by window manager right before window has to be redrawn and it is intended for internal use. More...
 
virtual void OnDraw (DC *dc)
 If derived class needs to draw something in window client area, this function has to be ovverriden. More...
 

Protected Attributes

int _left
 window left coordinate relative to the parent window
 
int _top
 window top coordinate relative to the parent window
 
int _width
 window width
 
int _height
 window height
 
bool _isVisible
 if this variable is false this window and all child windows are not visualized
 
LinkedList< Window_children
 list of children windows. All children window are positioned relative to parent window
 
Window_parent
 pointer to parent window
 
bool _isDirty
 if true than window manager will redraw this window.
 
DecoratorList * _decorators
 contains list of drawig commands. If they are shared between more than one window -> SRAM usage optimisation
 
ITouchEventReceiver_touchEventReceiver
 call back event receiver for touch actions
 

Detailed Description

Base class for all window objects. Provides basic window functionality.

Constructor & Destructor Documentation

Window::Window ( const __FlashStringHelper *  name,
int  left,
int  top,
int  width,
int  height 
)
inline

Constructor.

Parameters
nameinternal window name that help by debugging
leftleft coordinate relative to parent indow
toptop coordinate relative to parent indow
widthwindow width
heightwindow height

Member Function Documentation

virtual void Window::Move ( int  left,
int  top,
int  width,
int  height 
)
inlinevirtual

Moves and resizes window relativly to the parent window.

Parameters
leftleft coordinate relative to parent window
toptop coordinate relative to parent window
widthwindow width
heightwindow height

Reimplemented in MainWindow, TabManual, Window1, and Window2.

virtual void Window::OnDraw ( DC dc)
inlineprotectedvirtual

If derived class needs to draw something in window client area, this function has to be ovverriden.

Parameters
dcdevice context

Reimplemented in TextBoxNumber, ChartWindow, TextBox, TextBoxTString< T >, TextBoxTString< const __FlashStringHelper >, ButtonWindow, GaugeRadialPointer, GaugeBar, TextBoxStrTouch, TextBoxEditTString< T >, and TextBoxChar.

void Window::PrepareDC ( DC dc)
inlineprotected

Setups window coordinate system. This function called by window manager right before window has to be redrawn and it is intended for internal use.

Parameters
dcdevice context
void Window::Redraw ( DC dc)
inline

Performs full window redraw.

Parameters
dcdevice context
void Window::RegisterTouchEventReceiver ( ITouchEventReceiver touchEventReceiver)
inline

Registers receiver for touch event.

Receiver can be a general class that is derived from ITouchEventReceiver. In this calss NotifyTouch virtual function has to be ovveriden

Parameters
TouchEventReceiverpointer to touch event receiver

The documentation for this class was generated from the following files: