X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/db434467a143a2c847c4bcfe987f0202c2d02bf2..19f45995fb86029cb9800bdce8f0cc677c816283:/src/gtk/button.cpp?ds=sidebyside diff --git a/src/gtk/button.cpp b/src/gtk/button.cpp index 5b16248fcd..d594d37e26 100644 --- a/src/gtk/button.cpp +++ b/src/gtk/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 +