+#ifndef WX_PRECOMP
+ #include "wx/log.h"
+ #include "wx/settings.h"
+#endif
+
+#include "wx/fontutil.h"
+#include "wx/gtk/private.h"
+
+#include "wx/gtk/private/mnemonics.h"
+
+// ============================================================================
+// wxControl implementation
+// ============================================================================
+
+// ----------------------------------------------------------------------------
+// wxControl creation
+// ----------------------------------------------------------------------------
+
+IMPLEMENT_DYNAMIC_CLASS(wxControl, wxWindow)
+
+wxControl::wxControl()
+{
+}
+
+bool wxControl::Create( wxWindow *parent,
+ wxWindowID id,
+ const wxPoint &pos,
+ const wxSize &size,
+ long style,
+ const wxValidator& validator,
+ const wxString &name )
+{
+ bool ret = wxWindow::Create(parent, id, pos, size, style, name);
+
+#if wxUSE_VALIDATORS
+ SetValidator(validator);
+#endif
+
+ return ret;
+}
+
+wxSize wxControl::DoGetBestSize() const
+{
+ // Do not return any arbitrary default value...
+ wxASSERT_MSG( m_widget, wxT("DoGetBestSize called before creation") );
+
+ GtkRequisition req;
+ req.width = 2;
+ req.height = 2;
+ (* GTK_WIDGET_CLASS( GTK_OBJECT_GET_CLASS(m_widget) )->size_request )
+ (m_widget, &req );
+
+ wxSize best(req.width, req.height);
+ CacheBestSize(best);
+ return best;
+}
+
+void wxControl::PostCreation(const wxSize& size)
+{
+ wxWindow::PostCreation();
+
+ // NB: GetBestSize needs to know the style, otherwise it will assume
+ // default font and if the user uses a different font, determined
+ // best size will be different (typically, smaller) than the desired
+ // size. This call ensure that a style is available at the time
+ // GetBestSize is called.
+ gtk_widget_ensure_style(m_widget);
+
+ ApplyWidgetStyle();
+ SetInitialSize(size);
+}
+
+// ----------------------------------------------------------------------------
+// wxControl dealing with labels
+// ----------------------------------------------------------------------------
+
+void wxControl::GTKSetLabelForLabel(GtkLabel *w, const wxString& label)
+{
+ // save the original label
+ wxControlBase::SetLabel(label);
+
+ const wxString labelGTK = GTKConvertMnemonics(label);
+ gtk_label_set_text_with_mnemonic(w, wxGTK_CONV(labelGTK));
+}
+
+void wxControl::GTKSetLabelWithMarkupForLabel(GtkLabel *w, const wxString& label)
+{
+ const wxString labelGTK = GTKConvertMnemonicsWithMarkup(label);
+ gtk_label_set_markup_with_mnemonic(w, wxGTK_CONV(labelGTK));
+}
+