From f4c049b60e1d915cb5908d9ba174fd136ab4c4b8 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Mon, 4 Nov 2002 20:13:23 +0000 Subject: [PATCH] Small correction for wxButton mouse events under GTK 2.0. Minor doc updates. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17703 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/latex/wx/tunicode.tex | 5 +++-- docs/latex/wx/wxgtk.tex | 2 +- include/wx/gtk/button.h | 1 + include/wx/gtk1/button.h | 1 + src/gtk/button.cpp | 9 +++++++++ src/gtk1/button.cpp | 9 +++++++++ 6 files changed, 24 insertions(+), 3 deletions(-) diff --git a/docs/latex/wx/tunicode.tex b/docs/latex/wx/tunicode.tex index 693edee8e5..bbbc90c9ee 100644 --- a/docs/latex/wx/tunicode.tex +++ b/docs/latex/wx/tunicode.tex @@ -160,7 +160,7 @@ Although everything works fine inside the program, things can get nasty when it tries to communicate with the outside world which, sadly, often expects ANSI strings (a notable exception is the entire Win32 API which accepts either Unicode or ANSI strings and which thus makes it unnecessary to ever perform -any conversions in the program). +any conversions in the program). GTK 2.0 only accepts UTF-8 strings. To get a ANSI string from a wxString, you may use the mb\_str() function which always returns an ANSI @@ -175,7 +175,8 @@ the Unicode string. \subsection{Unicode-related compilation settings} You should define {\tt wxUSE\_UNICODE} to $1$ to compile your program in -Unicode mode. Note that it currently only works in Win32 and that some parts of +Unicode mode. Note that it currently only works in Win32 and GTK 2.0 and +that some parts of wxWindows are not Unicode-compliant yet (ODBC classes, for example). If you compile your program in ANSI mode you can still define {\tt wxUSE\_WCHAR\_T} to get some limited support for {\tt wchar\_t} type. diff --git a/docs/latex/wx/wxgtk.tex b/docs/latex/wx/wxgtk.tex index 8d12d3b588..2b2d8c176b 100644 --- a/docs/latex/wx/wxgtk.tex +++ b/docs/latex/wx/wxgtk.tex @@ -5,7 +5,7 @@ from www.gtk.org. It makes use of GTK+'s native widgets wherever possible and uses wxWindows' generic controls when needed. GTK+ itself has been ported to a number of systems, but so far only the original X11 version is supported. Support for the recently released -GTK+ 2.0 including Unicode support is still under construction. +GTK+ 2.0 including Unicode support is work in progress. You will need GTK+ 1.2.3 or higher which is available from: diff --git a/include/wx/gtk/button.h b/include/wx/gtk/button.h index f6d0a48857..5b895a059e 100644 --- a/include/wx/gtk/button.h +++ b/include/wx/gtk/button.h @@ -65,6 +65,7 @@ public: // -------------- void ApplyWidgetStyle(); + bool IsOwnGtkWindow( GdkWindow *window ); protected: virtual wxSize DoGetBestSize() const; diff --git a/include/wx/gtk1/button.h b/include/wx/gtk1/button.h index f6d0a48857..5b895a059e 100644 --- a/include/wx/gtk1/button.h +++ b/include/wx/gtk1/button.h @@ -65,6 +65,7 @@ public: // -------------- void ApplyWidgetStyle(); + bool IsOwnGtkWindow( GdkWindow *window ); protected: virtual wxSize DoGetBestSize() const; diff --git a/src/gtk/button.cpp b/src/gtk/button.cpp index 711b64f16c..fae04c1372 100644 --- a/src/gtk/button.cpp +++ b/src/gtk/button.cpp @@ -188,6 +188,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(); diff --git a/src/gtk1/button.cpp b/src/gtk1/button.cpp index 711b64f16c..fae04c1372 100644 --- a/src/gtk1/button.cpp +++ b/src/gtk1/button.cpp @@ -188,6 +188,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();