]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/classic/button.cpp
create stock GDI objects on demand; use const with GDI objects appropriately (patch...
[wxWidgets.git] / src / mac / classic / button.cpp
index 3ce18b2e27f0333a1c44d79343c191dca112992b..681d76170367f909fb1283a3490e5d73e769527b 100644 (file)
@@ -9,18 +9,13 @@
 // Licence:       wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
-#pragma implementation "button.h"
-#endif
-
 #include "wx/defs.h"
 
 #include "wx/button.h"
 #include "wx/panel.h"
+#include "wx/stockitem.h"
 
-#if !USE_SHARED_LIBRARY
 IMPLEMENT_DYNAMIC_CLASS(wxButton, wxControl)
-#endif
 
 #include "wx/mac/uma.h"
 // Button
@@ -28,12 +23,16 @@ IMPLEMENT_DYNAMIC_CLASS(wxButton, wxControl)
 static const int kMacOSXHorizontalBorder = 2 ;
 static const int kMacOSXVerticalBorder = 4 ;
 
-bool wxButton::Create(wxWindow *parent, wxWindowID id, const wxString& label,
+bool wxButton::Create(wxWindow *parent, wxWindowID id, const wxString& lbl,
            const wxPoint& pos,
            const wxSize& size, long style,
            const wxValidator& validator,
            const wxString& name)
 {
+    wxString label(lbl);
+    if (label.empty() && wxIsStockID(id))
+        label = wxGetStockLabel(id);
+    
     if ( !wxButtonBase::Create(parent, id, pos, size, style, validator, name) )
         return false;