X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d88de032d3009be88d0f0ba4a882784aa9493331..87df17a11b0017d31c09f767bd921abb27193bee:/src/os2/button.cpp diff --git a/src/os2/button.cpp b/src/os2/button.cpp index 7f1caf34d4..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,20 +70,20 @@ 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; // the button height is proportional to the height of the font used - int hBtn = BUTTON_HEIGHT_FROM_CHAR_HEIGHT(hChar); + int hBtn = 0;// TODO: BUTTON_HEIGHT_FROM_CHAR_HEIGHT(hChar); return wxSize(wBtn, hBtn); }