|
W32DLib
|
#include <w32dlib/combobox.h>
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 TCHAR *text) |
| Adds a string to the combo box. | |
| int | AddString (const W32String &text) |
| Adds a string to the combo box. | |
| int | AddString (const TCHAR *text, int index) |
| Adds a string to the combo box. | |
| int | AddString (const W32String &text, int index) |
| Adds a string to the combo box. | |
| int | RemoveString (int index) |
| Removes a string from the combo box. | |
| W32String | 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. | |
Public Member Functions inherited from W32DLib::Control | |
| Control (Dialog *parent, int resource_id, DataX *datax) | |
| Constructor. | |
| virtual | ~Control () |
| Destructor. | |
| int | ResourceID () |
| Returns the Resource ID for the control. | |
| BOOL | ProcessMessage (UINT msg, WPARAM wp, LPARAM lp) |
| Processes a windows event. | |
Public Member Functions inherited from W32DLib::Window | |
| Window () | |
| Constructor. | |
| virtual | ~Window () |
| Destructor. | |
| bool | HasMutex () |
| Whether the Window() constructor could create a mutex. | |
| HWND | GetHWND () |
| Returns the HWND for the window. | |
| HMENU | GetHMENU () |
| Returns the HMENU associated with this window. | |
| bool | SetHMENU (HMENU menu) |
| Sets the HMENU associated with this window. | |
| bool | Move (int x, int y, int width, int height, bool repaint=true) |
| Sets a Window's position and size. | |
| bool | MoveBase (Window *w, int x, int y, int width, int height, bool repaint=true) |
| Sets a Window's position and size using Dialog base units. | |
| LRESULT | SendMsg (UINT msg, WPARAM wp, LPARAM lp) |
| Send a message to the window. | |
| void | SetText (const TCHAR *text) |
| Sets the window text. | |
| void | SetText (const W32String &text) |
| Sets the window text. | |
| W32String | GetText () |
| Gets the window text. | |
| void | Enable (bool enable) |
| Enables or disables the window. | |
Additional Inherited Members | |
Protected Member Functions inherited from W32DLib::Control | |
| void | AddCallback (UINT msg, UINT notification, Window *owner, W32DLibCallback callback) |
| Add a callback for the control. | |
Static Protected Member Functions inherited from W32DLib::Window | |
| static BOOL CALLBACK | WindowProc (HWND wnd, UINT msg, WPARAM wp, LPARAM lp) |
| The base WindProc. | |
Protected Attributes inherited from W32DLib::Control | |
| Dialog * | m_parent |
| Filled in by the constructor with the parent dialog. | |
| int | m_resid |
| Filled in by the constructor with the resource ID. | |
| DataX * | m_data |
| Filled in by the constructor with the DataX object. | |
The ComboBox class.
Constructor.
| 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 |
Destructor.
| int W32DLib::ComboBox::AddString | ( | const TCHAR * | text | ) |
Adds a string to the combo box.
| text | The string to add. |
| int W32DLib::ComboBox::AddString | ( | const W32String & | text | ) |
Adds a string to the combo box.
| text | The string to add. |
| int W32DLib::ComboBox::AddString | ( | const TCHAR * | text, |
| int | index | ||
| ) |
Adds a string to the combo box.
| text | The string to add. |
| index | The index to insert in front of |
| int W32DLib::ComboBox::AddString | ( | const W32String & | text, |
| int | index | ||
| ) |
Adds a string to the combo box.
| text | The string to add. |
| index | The index to insert in front of |
| int W32DLib::ComboBox::Count | ( | ) |
The number of strings in the combo box.
|
virtual |
Performs data exchange.
Support types:
eString – see Control::DoDataExchange()
eInt – same as SelectedIndex()
| 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.
| W32String W32DLib::ComboBox::GetString | ( | int | index | ) |
Gets a string from the combo box.
| index | The index of the string to retrieve. |
| void W32DLib::ComboBox::MaxLen | ( | int | count | ) |
Sets the maximum length the user can enter.
| 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.
| 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.
| 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.
| owner | The class the callback reside in. |
| callback | The callback. |
| int W32DLib::ComboBox::RemoveString | ( | int | index | ) |
Removes a string from the combo box.
| index | The index of the string to remove. |
| void W32DLib::ComboBox::Reset | ( | ) |
Resets the items in a combo box.
| int W32DLib::ComboBox::SelectedIndex | ( | ) |
Gets the index of the current selection.
| void W32DLib::ComboBox::SelectedIndex | ( | int | index | ) |
Sets the index of the current selection.
| index | The index. |
| int W32DLib::ComboBox::TopRowIndex | ( | ) |
Gets the index of the item at the top of the list.
| void W32DLib::ComboBox::TopRowIndex | ( | int | index | ) |
Sets the index of the item at the top of the list.
| index | The index. |