Class MyPanel This element is a sub section and is used to bring together elements. More...
#include <SDK_Manila_Sense.h>
Inherits Element.
Public Member Functions | |
MyPanel (int idElement, int x, int y, int width, wstring title, bool hasTitle=true, bool hasSeparator=true) | |
to create a panel. | |
~MyPanel (void) | |
void | add (Element *e, int minHeight=-1, int pos=-1, bool mixWithOther=true) |
Use this method to add an element to the sub section. | |
void | changeTitle (wstring title) |
Use this method to change the title of panel. | |
Element * | getElement (int pos) |
get element based on position in panel (first position == 0) | |
int | getSize () |
Used to get the numbers of components into the sub section. | |
virtual Element * | isClicked (int x, int y) |
To test if a position is inside the element... | |
virtual void | paint (DIRECTDRAW_GDI *lpDDraw, int x, int y) |
To draw the panel (and components)... | |
Element * | remove (int pos, int nb=1) |
Use this method to remove an element from the panel. | |
void | sizeChanged (Element *src, int width, int height) |
This method is called by components when they change size. Used to recompute the size of panel. | |
Static Public Attributes | |
static int | TITLE_PANEL_HEIGHT = 0 |
Height of title of sub section. |
Class MyPanel This element is a sub section and is used to bring together elements.
This element can have a title and dotted separator between each element.
Definition at line 1369 of file SDK_Manila_Sense.h.
MyPanel::MyPanel | ( | int | idElement, | |
int | x, | |||
int | y, | |||
int | width, | |||
wstring | title, | |||
bool | hasTitle = true , |
|||
bool | hasSeparator = true | |||
) |
to create a panel.
Height is computed based on content...
idElement | a number used to identify the Element (Can be used to get a pointer with Element::getElementByID) | |
x | padding left of the element | |
y | padding top of the element | |
width | width of section (usually set to GlobalInformations::rs.right to take entire width) | |
title | Title of sub section | |
hasTitle | set to true if you want to print the title | |
hasSeparator | set to true if you want to print separator |
Definition at line 38 of file MyPanel.cpp.
MyPanel::~MyPanel | ( | void | ) |
Definition at line 67 of file MyPanel.cpp.
void MyPanel::add | ( | Element * | e, | |
int | minHeight = -1 , |
|||
int | pos = -1 , |
|||
bool | mixWithOther = true | |||
) | [virtual] |
Use this method to add an element to the sub section.
e | Pointer of element to add | |
minHeight | Minimum of height (if item is higher, his size will be used) | |
pos | Position of element in the section (first element => pos==0). If pos<0, item is add at the end | |
mixWithOther | set to true if you want to mix this element with other |
Reimplemented from Element.
Definition at line 309 of file MyPanel.cpp.
void MyPanel::changeTitle | ( | wstring | title | ) |
Use this method to change the title of panel.
title | new title. (If you set it to L"", the title will be hidden) |
Definition at line 78 of file MyPanel.cpp.
Element* MyPanel::getElement | ( | int | pos | ) | [inline] |
get element based on position in panel (first position == 0)
Definition at line 1452 of file SDK_Manila_Sense.h.
int MyPanel::getSize | ( | ) | [inline] |
Used to get the numbers of components into the sub section.
Definition at line 1454 of file SDK_Manila_Sense.h.
Element * MyPanel::isClicked | ( | int | x, | |
int | y | |||
) | [virtual] |
To test if a position is inside the element...
x | position of click | |
y | position of click |
Implements Element.
Definition at line 138 of file MyPanel.cpp.
void MyPanel::paint | ( | DIRECTDRAW_GDI * | lpDDraw, | |
int | x, | |||
int | y | |||
) | [virtual] |
To draw the panel (and components)...
lpDDraw | surface to print (GlobalInformations::primaryBuffer for example) | |
x | position of top-left | |
y | position of top-left |
Implements Element.
Definition at line 153 of file MyPanel.cpp.
Element * MyPanel::remove | ( | int | pos, | |
int | nb = 1 | |||
) |
Use this method to remove an element from the panel.
pos | Position of element in the section (first element => pos==0) | |
nb | numbers of element to remove |
Definition at line 366 of file MyPanel.cpp.
void MyPanel::sizeChanged | ( | Element * | src, | |
int | width, | |||
int | height | |||
) | [virtual] |
This method is called by components when they change size. Used to recompute the size of panel.
Reimplemented from Element.
Definition at line 404 of file MyPanel.cpp.
int MyPanel::TITLE_PANEL_HEIGHT = 0 [static] |
Height of title of sub section.
Definition at line 1457 of file SDK_Manila_Sense.h.