X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/db434467a143a2c847c4bcfe987f0202c2d02bf2..bc5a847c1b4d89a9e26a3ac7b9e75f41b7530316:/src/gtk1/button.cpp?ds=inline diff --git a/src/gtk1/button.cpp b/src/gtk1/button.cpp index 5b16248fcd..d594d37e26 100644 --- a/src/gtk1/button.cpp +++ b/src/gtk1/button.cpp @@ -4,13 +4,17 @@ // Author: Robert Roebling // Id: $Id$ // Copyright: (c) 1998 Robert Roebling -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ #pragma implementation "button.h" #endif +#include "wx/defs.h" + +#if wxUSE_BUTTON + #include "wx/button.h" #include @@ -77,7 +81,7 @@ bool wxButton::Create( wxWindow *parent, wxWindowID id, const wxString &label, !CreateBase( parent, id, pos, size, style, validator, name )) { wxFAIL_MSG( wxT("wxButton creation failed") ); - return FALSE; + return FALSE; } /* @@ -85,7 +89,7 @@ bool wxButton::Create( wxWindow *parent, wxWindowID id, const wxString &label, for (size_t i = 0; i < label2.Len(); i++) { if (label2.GetChar(i) == wxT('&')) - label2.SetChar(i,wxT('_')); + label2.SetChar(i,wxT('_')); } GtkWidget *accel_label = gtk_accel_label_new( label2.mb_str() ); @@ -118,8 +122,6 @@ bool wxButton::Create( wxWindow *parent, wxWindowID id, const wxString &label, PostCreation(); - ApplyWidgetStyle(); - SetFont( parent->GetFont() ); wxSize best_size( DoGetBestSize() ); @@ -184,7 +186,14 @@ void wxButton::ApplyWidgetStyle() wxSize wxButton::DoGetBestSize() const { wxSize ret( wxControl::DoGetBestSize() ); - if (ret.x < 80) ret.x = 80; + + if (!HasFlag(wxBU_EXACTFIT)) + { + if (ret.x < 80) ret.x = 80; + } + return ret; } +#endif // wxUSE_BUTTON +