Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

W32DLib::ComboBox Class Reference

The ComboBox class. More...

#include <w32dlib/combobox.h>

Inheritance diagram for W32DLib::ComboBox:

W32DLib::Control W32DLib::Window List of all members.

Public Member Functions

 ComboBox (Dialog *parent, int resource_id, DataX *datax)
 Constructor.
virtual ~ComboBox ()
 Destructor.
void OnSelection (Window *owner, W32DLibCallback callback)
 Sets a callback for when selection changes.
void OnDoubleClick (Window *owner, W32DLibCallback callback)
 Sets a callback for when a list entry is double clicked.
void OnTextChanged (Window *owner, W32DLibCallback callback)
 Sets a callback for when the text is altered.
void Reset ()
 Resets the items in a combo box.
void MaxLen (int count)
 Sets the maximum length the user can enter.
int Count ()
 The number of strings in the combo box.
int AddString (const char *text)
 Adds a string to the combo box.
int AddString (const std::string &text)
 Adds a string to the combo box.
int AddString (const char *text, int index)
 Adds a string to the combo box.
int AddString (const std::string &text, int index)
 Adds a string to the combo box.
int RemoveString (int index)
 Removes a string from the combo box.
std::string GetString (int index)
 Gets a string from the combo box.
int TopRowIndex ()
 Gets the index of the item at the top of the list.
void TopRowIndex (int index)
 Sets the index of the item at the top of the list.
int SelectedIndex ()
 Gets the index of the current selection.
void SelectedIndex (int index)
 Sets the index of the current selection.
virtual void DoDataExchange (bool set)
 Performs data exchange.

Detailed Description

The ComboBox class.


Constructor & Destructor Documentation

W32DLib::ComboBox::ComboBox Dialog parent,
int  resource_id,
DataX datax
 

Constructor.

Parameters:
parent The dialog the control belongs to.
resource_id The ID of the control in the resource file.
datax The DataX to use. NULL means don't use data exchange.

virtual W32DLib::ComboBox::~ComboBox  )  [virtual]
 

Destructor.


Member Function Documentation

int W32DLib::ComboBox::AddString const std::string &  text,
int  index
 

Adds a string to the combo box.

Parameters:
text The string to add.
index The index to insert in front of
Returns:
The index of the added string, or CB_ERR or CB_ERRSPACE.

int W32DLib::ComboBox::AddString const char *  text,
int  index
 

Adds a string to the combo box.

Parameters:
text The string to add.
index The index to insert in front of
Returns:
The index of the added string, or CB_ERR or CB_ERRSPACE.

int W32DLib::ComboBox::AddString const std::string &  text  ) 
 

Adds a string to the combo box.

Parameters:
text The string to add.
Returns:
The index of the added string, or CB_ERR or CB_ERRSPACE.

int W32DLib::ComboBox::AddString const char *  text  ) 
 

Adds a string to the combo box.

Parameters:
text The string to add.
Returns:
The index of the added string, or CB_ERR or CB_ERRSPACE.

int W32DLib::ComboBox::Count  ) 
 

The number of strings in the combo box.

Returns:
The count or CB_ERR.

virtual void W32DLib::ComboBox::DoDataExchange bool  set  )  [virtual]
 

Performs data exchange.

Support types:

eString -- see Control::DoDataExchange()

eInt -- same as SelectedIndex()

Parameters:
set If true the set the Control from the DataX object. If false then set the DataX object from the Control.

Reimplemented from W32DLib::Control.

std::string W32DLib::ComboBox::GetString int  index  ) 
 

Gets a string from the combo box.

Parameters:
index The index of the string to retrieve.
Returns:
The string.

void W32DLib::ComboBox::MaxLen int  count  ) 
 

Sets the maximum length the user can enter.

Parameters:
count The maximum number of characters the user can enter.

void W32DLib::ComboBox::OnDoubleClick Window owner,
W32DLibCallback  callback
 

Sets a callback for when a list entry is double clicked.

Note this only works of the list has a CBS_SIMPLE style.

Parameters:
owner The class the callback reside in.
callback The callback.

void W32DLib::ComboBox::OnSelection Window owner,
W32DLibCallback  callback
 

Sets a callback for when selection changes.

Parameters:
owner The class the callback resides in.
callback The callback.

void W32DLib::ComboBox::OnTextChanged Window owner,
W32DLibCallback  callback
 

Sets a callback for when the text is altered.

Note this will not work if the list has a CBS_DROPDOWNLIST style.

Parameters:
owner The class the callback reside in.
callback The callback.

int W32DLib::ComboBox::RemoveString int  index  ) 
 

Removes a string from the combo box.

Parameters:
index The index of the string to remove.
Returns:
The count of remaining items, or CB_ERR.

void W32DLib::ComboBox::Reset  ) 
 

Resets the items in a combo box.

void W32DLib::ComboBox::SelectedIndex int  index  ) 
 

Sets the index of the current selection.

Parameters:
index The index.

int W32DLib::ComboBox::SelectedIndex  ) 
 

Gets the index of the current selection.

Returns:
The index, or CB_ERR.

void W32DLib::ComboBox::TopRowIndex int  index  ) 
 

Sets the index of the item at the top of the list.

Parameters:
index The index.

int W32DLib::ComboBox::TopRowIndex  ) 
 

Gets the index of the item at the top of the list.

Returns:
The index, or CB_ERR.


The documentation for this class was generated from the following file:
Generated on Fri May 6 01:22:33 2005 for W32DLib by  doxygen 1.4.1