X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fb39c7ecd74988b49b2356e154ef68ecaa320a8b..545176521071a4edd242a2cd4163b363e818ec56:/src/msw/button.cpp diff --git a/src/msw/button.cpp b/src/msw/button.cpp index 9a8122e079..18a3cc42e6 100644 --- a/src/msw/button.cpp +++ b/src/msw/button.cpp @@ -70,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); @@ -80,10 +81,10 @@ bool wxButton::Create(wxWindow *parent, m_hWnd = (WXHWND)CreateWindowEx ( MakeExtendedStyle(m_windowStyle), - _T("BUTTON"), + wxT("BUTTON"), label, WS_VISIBLE | WS_TABSTOP | WS_CHILD, - 0, 0, 0, 0, + 0, 0, 0, 0, GetWinHwnd(parent), (HMENU)m_windowId, wxGetInstance(), @@ -97,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; }