Class MyItem Different items : Button (3 types), checkboxes and switch (TripleState!). More...
#include <SDK_Manila_Sense.h>
Inherits Element.
Public Member Functions | |
MyItem (int idElement, int x, int y, unsigned char type, unsigned char state, wstring text=L"") | |
to create an item (no need for size, only depends of type) | |
~MyItem (void) | |
void | centerH () |
Use this method to center the text into the item. | |
void | changeColorTxt (DWORD color, DWORD backColor, int type) |
Use this method to change the color of text into the component. | |
void | changeText (wstring text) |
Use this method to change the text of item. | |
void | hasBackgroundTransparent (bool val) |
Use this method if background of button is transparent. | |
virtual Element * | isClicked (int x, int y) |
To test if a position is inside the element... | |
unsigned char | isEnabled () |
Used to know if item is enabled or disabled. | |
unsigned char | isSelected () |
virtual void | paint (DIRECTDRAW_GDI *lpDDraw, int x, int y) |
To draw the item... | |
bool | run (bool isRightClicked=false) |
To start action associated with this element. | |
void | sizeChanged (Element *src, int width, int height) |
This method is called by text when it change size. Use to verify if text is bigger than item. | |
void | switchVisibility () |
Use this method to change the visibility of item. | |
void | unClick () |
To notify the item it is no longer active (unclick the button). |
Class MyItem Different items : Button (3 types), checkboxes and switch (TripleState!).
Event on click, visibility and state can be changed/get easily.
Definition at line 1233 of file SDK_Manila_Sense.h.
MyItem::MyItem | ( | int | idElement, | |
int | x, | |||
int | y, | |||
unsigned char | type, | |||
unsigned char | state, | |||
wstring | text = L"" | |||
) |
to create an item (no need for size, only depends of type)
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 | |
type | one of these values: ITEM_IS_CHECKBOX, ITEM_IS_SWITCH, ITEM_IS_BUTTON_NORMAL, ITEM_IS_BUTTON_BIG or ITEM_IS_BUTTON_SHORT | |
state | one of these values: ITEM_STATE_EBL_EMPTY, ITEM_STATE_EBL_SELECTED, ITEM_STATE_DSBL_EMPTY, ITEM_STATE_DSBL_SELECTED, ITEM_STATE_HOVER_EMPTY, ITEM_STATE_HOVER_SELECTED, ITEM_THIRD_STATE or ITEM_THIRD_STATE_DSBL | |
text | text of label |
Definition at line 98 of file MyItem.cpp.
MyItem::~MyItem | ( | void | ) |
Definition at line 162 of file MyItem.cpp.
void MyItem::centerH | ( | ) |
Use this method to center the text into the item.
Definition at line 90 of file MyItem.cpp.
void MyItem::changeColorTxt | ( | DWORD | color, | |
DWORD | backColor, | |||
int | type | |||
) |
Use this method to change the color of text into the component.
color | Color of your text (use RGB macro for easier use) | |
backColor | Not used... |
Definition at line 428 of file MyItem.cpp.
void MyItem::changeText | ( | wstring | text | ) |
Use this method to change the text of item.
text | new text of item |
Definition at line 392 of file MyItem.cpp.
void MyItem::hasBackgroundTransparent | ( | bool | val | ) | [inline] |
Use this method if background of button is transparent.
Definition at line 1354 of file SDK_Manila_Sense.h.
Element * MyItem::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 223 of file MyItem.cpp.
unsigned char MyItem::isEnabled | ( | ) | [inline] |
Used to know if item is enabled or disabled.
Definition at line 1319 of file SDK_Manila_Sense.h.
unsigned char MyItem::isSelected | ( | ) | [inline] |
Definition at line 1323 of file SDK_Manila_Sense.h.
void MyItem::paint | ( | DIRECTDRAW_GDI * | lpDDraw, | |
int | x, | |||
int | y | |||
) | [virtual] |
To draw the item...
lpDDraw | surface to print (GlobalInformations::primaryBuffer for example) | |
x | position of top-left | |
y | position of top-left |
Implements Element.
Definition at line 247 of file MyItem.cpp.
bool MyItem::run | ( | bool | isRightClicked = false |
) | [virtual] |
To start action associated with this element.
isRightClicked | true if your want to start action associated with a right click |
Reimplemented from Element.
Definition at line 185 of file MyItem.cpp.
void MyItem::sizeChanged | ( | Element * | src, | |
int | width, | |||
int | height | |||
) | [virtual] |
This method is called by text when it change size. Use to verify if text is bigger than item.
Reimplemented from Element.
Definition at line 169 of file MyItem.cpp.
void MyItem::switchVisibility | ( | ) | [inline] |
Use this method to change the visibility of item.
Each call will switch visibility between enabled/disabled
Definition at line 1334 of file SDK_Manila_Sense.h.
void MyItem::unClick | ( | ) | [virtual] |
To notify the item it is no longer active (unclick the button).
Reimplemented from Element.
Definition at line 209 of file MyItem.cpp.