From 224016a800a9939332cb87401304c476fefe6664 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Tue, 3 Jan 2006 16:37:32 +0000 Subject: [PATCH] Added wxAddGrab, wxRemoveGrab for use by popup window implementations git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36663 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/gtk/private.h | 4 ++++ include/wx/gtk1/private.h | 4 ++++ src/gtk/window.cpp | 14 ++++++++++++-- src/gtk1/window.cpp | 14 ++++++++++++-- 4 files changed, 32 insertions(+), 4 deletions(-) diff --git a/include/wx/gtk/private.h b/include/wx/gtk/private.h index d283191754..3fe0527aaa 100644 --- a/include/wx/gtk/private.h +++ b/include/wx/gtk/private.h @@ -131,6 +131,10 @@ inline wxEventType GtkScrollWinTypeToWx(guint scrollType) wxEVT_SCROLLWIN_TOP - wxEVT_SCROLL_TOP; } +// Needed for implementing e.g. combobox on wxGTK within a modal dialog. +void wxAddGrab(wxWindow* window); +void wxRemoveGrab(wxWindow* window); + #ifdef __WXGTK20__ // Escapes string so that it is valid Pango markup XML string: WXDLLIMPEXP_CORE wxString wxEscapeStringForPangoMarkup(const wxString& str); diff --git a/include/wx/gtk1/private.h b/include/wx/gtk1/private.h index d283191754..3fe0527aaa 100644 --- a/include/wx/gtk1/private.h +++ b/include/wx/gtk1/private.h @@ -131,6 +131,10 @@ inline wxEventType GtkScrollWinTypeToWx(guint scrollType) wxEVT_SCROLLWIN_TOP - wxEVT_SCROLL_TOP; } +// Needed for implementing e.g. combobox on wxGTK within a modal dialog. +void wxAddGrab(wxWindow* window); +void wxRemoveGrab(wxWindow* window); + #ifdef __WXGTK20__ // Escapes string so that it is valid Pango markup XML string: WXDLLIMPEXP_CORE wxString wxEscapeStringForPangoMarkup(const wxString& str); diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index 2cfd697af3..1e9038e20a 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -4738,8 +4738,19 @@ wxPoint wxGetMousePosition() } +// Needed for implementing e.g. combobox on wxGTK within a modal dialog. +void wxAddGrab(wxWindow* window) +{ + gtk_grab_add( (GtkWidget*) window->GetHandle() ); +} + +void wxRemoveGrab(wxWindow* window) +{ + gtk_grab_remove( (GtkWidget*) window->GetHandle() ); +} + // ---------------------------------------------------------------------------- -// wxDCModule +// wxWinModule // ---------------------------------------------------------------------------- class wxWinModule : public wxModule @@ -4768,4 +4779,3 @@ void wxWinModule::OnExit() gdk_gc_unref( g_eraseGC ); } -// vi:sts=4:sw=4:et diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index 2cfd697af3..1e9038e20a 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -4738,8 +4738,19 @@ wxPoint wxGetMousePosition() } +// Needed for implementing e.g. combobox on wxGTK within a modal dialog. +void wxAddGrab(wxWindow* window) +{ + gtk_grab_add( (GtkWidget*) window->GetHandle() ); +} + +void wxRemoveGrab(wxWindow* window) +{ + gtk_grab_remove( (GtkWidget*) window->GetHandle() ); +} + // ---------------------------------------------------------------------------- -// wxDCModule +// wxWinModule // ---------------------------------------------------------------------------- class wxWinModule : public wxModule @@ -4768,4 +4779,3 @@ void wxWinModule::OnExit() gdk_gc_unref( g_eraseGC ); } -// vi:sts=4:sw=4:et -- 2.45.2