20 #include "MainWindow.h" 26 LinkedList<Button> _listButtons;
27 LinkedList<Window> _listWindow;
35 int wnd_width=
Width();
41 Button * button=
new Button(x+10,(szy+10)*(_listButtons.Count())+20,szx,szy,buttonName);
46 window->
Move(szx+25,0,wnd_width-szx-25,wnd_height);
47 _listButtons.Add(button);
48 _listWindow.Add(window);
49 if(_listWindow.Count()>1)
52 _listButtons[0]->SetDecorators(_listWindow[0]->
GetDecorators());
65 for(
int i=0;i<_listButtons.Count();i++)
67 if(window == _listButtons[i])
76 for(
int i=0;i<_listButtons.Count();i++)
78 _listWindow[i]->SetVisible(i==sel_index);
81 _listWindow[i]->Invalidate();
82 _listButtons[i]->SetDecorators(_listWindow[i]->
GetDecorators());
88 _listButtons[i]->SetDecorators(buttonDeco);
89 _listButtons[i]->Invalidate();
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
Window selector main window. It works as kind of tab control and can be used more or less without mod...
Definition: WindowSelector.h:24
static Environment * Get()
Returns singltone instance of environment.
Definition: Environment.h:44
virtual void Move(int left, int top, int width, int height)
Moves and resizes window relativly to the parent window.
Definition: Window.h:149
void NotifyTouch(Window *window)
Events routing for gui interaction (see RegisterTouchEventReceiver and public ITouchEventReceiver dec...
Definition: WindowSelector.h:62
int Height()
Returns window height.
Definition: Window.h:189
Decorator primitive that sets current color. Overriden members description see Decorator class docume...
Definition: DecoratorPrimitives.h:24
Decorator primitive for round rect filled area. Overriden members description see Decorator class doc...
Definition: DecoratorPrimitives.h:79
void AddChild(Window *window)
Adds window child window.
Definition: Window.h:194
void AddDecorator(Decorator *decorator)
Adds decorator to the decaorator list.
Definition: Window.h:86
void SetVisible(bool isVisible)
Sets window visibility status.
Definition: Window.h:205
MainWindow(int width, int height)
Constructor.
Definition: MainWindow.h:52
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
DecoratorList * FindDecorators(const __FlashStringHelper *id)
Finds registered decorators by the name.
Definition: Environment.h:59
Interface that provides screen touch notifications. If you want receive this notification in the targ...
Definition: ITouchEventReceiver.h:24
int Width()
Returns window width.
Definition: Window.h:184
void SetMargins(int offset_x, int offset_y)
Defines offset from left and top for text.
Definition: TextBox.h:58
void AddTab(const __FlashStringHelper *buttonName, Window *window)
Adds pair: button + corresponding window.
Definition: WindowSelector.h:33