X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/37f214d588b02079a3ddf64c2e46585ca1657c1b..dee9ba58f5ca2104c0b5749f38a6a7d6ee7fe1cd:/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;