X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/173348db5fd89f79aaaa40388c3b1c76732002d3..3e1ed7d709cf4e81556589a8c2132882f40d97ff:/src/gtk1/checkbox.cpp?ds=sidebyside diff --git a/src/gtk1/checkbox.cpp b/src/gtk1/checkbox.cpp index 2729438afb..3e3b959f4f 100644 --- a/src/gtk1/checkbox.cpp +++ b/src/gtk1/checkbox.cpp @@ -16,8 +16,8 @@ #if wxUSE_CHECKBOX -#include "gdk/gdk.h" -#include "gtk/gtk.h" +#include +#include //----------------------------------------------------------------------------- // idle system @@ -106,16 +106,7 @@ bool wxCheckBox::Create(wxWindow *parent, m_widget = m_widgetCheckbox; } - wxSize newSize(size); - if (newSize.x == -1) - { - newSize.x = 25 + gdk_string_measure( m_widgetCheckbox->style->font, - m_label.mbc_str() ); - } - if (newSize.y == -1) - newSize.y = 26; - - SetSize( newSize.x, newSize.y ); + SetSizeOrDefault( size ); gtk_signal_connect( GTK_OBJECT(m_widgetCheckbox), "clicked", @@ -210,4 +201,10 @@ void wxCheckBox::OnInternalIdle() UpdateWindowUI(); } +wxSize wxCheckBox::DoGetBestSize() const +{ + return wxSize( 25 + gdk_string_measure( m_widgetCheckbox->style->font, + m_label.mbc_str() ), 26 ); +} + #endif