Apycom jQuery Menus

MyItem Class Reference

Class MyItem Different items : Button (3 types), checkboxes and switch (TripleState!). More...

#include <SDK_Manila_Sense.h>

Inherits Element.

Collaboration diagram for MyItem:

List of all members.

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 ElementisClicked (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).

Detailed Description

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.


Constructor & Destructor Documentation

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)

Parameters:
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.


Member Function Documentation

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.

Parameters:
color Color of your text (use RGB macro for easier use)
backColor Not used...
Returns:
type one of these values : ITEM_COLOR_HOVER, ITEM_COLOR_DISABLED or ITEM_COLOR_NORMAL

Definition at line 428 of file MyItem.cpp.

void MyItem::changeText ( wstring  text  ) 

Use this method to change the text of item.

Parameters:
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...

Parameters:
x position of click
y position of click
Returns:
NULL if not clicked, this else

Implements Element.

Definition at line 223 of file MyItem.cpp.

unsigned char MyItem::isEnabled (  )  [inline]

Used to know if item is enabled or disabled.

Returns:
true if the item is enabled

Definition at line 1319 of file SDK_Manila_Sense.h.

unsigned char MyItem::isSelected (  )  [inline]
Returns:
true if user is trying to click on element

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...

Parameters:
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.

Parameters:
isRightClicked true if your want to start action associated with a right click
Returns:
true if element has take control of future drawing (usually return false)

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.


The documentation for this class was generated from the following files:
Thibault LELORE