Planeshift
Public Member Functions

pawsComboBox Class Reference

A basic combo box widget. More...

#include <pawscombo.h>

List of all members.

Public Member Functions

bool Clear ()
pawsListBoxGetChoiceList ()
 @@ Hack: please someone tell me how to do this better?
int GetRowCount ()
int GetSelectedRowNum ()
 Returns index of selected option (-1 if none is selected.
csString GetSelectedRowString ()
 Returns string of selected option.
pawsListBoxRowNewOption ()
pawsListBoxRowNewOption (const csString &text)
bool OnButtonPressed (int mouseButton, int keyModifier, pawsWidget *widget)
 Called whenever a button is pressed.
void OnListAction (pawsListBox *widget, int status)
 Called whenever an item in a child list box is selected.
 pawsComboBox (const pawsComboBox &origin)
 pawsComboBox ()
bool PostSetup ()
 This is called after the widget and all of it's children have been created.
pawsListBoxRowSelect (const char *text)
pawsListBoxRowSelect (int optionNum)
 Selects given option in combo.
void SetNumRows (int numRows)
void SetRowHeight (int height)
void SetSorted (bool sorting)
 sets if the list has to be sorted. NOTE: call before adding entries.
bool Setup (iDocumentNode *node)
 Setup this widget.
void SetUpButtonImage (const char *name)
void SetUpButtonPressedImage (const char *name)
void SetUpDownButtonImage (const char *name)
void SetUpDownButtonPressedImage (const char *name)
 ~pawsComboBox ()

Detailed Description

A basic combo box widget.

This widget consists of a textbox and a drop down list box. When an item from the list box is selected the textbox is updated.

This is the format of how it is defined in a widget file:

<widget name="comboBox" factory="pawsComboBox"> <!-- Size of text box with the current choice --> <frame x="100" y="100" width="100" height="30" border="no" />

<!-- Number of list box choices with height of a choice row --> <listbox rows="5" height="30" text="InitialText" /> </widget>

This class sets the listbox with the id of the combo widget so if you want to track messages from this you override the Selected( pawsListBox* widget ) funtion in your controlling widget and have a case for this widget's ID number.

Definition at line 53 of file pawscombo.h.


Constructor & Destructor Documentation

pawsComboBox::pawsComboBox ( )
pawsComboBox::~pawsComboBox ( )
pawsComboBox::pawsComboBox ( const pawsComboBox origin)

Member Function Documentation

bool pawsComboBox::Clear ( )
pawsListBox* pawsComboBox::GetChoiceList ( ) [inline]

@@ Hack: please someone tell me how to do this better?

Definition at line 96 of file pawscombo.h.

int pawsComboBox::GetRowCount ( )
int pawsComboBox::GetSelectedRowNum ( )

Returns index of selected option (-1 if none is selected.

csString pawsComboBox::GetSelectedRowString ( )

Returns string of selected option.

pawsListBoxRow* pawsComboBox::NewOption ( )
pawsListBoxRow* pawsComboBox::NewOption ( const csString &  text)
bool pawsComboBox::OnButtonPressed ( int  button,
int  keyModifier,
pawsWidget widget 
) [virtual]

Called whenever a button is pressed.

Parameters:
buttonThe button pressed.
keyModifierModifier key in effect.
widgetThe widget the button belongs to.
Returns:
bool Parent's result or FALSE if no parent.

Reimplemented from pawsWidget.

void pawsComboBox::OnListAction ( pawsListBox selected,
int  status 
) [virtual]

Called whenever an item in a child list box is selected.

Parameters:
selectedThe listbox that has the item selected.
statusFrom listbox when a row is selected.

Reimplemented from pawsWidget.

bool pawsComboBox::PostSetup ( ) [virtual]

This is called after the widget and all of it's children have been created.

Remarks:
This can be useful for widgets that want to get pointers to some of it's children for quick access.

Reimplemented from pawsWidget.

pawsListBoxRow* pawsComboBox::Select ( int  optionNum)

Selects given option in combo.

pawsListBoxRow* pawsComboBox::Select ( const char *  text)
void pawsComboBox::SetNumRows ( int  numRows) [inline]

Definition at line 65 of file pawscombo.h.

void pawsComboBox::SetRowHeight ( int  height) [inline]

Definition at line 69 of file pawscombo.h.

void pawsComboBox::SetSorted ( bool  sorting)

sets if the list has to be sorted. NOTE: call before adding entries.

bool pawsComboBox::Setup ( iDocumentNode *  ) [virtual]

Setup this widget.

Reimplemented from pawsWidget.

void pawsComboBox::SetUpButtonImage ( const char *  name) [inline]

Definition at line 73 of file pawscombo.h.

void pawsComboBox::SetUpButtonPressedImage ( const char *  name) [inline]

Definition at line 81 of file pawscombo.h.

void pawsComboBox::SetUpDownButtonImage ( const char *  name) [inline]

Definition at line 77 of file pawscombo.h.

void pawsComboBox::SetUpDownButtonPressedImage ( const char *  name) [inline]

Definition at line 85 of file pawscombo.h.


The documentation for this class was generated from the following file: