X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8c3c31d4a544271ae70be958f050f70bab440597..36e2955a64a41e743fbd151c2466450ef99b323b:/src/msw/button.cpp?ds=sidebyside diff --git a/src/msw/button.cpp b/src/msw/button.cpp index 492f7d6eed..620c2a74ab 100644 --- a/src/msw/button.cpp +++ b/src/msw/button.cpp @@ -32,6 +32,8 @@ #include "wx/brush.h" #include "wx/panel.h" #include "wx/bmpbuttn.h" + #include "wx/settings.h" + #include "wx/dcscreen.h" #endif #include "wx/msw/private.h" @@ -68,7 +70,8 @@ bool wxButton::Create(wxWindow *parent, if ( !CreateBase(parent, id, pos, size, style, validator, name) ) return FALSE; - SetValidator(validator); + // Validator was set in CreateBase + //SetValidator(validator); parent->AddChild((wxButton *)this); @@ -81,7 +84,7 @@ bool wxButton::Create(wxWindow *parent, _T("BUTTON"), label, WS_VISIBLE | WS_TABSTOP | WS_CHILD, - 0, 0, 0, 0, + 0, 0, 0, 0, GetWinHwnd(parent), (HMENU)m_windowId, wxGetInstance(), @@ -95,6 +98,17 @@ bool wxButton::Create(wxWindow *parent, SetSize(pos.x, pos.y, size.x, size.y); + // bad hack added by Robert to make buttons at least + // 80 pixels wide. There are probably better ways... + // TODO. FIXME. + wxSize nsize( GetSize() ); + if ((nsize.x < 80) || (nsize.y < 23)) + { + if ((size.x == -1) && (nsize.x < 80)) nsize.x = 80; + if ((size.y == -1) && (nsize.y < 23)) nsize.y = 23; + SetSize( nsize ); + } + return TRUE; }