]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/button.cpp
removed copystring function already defined in common wx utilities
[wxWidgets.git] / src / os2 / button.cpp
index 7f1caf34d4721b235fa7e0f9e55114f176ebe306..cecadf63eed7905f6d846c068c84aadda6b33b03 100644 (file)
 
 #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);
 }