]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/button.cpp
Execution control stuff
[wxWidgets.git] / src / gtk1 / button.cpp
index e1099660546cd92f80e5bb901f228c5befc4da68..cd85a483aec4614ef04b00a9002c058026f79376 100644 (file)
@@ -64,21 +64,19 @@ wxButton::wxButton()
 
 wxButton::~wxButton()
 {
-    if (m_clientData) delete m_clientData;
 }
 
 bool wxButton::Create(  wxWindow *parent, wxWindowID id, const wxString &label,
       const wxPoint &pos, const wxSize &size,
       long style, const wxValidator& validator, const wxString &name )
 {
-    m_clientData = (wxClientData*) NULL;
     m_needParent = TRUE;
     m_acceptsFocus = TRUE;
 
     if (!PreCreation( parent, pos, size ) ||
         !CreateBase( parent, id, pos, size, style, validator, name ))
     {
-        wxFAIL_MSG( _T("wxButton creation failed") );
+        wxFAIL_MSG( wxT("wxButton creation failed") );
        return FALSE;
     }
 
@@ -97,8 +95,17 @@ bool wxButton::Create(  wxWindow *parent, wxWindowID id, const wxString &label,
     GetTextExtent( m_label, &x, &y, (int*)NULL, (int*)NULL, &new_font );
 
     wxSize newSize = size;
-    if (newSize.x == -1) newSize.x = 12+x;
-    if (newSize.y == -1) newSize.y = 11+y;
+    if (newSize.x == -1)
+    {  
+        newSize.x = 12+x;
+       if (newSize.x < 80) newSize.x = 80;
+    }
+    if (newSize.y == -1)
+    {
+        newSize.y = 11+y;
+       if (newSize.x < 26) newSize.x = 26;
+    }
+       
     SetSize( newSize.x, newSize.y );
 
     gtk_signal_connect( GTK_OBJECT(m_widget), "clicked",
@@ -117,7 +124,7 @@ bool wxButton::Create(  wxWindow *parent, wxWindowID id, const wxString &label,
     return TRUE;
 }
 
-void wxButton::SetDefault(void)
+void wxButton::SetDefault()
 {
     GTK_WIDGET_SET_FLAGS( m_widget, GTK_CAN_DEFAULT );
     gtk_widget_grab_default( m_widget );
@@ -133,7 +140,7 @@ wxSize wxButton::GetDefaultSize()
 
 void wxButton::SetLabel( const wxString &label )
 {
-    wxCHECK_RET( m_widget != NULL, _T("invalid button") );
+    wxCHECK_RET( m_widget != NULL, wxT("invalid button") );
   
     wxControl::SetLabel( label );