00001
00002
00003
00004
00005
00006
00007 #ifndef M_COMBOBOX_H
00008 #define M_COMBOBOX_H
00009
00010 namespace MWidgets
00011 {
00012
00014 class ComboBox:public Widget
00015 {
00016 protected:
00018 virtual void OnCommand( WORD code,WORD id );
00020 virtual LRESULT OnMessage (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
00021 protected:
00023 BaseEventHandler *m_pOnChangeHandler;
00024 public:
00026 ComboBox();
00028 ~ComboBox();
00033 virtual void Create(Widget *parent,int x,int y,int w,int h);
00037 template<class T>
00038 void SetOnChangeHandler(T *pProcessor,void (T::*EventCallBack)(Widget* sender))
00039 {
00040 if(m_pOnChangeHandler!=NULL)
00041 delete m_pOnChangeHandler;
00042 m_pOnChangeHandler=new EventHandler<T>(pProcessor,EventCallBack);
00043 };
00045 virtual void OnChange();
00049 int AddString(string str);
00052 void DelString(int index);
00054 int GetItemsCount();
00056 void Clear();
00058 virtual WIDGET_TYPE GetType();
00059 };
00060 };
00061
00062 #endif