Apycom jQuery Menus

MySelector Class Reference

Class MySelector Used to draw dropdown list. More...

#include <SDK_Manila_Sense.h>

Inherits Element.

Collaboration diagram for MySelector:

List of all members.

Public Member Functions

 MySelector (int idElement, int x, int y, wstring nameOfChoice)
 to create a dropdown list.
 ~MySelector (void)
void addItem (wstring word)
 Add an item to the dropdown list.
MyLabelgetItemSelected ()
 used to get a pointer of selected item
int getSelection ()
 get the index of selection
virtual ElementisClicked (int x, int y)
 To test if a position is inside the element...
int mouseGesture ()
 Method called before each frame to take decision according to user gesture.
MyLabeloperator[] (unsigned int i)
 Method used to get access to an element.
virtual void paint (DIRECTDRAW_GDI *lpDDraw, int x, int y)
 To draw the dropdown list...
bool run (bool isRightClicked=false)
 To start action associated with this element (show items).
void setSelection (int idSelect)
 Used to change the selection.
void unClick ()
 To notify the item it is no longer active (hide items).
void updateTitle (wstring wantedTitle=L"")
 When content is changed, use this function to update the title If nothing is selected, the param is used to change title, else it's the selected label.

Detailed Description

Class MySelector Used to draw dropdown list.

Scroll screen if list is out of screen

Definition at line 1474 of file SDK_Manila_Sense.h.


Constructor & Destructor Documentation

MySelector::MySelector ( int  idElement,
int  x,
int  y,
wstring  nameOfChoice 
)

to create a dropdown list.

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
nameOfChoice Title printed when nothing is selected

Definition at line 51 of file MySelector.cpp.

MySelector::~MySelector ( void   ) 

Definition at line 81 of file MySelector.cpp.


Member Function Documentation

void MySelector::addItem ( wstring  word  ) 

Add an item to the dropdown list.

Definition at line 398 of file MySelector.cpp.

MyLabel* MySelector::getItemSelected (  )  [inline]

used to get a pointer of selected item

Returns:
a pointer on selected item (NULL if nothing is selected)

Definition at line 1561 of file SDK_Manila_Sense.h.

int MySelector::getSelection (  ) 

get the index of selection

Returns:
the number of item selected. -1 if no item is selected

Definition at line 412 of file MySelector.cpp.

Element * MySelector::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 151 of file MySelector.cpp.

int MySelector::mouseGesture (  )  [virtual]

Method called before each frame to take decision according to user gesture.

Use MouseCtrl::changeMouseAnalyse to capture user gesture.

Returns:
In pixel, the scrolling in vertical direction

Reimplemented from Element.

Definition at line 292 of file MySelector.cpp.

MyLabel * MySelector::operator[] ( unsigned int  i  ) 

Method used to get access to an element.

Used like that:

 MySelector *mySelect=new MySelector(...);
 MyLabel *item=mySelect[2];//get the  second item !
Parameters:
i indice of wanted element
Returns:
pointer of i-th element (NULL if out of range)

Definition at line 424 of file MySelector.cpp.

void MySelector::paint ( DIRECTDRAW_GDI lpDDraw,
int  x,
int  y 
) [virtual]

To draw the dropdown list...

Parameters:
lpDDraw surface to print (GlobalInformations::primaryBuffer for example)
x position of top-left
y position of top-left

Implements Element.

Definition at line 171 of file MySelector.cpp.

bool MySelector::run ( bool  isRightClicked = false  )  [virtual]

To start action associated with this element (show items).

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 85 of file MySelector.cpp.

void MySelector::setSelection ( int  idSelect  ) 

Used to change the selection.

Definition at line 441 of file MySelector.cpp.

void MySelector::unClick (  )  [virtual]

To notify the item it is no longer active (hide items).

Reimplemented from Element.

Definition at line 126 of file MySelector.cpp.

void MySelector::updateTitle ( wstring  wantedTitle = L""  ) 

When content is changed, use this function to update the title If nothing is selected, the param is used to change title, else it's the selected label.

Parameters:
wantedTitle if nothing is selected, it will be the title, else it's the selected label

Definition at line 430 of file MySelector.cpp.


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