#include <combobox.h>
Inheritance diagram for MWidgets::ComboBox:
Public Member Functions | |
ComboBox () | |
Constructor. | |
~ComboBox () | |
Destructor. | |
virtual void | Create (Widget *parent, int x, int y, int w, int h) |
Create widgets window. | |
template<class T> | |
void | SetOnChangeHandler (T *pProcessor, void(T::*EventCallBack)(Widget *sender)) |
Create event handler object for OnChange event;. | |
virtual void | OnChange () |
Virtual callback function for clicked event. | |
int | AddString (string str) |
Add new string. | |
void | DelString (int index) |
Delete string. | |
int | GetItemsCount () |
Return number of items in combo box. | |
void | Clear () |
Remove all items. | |
virtual WIDGET_TYPE | GetType () |
Returns class's identifier like WINDOW or BUTTON. | |
Protected Member Functions | |
virtual void | OnCommand (WORD code, WORD id) |
Function starts callbacks. | |
virtual LRESULT | OnMessage (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) |
Subclassing. | |
Protected Attributes | |
BaseEventHandler * | m_pOnChangeHandler |
OnClick event handler. |
Definition at line 14 of file combobox.h.
MWidgets::ComboBox::ComboBox | ( | ) |
MWidgets::ComboBox::~ComboBox | ( | ) |
int MWidgets::ComboBox::AddString | ( | string | str | ) |
Add new string.
str | new string. |
Definition at line 63 of file combobox.cpp.
References MWidgets::Widget::m_hWnd.
void MWidgets::ComboBox::Clear | ( | ) |
void MWidgets::ComboBox::Create | ( | Widget * | parent, | |
int | x, | |||
int | y, | |||
int | w, | |||
int | h | |||
) | [virtual] |
Create widgets window.
parent | parent widget. | |
w | new Button's width. | |
h | new Button's height. |
Definition at line 30 of file combobox.cpp.
References MWidgets::Widget::Create(), and MWidgets::Widget::GetHwnd().
void MWidgets::ComboBox::DelString | ( | int | index | ) |
Delete string.
index | zero-based index of the string to delete. |
Definition at line 71 of file combobox.cpp.
References MWidgets::Widget::m_hWnd.
int MWidgets::ComboBox::GetItemsCount | ( | ) |
Return number of items in combo box.
Definition at line 81 of file combobox.cpp.
References MWidgets::Widget::m_hWnd.
WIDGET_TYPE MWidgets::ComboBox::GetType | ( | ) | [virtual] |
Returns class's identifier like WINDOW or BUTTON.
Implements MWidgets::Widget.
Definition at line 89 of file combobox.cpp.
References MWidgets::COMBOBOX.
void MWidgets::ComboBox::OnChange | ( | ) | [virtual] |
Virtual callback function for clicked event.
Definition at line 55 of file combobox.cpp.
References MWidgets::BaseEventHandler::Call(), and m_pOnChangeHandler.
Referenced by OnCommand(), and OnMessage().
void MWidgets::ComboBox::OnCommand | ( | WORD | code, | |
WORD | id | |||
) | [protected, virtual] |
Function starts callbacks.
Reimplemented from MWidgets::Widget.
Definition at line 49 of file combobox.cpp.
References OnChange().
LRESULT MWidgets::ComboBox::OnMessage | ( | HWND | hWnd, | |
UINT | message, | |||
WPARAM | wParam, | |||
LPARAM | lParam | |||
) | [protected, virtual] |
Subclassing.
Reimplemented from MWidgets::Widget.
Definition at line 35 of file combobox.cpp.
References MWidgets::Widget::GetText(), OnChange(), and MWidgets::Widget::OnMessage().
void MWidgets::ComboBox::SetOnChangeHandler | ( | T * | pProcessor, | |
void(T::*)(Widget *sender) | EventCallBack | |||
) | [inline] |
Create event handler object for OnChange event;.
pProcessor | object that own EventCallBack; method that realize event handler. |
Definition at line 38 of file combobox.h.
References m_pOnChangeHandler.
BaseEventHandler* MWidgets::ComboBox::m_pOnChangeHandler [protected] |
OnClick event handler.
Definition at line 23 of file combobox.h.
Referenced by ComboBox(), OnChange(), SetOnChangeHandler(), and ~ComboBox().