00001
00002
00003
00004
00005
00006
00007 #include "stdinc.h"
00008 #include "icon.h"
00009 #include "eventhandler.h"
00010 #include "widgets.h"
00011 #include "menu.h"
00012 #include "widget.h"
00013 #include "textbox.h"
00014 #include "exception.h"
00015 namespace MWidgets
00016 {
00017
00018
00019 TextBox::TextBox():Widget()
00020 {
00021 m_pOnChangeHandler=NULL;
00022 };
00023
00024 TextBox::~TextBox()
00025 {
00026 if(m_pOnChangeHandler)
00027 delete m_pOnChangeHandler;
00028 };
00029
00030 void TextBox::Create(Widget *parent,int x,int y,int w,int h)
00031 {
00032 Widget::Create(x,y,w,h,"","EDIT",WS_CHILD|WS_TABSTOP|WS_CLIPSIBLINGS,parent->GetHwnd(),WS_EX_CLIENTEDGE);
00033 };
00034
00035 void TextBox::OnCommand( WORD code ,WORD )
00036 {
00037 if(code==EN_CHANGE)
00038 OnChange();
00039 };
00040
00041 void TextBox::OnChange()
00042 {
00043 if(m_pOnChangeHandler)
00044 {
00045 m_pOnChangeHandler->Call(this);
00046 }
00047 };
00048
00049 WIDGET_TYPE TextBox::GetType()
00050 {
00051 return TEXTBOX;
00052 };
00053
00054 };