AWind
Window2.h
1 /*
2  AWind.h - Arduino window library support for Color TFT LCD Boards
3  Copyright (C)2014 Andrei Degtiarev. All right reserved
4 
5  You can find the latest version of the library at
6  https://github.com/AndreiDegtiarev/AWind
7 
8  This library is free software; you can redistribute it and/or
9  modify it under the terms of the CC BY-NC-SA 3.0 license.
10  Please see the included documents for further information.
11 
12  Commercial use of this library requires you to buy a license that
13  will allow commercial use. This includes using the library,
14  modified or not, as a tool to sell products.
15 
16  The license applies to all part of the library including the
17  examples and tools supplied with the library.
18 */
19 #pragma once
20 #include <Window.h>
22 class Window2 : public Window
23 {
24 public:
25  Window2(const __FlashStringHelper * name,int left,int top,int width,int height):Window(name,left,top,width,height)
26  {
27  AddChild(new Label(0, 0, 0, 0, F("Tab 2")));
28  SetDecorators(Environment::Get()->FindDecorators(F("Window")));
29  }
30  virtual void Move(int left, int top, int width, int height)
31  {
32  Window::Move(left, top, width, height);
33  Children()[0]->Move(10, height / 2, width - 20, 40);
34  }
35 };
Base class for all window objects. Provides basic window functionality.
Definition: Window.h:34
virtual void Move(int left, int top, int width, int height)
Moves and resizes window relativly to the parent window.
Definition: Window2.h:30
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
LinkedList< Window > & Children()
Returns list of children window.
Definition: Window.h:223
Window(const __FlashStringHelper *name, int left, int top, int width, int height)
Constructor.
Definition: Window.h:60
void AddChild(Window *window)
Adds window child window.
Definition: Window.h:194
virtual void SetDecorators(DecoratorList *decorators)
Sets window decorators list.
Definition: Window.h:76
Example window with yellow background.
Definition: Window2.h:22
Implement Label control.
Definition: Label.h:24