MWidgets::ComboBox Class Reference

Class that represent combobox widget. More...

#include <combobox.h>

Inheritance diagram for MWidgets::ComboBox:

MWidgets::Widget List of all members.

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

BaseEventHandlerm_pOnChangeHandler
 OnClick event handler.

Detailed Description

Class that represent combobox widget.

Definition at line 14 of file combobox.h.


Constructor & Destructor Documentation

MWidgets::ComboBox::ComboBox (  ) 

Constructor.

Definition at line 19 of file combobox.cpp.

References m_pOnChangeHandler.

MWidgets::ComboBox::~ComboBox (  ) 

Destructor.

Definition at line 24 of file combobox.cpp.

References m_pOnChangeHandler.


Member Function Documentation

int MWidgets::ComboBox::AddString ( string  str  ) 

Add new string.

Parameters:
str new string.
Returns:
value is the zero-based index to the string in the list box of the combo box.

Definition at line 63 of file combobox.cpp.

References MWidgets::Widget::m_hWnd.

void MWidgets::ComboBox::Clear (  ) 

Remove all items.

Definition at line 76 of file combobox.cpp.

References MWidgets::Widget::m_hWnd.

void MWidgets::ComboBox::Create ( Widget parent,
int  x,
int  y,
int  w,
int  h 
) [virtual]

Create widgets window.

Parameters:
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.

Parameters:
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().

template<class T>
void MWidgets::ComboBox::SetOnChangeHandler ( T *  pProcessor,
void(T::*)(Widget *sender)  EventCallBack 
) [inline]

Create event handler object for OnChange event;.

Parameters:
pProcessor object that own EventCallBack; method that realize event handler.

Definition at line 38 of file combobox.h.

References m_pOnChangeHandler.


Member Data Documentation

BaseEventHandler* MWidgets::ComboBox::m_pOnChangeHandler [protected]

OnClick event handler.

Definition at line 23 of file combobox.h.

Referenced by ComboBox(), OnChange(), SetOnChangeHandler(), and ~ComboBox().


The documentation for this class was generated from the following files:
Generated on Thu Oct 26 13:47:46 2006 for MWidgets by  doxygen 1.4.7