X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/37f214d588b02079a3ddf64c2e46585ca1657c1b..29149a64916d6fdc53e445adca9ef83bc58fb6c3:/src/os2/button.cpp diff --git a/src/os2/button.cpp b/src/os2/button.cpp index 8650e10026..cecadf63ee 100644 --- a/src/os2/button.cpp +++ b/src/os2/button.cpp @@ -23,20 +23,22 @@ #include "wx/os2/private.h" -#if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxButton, wxControl) -#endif // Button bool wxButton::Create(wxWindow *parent, wxWindowID id, const wxString& label, const wxPoint& pos, const wxSize& size, long style, +#if wxUSE_VALIDATORS const wxValidator& validator, +#endif const wxString& name) { SetName(name); +#if wxUSE_VALIDATORS SetValidator(validator); +#endif m_windowStyle = style; parent->AddChild((wxButton *)this); @@ -68,14 +70,14 @@ wxButton::~wxButton() // size management including autosizing // ---------------------------------------------------------------------------- -wxSize wxButton::DoGetBestSize() +wxSize wxButton::DoGetBestSize() const { wxString label = wxGetWindowText(GetHWND()); int wBtn; GetTextExtent(label, &wBtn, NULL); int wChar, hChar; - wxGetCharSize(GetHWND(), &wChar, &hChar, &GetFont()); + wxGetCharSize(GetHWND(), &wChar, &hChar, (wxFont*)&GetFont()); // add a margin - the button is wider than just its label wBtn += 3*wChar;