00001 /* 00002 * Copyright (c) 2006 by Kirill Kolodyazhniy. 00003 * See the file "license.terms" for information on usage and redistribution 00004 * of this file, and for a DISCLAIMER OF ALL WARRANTIES. 00005 */ 00006 00007 #ifndef M_TEXTBOX_H 00008 #define M_TEXTBOX_H 00009 00010 namespace MWidgets 00011 { 00012 00014 class TextBox:public Widget 00015 { 00016 protected: 00018 virtual void OnCommand( WORD code,WORD id ); 00019 protected: 00021 BaseEventHandler *m_pOnChangeHandler; 00022 00023 public: 00025 TextBox(); 00027 ~TextBox(); 00032 virtual void Create(Widget *parent,int x,int y,int w,int h); 00036 template<class T> 00037 void SetOnChangeHandler(T *pProcessor,void (T::*EventCallBack)(Widget* sender)) 00038 { 00039 if(m_pOnChangeHandler!=NULL) 00040 delete m_pOnChangeHandler; 00041 m_pOnChangeHandler=new EventHandler<T>(pProcessor,EventCallBack); 00042 }; 00044 virtual void OnChange(); 00046 virtual WIDGET_TYPE GetType(); 00047 }; 00048 }; 00049 00050 #endif