allow wxPopupWindow get the key events (patch 713269)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21847 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2003-07-10 09:55:13 +00:00
parent 7ed43a6c7e
commit 654070ca23
3 changed files with 17 additions and 17 deletions

View File

@ -31,7 +31,9 @@
#ifndef WX_PRECOMP
#include "wx/dcclient.h"
#endif // WX_PRECOMP
#ifdef __WXGTK__
#include <gtk/gtk.h>
#endif
#include "wx/tipwin.h"
#if wxUSE_TIPWINDOW
@ -157,6 +159,10 @@ wxTipWindow::wxTipWindow(wxWindow *parent,
#if wxUSE_POPUPWIN
Position(wxPoint(x, y), wxSize(0, 0));
Popup(m_view);
#ifdef __WXGTK__
if (!GTK_WIDGET_HAS_GRAB(m_widget))
gtk_grab_add( m_widget );
#endif
#else
Move(x, y);
Show(TRUE);
@ -169,6 +175,12 @@ wxTipWindow::~wxTipWindow()
{
*m_windowPtr = NULL;
}
#ifdef wxUSE_POPUPWIN
#ifdef __WXGTK__
if (GTK_WIDGET_HAS_GRAB(m_widget))
gtk_grab_remove( m_widget );
#endif
#endif
}
void wxTipWindow::OnMouseClick(wxMouseEvent& WXUNUSED(event))
@ -218,6 +230,10 @@ void wxTipWindow::Close()
#if wxUSE_POPUPWIN
Show(FALSE);
#ifdef __WXGTK__
if (GTK_WIDGET_HAS_GRAB(m_widget))
gtk_grab_remove( m_widget );
#endif
Destroy();
#else
wxFrame::Close();

View File

@ -151,8 +151,6 @@ IMPLEMENT_DYNAMIC_CLASS(wxPopupWindow, wxWindow)
wxPopupWindow::~wxPopupWindow()
{
if (GTK_WIDGET_HAS_GRAB(m_widget))
gtk_grab_remove( m_widget );
}
bool wxPopupWindow::Create( wxWindow *parent, int style )
@ -349,14 +347,8 @@ bool wxPopupWindow::Show( bool show )
GtkOnSize( m_x, m_y, m_width, m_height );
}
if (!show)
gtk_grab_remove( m_widget );
bool ret = wxWindow::Show( show );
if (show)
gtk_grab_add( m_widget );
return ret;
}

View File

@ -151,8 +151,6 @@ IMPLEMENT_DYNAMIC_CLASS(wxPopupWindow, wxWindow)
wxPopupWindow::~wxPopupWindow()
{
if (GTK_WIDGET_HAS_GRAB(m_widget))
gtk_grab_remove( m_widget );
}
bool wxPopupWindow::Create( wxWindow *parent, int style )
@ -349,14 +347,8 @@ bool wxPopupWindow::Show( bool show )
GtkOnSize( m_x, m_y, m_width, m_height );
}
if (!show)
gtk_grab_remove( m_widget );
bool ret = wxWindow::Show( show );
if (show)
gtk_grab_add( m_widget );
return ret;
}