]> git.saurik.com Git - wxWidgets.git/blobdiff - src/univ/button.cpp
renamed wxDynamicThisCast to wxDynamicCastThis, removed 1st parameter, and documented
[wxWidgets.git] / src / univ / button.cpp
index 7a7a9fa771bda7f31ce86b69adc435103b8f45f7..65a5b69c9bbfbd87f5e64f0ff4a7d143207e4133 100644 (file)
@@ -18,7 +18,7 @@
 // ----------------------------------------------------------------------------
 
 #ifdef __GNUG__
-    #pragma implementation "button.h"
+    #pragma implementation "univbutton.h"
 #endif
 
 #include "wx/wxprec.h"
@@ -136,9 +136,12 @@ wxSize wxButton::DoGetBestClientSize() const
 
     // for compatibility with other ports, the buttons default size is never
     // less than the standard one
-    wxSize szDef = GetDefaultSize();
-    if ( width < szDef.x )
-        width = szDef.x;
+    if ( !(GetWindowStyle() & wxBU_EXACTFIT) )
+    {
+        wxSize szDef = GetDefaultSize();
+        if ( width < szDef.x )
+            width = szDef.x;
+    }
 
     return wxSize(width, height);
 }
@@ -149,7 +152,11 @@ wxSize wxButton::DoGetBestClientSize() const
 
 void wxButton::DoDraw(wxControlRenderer *renderer)
 {
-    renderer->DrawButtonBorder();
+    if ( !(GetWindowStyle() & wxBORDER_NONE) )
+    {
+        renderer->DrawButtonBorder();
+    }
+
     renderer->DrawLabel(m_bitmap, m_marginBmpX, m_marginBmpY);
 }