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 "groupbox.h"
00014 #include "exception.h"
00015 namespace MWidgets
00016 {
00017
00018
00019 GroupBox::GroupBox():Widget()
00020 {
00021 };
00022
00023 void GroupBox::Create(Widget *parent,int x,int y,int w,int h,string caption)
00024 {
00025 Widget::Create(x,y,w,h,caption,"BUTTON",WS_CHILD|BS_GROUPBOX|WS_GROUP |WS_CLIPCHILDREN|WS_CLIPSIBLINGS ,parent->GetHwnd());
00026 };
00027
00028 LRESULT GroupBox::OnMessage (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
00029 {
00030 if(message==WM_ERASEBKGND)
00031 {
00032 RECT rc;
00033 GetClientRect(m_hWnd, &rc);
00034 HDC hdc=(HDC)wParam;
00035
00036 SetBkColor(hdc, GetSysColor(COLOR_BTNFACE));
00037 ExtTextOut(hdc, 0, 0, ETO_OPAQUE, &rc, NULL, 0, 0);
00038 };
00039 return Widget::OnMessage(hWnd, message, wParam, lParam);
00040 };
00041
00042 WIDGET_TYPE GroupBox::GetType()
00043 {
00044 return GROUPBOX;
00045 };
00046
00047 };