X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2e8613b74113418749863342f3495a9df733eece..1978421a6d8b81c1f8a961da4b8ddf544fec7b1b:/src/gtk/button.cpp diff --git a/src/gtk/button.cpp b/src/gtk/button.cpp index 764cbde38f..51caf3b9dc 100644 --- a/src/gtk/button.cpp +++ b/src/gtk/button.cpp @@ -7,10 +7,13 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "button.h" #endif +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + #include "wx/defs.h" #if wxUSE_BUTTON @@ -120,8 +123,8 @@ bool wxButton::Create( wxWindow *parent, wxWindowID id, const wxString &label, y_alignment = 1.0; gtk_misc_set_alignment (GTK_MISC (BUTTON_CHILD (m_widget)), - x_alignment, y_alignment); - + x_alignment, y_alignment); + SetLabel( label ); if (style & wxNO_BORDER) @@ -175,7 +178,12 @@ void wxButton::SetLabel( const wxString &label ) wxControl::SetLabel( label ); +#ifdef __WXGTK20__ + wxString label2 = PrepareLabelMnemonics( label ); + gtk_label_set_text_with_mnemonic( GTK_LABEL( BUTTON_CHILD(m_widget) ), wxGTK_CONV( label2 ) ); +#else gtk_label_set( GTK_LABEL( BUTTON_CHILD(m_widget) ), wxGTK_CONV( GetLabel() ) ); +#endif } bool wxButton::Enable( bool enable ) @@ -188,6 +196,15 @@ bool wxButton::Enable( bool enable ) return TRUE; } +bool wxButton::IsOwnGtkWindow( GdkWindow *window ) +{ +#ifdef __WXGTK20__ + return GTK_BUTTON(m_widget)->event_window; +#else + return (window == m_widget->window); +#endif +} + void wxButton::ApplyWidgetStyle() { SetWidgetStyle();