AWind
Window1.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>
21 #include <Label.h>
23 class Window1 : public Window
24 {
25 public:
26  Window1(const __FlashStringHelper * name,int left,int top,int width,int height):Window(name,left,top,width,height)
27  {
28  Label *label = new Label(0, 0, 0, 0, F("Tab 1"));
29  label->SetFont(BigFont);
30  AddChild(label);
31  SetDecorators(Environment::Get()->FindDecorators(F("Window")));
32  }
33  virtual void Move(int left, int top, int width, int height)
34  {
35  Window::Move(left, top, width, height);
36  Children()[0]->Move(width/2-40, height/2, width-20,40);
37  }
38 };
virtual void Move(int left, int top, int width, int height)
Moves and resizes window relativly to the parent window.
Definition: Window1.h:33
Base class for all window objects. Provides basic window functionality.
Definition: Window.h:34
void SetFont(uint8_t *font)
Sets font.
Definition: TextBox.h:64
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
Example window with red background.
Definition: Window1.h:23
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
Implement Label control.
Definition: Label.h:24