Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages | Examples

PG_ListBox Class Reference

Inheritance diagram for PG_ListBox:

Inheritance graph
[legend]
Collaboration diagram for PG_ListBox:

Collaboration graph
[legend]
List of all members.

Detailed Description

A scrollable box that can hold any number of text items.

Author:
Alexander Pipelka


Public Member Functions

 PG_ListBox (PG_Widget *parent, const PG_Rect &r=PG_Rect::null, const char *style="ListBox")
 ~PG_ListBox ()
void SetMultiSelect (bool multi=true)
bool GetMultiSelect ()
PG_ListBoxBaseItemGetSelectedItem ()
void SelectItem (PG_ListBoxBaseItem *item, bool select=true)
void SelectFirstItem ()
void SelectNextItem ()
void SelectPrevItem ()
void RemoveAll ()
 Remove all widgets from the list (without deletion).

void DeleteAll ()
 Delete (destroy) all widgets in the list.

void SetIndent (Uint16 indent)
 Set the item indentation.

Uint16 GetIndent ()
 Returns the item indentation.

void SetAlignment (PG_Label::TextAlign style)
 Set the alignment for all items.

PG_Label::TextAlign GetAlignment ()
 Returns the set alignment rule of this list.

int GetSelectedIndex ()
 Returns the index of the last selected item.

void GetSelectedItems (std::vector< PG_ListBoxBaseItem * > &items)
void AddChild (PG_Widget *child)
 Add a clientwidget (which will be embedded into this widget).


Public Attributes

SignalSelectItem sigSelectItem

Protected Member Functions

virtual bool eventSelectItem (PG_ListBoxBaseItem *item)
bool eventMouseButtonUp (const SDL_MouseButtonEvent *button)
 Overridable Eventhandler for a SDL_MouseButtonEvent message.

bool eventMouseButtonDown (const SDL_MouseButtonEvent *button)
 Overridable Eventhandler for a SDL_MouseButtonEvent message.

bool eventMouseMotion (const SDL_MouseMotionEvent *motion)
 Overridable Eventhandler for a SDL_MouseMotionEvent message.


Friends

class PG_ListBoxBaseItem


Constructor & Destructor Documentation

PG_ListBox::PG_ListBox PG_Widget parent,
const PG_Rect r = PG_Rect::null,
const char *  style = "ListBox"
 

PG_ListBox::~PG_ListBox  ) 
 


Member Function Documentation

void PG_ListBox::AddChild PG_Widget child  )  [virtual]
 

Add a clientwidget (which will be embedded into this widget).

Parameters:
child the widget to add

Reimplemented from PG_WidgetList.

void PG_ListBox::DeleteAll  )  [virtual]
 

Delete (destroy) all widgets in the list.

Reimplemented from PG_ScrollWidget.

bool PG_ListBox::eventMouseButtonDown const SDL_MouseButtonEvent *  button  )  [protected, virtual]
 

Overridable Eventhandler for a SDL_MouseButtonEvent message.

This handler is called when a mouse button is pressed. The default implementation returns 'false' which indicates that this message is not processed by this object.

Parameters:
button SDL_MouseButtonEvent message
Returns:
Notifies the message pump if this message is processed by this object or it should be routed to the next message receiver.

Reimplemented from PG_MessageObject.

bool PG_ListBox::eventMouseButtonUp const SDL_MouseButtonEvent *  button  )  [protected, virtual]
 

Overridable Eventhandler for a SDL_MouseButtonEvent message.

This handler is called when a mouse button is released. The default implementation returns 'false' which indicates that this message is not processed by this object.

Parameters:
button SDL_MouseButtonEvent message
Returns:
Notifies the message pump if this message is processed by this object or it should be routed to the next message receiver.

Reimplemented from PG_MessageObject.

bool PG_ListBox::eventMouseMotion const SDL_MouseMotionEvent *  motion  )  [protected, virtual]
 

Overridable Eventhandler for a SDL_MouseMotionEvent message.

This handler is called when mouse movement is detected. The default implementation returns 'false' which indicates that this message is not processed by this object.

Parameters:
motion SDL_MouseMotionEvent message
Returns:
Notifies the message pump if this message is processed by this object or it should be routed to the next message receiver.

Reimplemented from PG_MessageObject.

virtual bool PG_ListBox::eventSelectItem PG_ListBoxBaseItem item  )  [protected, virtual]
 

PG_Label::TextAlign PG_ListBox::GetAlignment  ) 
 

Returns the set alignment rule of this list.

Uint16 PG_ListBox::GetIndent  ) 
 

Returns the item indentation.

bool PG_ListBox::GetMultiSelect  ) 
 

int PG_ListBox::GetSelectedIndex  ) 
 

Returns the index of the last selected item.

PG_ListBoxBaseItem* PG_ListBox::GetSelectedItem  ) 
 

void PG_ListBox::GetSelectedItems std::vector< PG_ListBoxBaseItem * > &  items  ) 
 

void PG_ListBox::RemoveAll  )  [virtual]
 

Remove all widgets from the list (without deletion).

Reimplemented from PG_ScrollWidget.

void PG_ListBox::SelectFirstItem  ) 
 

void PG_ListBox::SelectItem PG_ListBoxBaseItem item,
bool  select = true
 

void PG_ListBox::SelectNextItem  ) 
 

void PG_ListBox::SelectPrevItem  ) 
 

void PG_ListBox::SetAlignment PG_Label::TextAlign  style  ) 
 

Set the alignment for all items.

Parameters:
style alignment to be used for all items

void PG_ListBox::SetIndent Uint16  indent  ) 
 

Set the item indentation.

Parameters:
indent number of pixels for item indentation (must be set before adding items)

void PG_ListBox::SetMultiSelect bool  multi = true  ) 
 


Friends And Related Function Documentation

friend class PG_ListBoxBaseItem [friend]
 


Member Data Documentation

SignalSelectItem PG_ListBox::sigSelectItem
 



The ParaGUI Project - Alexander Pipelka