]> git.saurik.com Git - wxWidgets.git/commitdiff
Dislaying popup tip windows seems to work right now.
authorRobert Roebling <robert@roebling.de>
Thu, 6 Jun 2002 19:35:51 +0000 (19:35 +0000)
committerRobert Roebling <robert@roebling.de>
Thu, 6 Jun 2002 19:35:51 +0000 (19:35 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15766 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/gtk/popupwin.h
include/wx/gtk1/popupwin.h
src/common/cshelp.cpp
src/gtk/popupwin.cpp
src/gtk1/popupwin.cpp

index d01ecdff0123e151006119806d884e53e9becce0..40ad14d7465c42a2ba9276d29e5b44a7aed2b00e 100644 (file)
@@ -27,9 +27,7 @@ class wxPopupWindow: public wxPopupWindowBase
 {
 public:
     wxPopupWindow() { }
-#ifdef __DARWIN__
-    virtual ~wxPopupWindow() { }
-#endif
+    virtual ~wxPopupWindow();
 
     wxPopupWindow(wxWindow *parent, int flags = wxBORDER_NONE)
         { (void)Create(parent, flags); }
index d01ecdff0123e151006119806d884e53e9becce0..40ad14d7465c42a2ba9276d29e5b44a7aed2b00e 100644 (file)
@@ -27,9 +27,7 @@ class wxPopupWindow: public wxPopupWindowBase
 {
 public:
     wxPopupWindow() { }
-#ifdef __DARWIN__
-    virtual ~wxPopupWindow() { }
-#endif
+    virtual ~wxPopupWindow();
 
     wxPopupWindow(wxWindow *parent, int flags = wxBORDER_NONE)
         { (void)Create(parent, flags); }
index 18b62f6f6613f48c7fd29330fe2501b56963b19d..f25d0943e75469a3ee10348cd67beba1de15dcbf 100644 (file)
@@ -6,7 +6,7 @@
 // Created:     08/09/2000
 // RCS-ID:      $Id$
 // Copyright:   (c) 2000 Julian Smart, Vadim Zeitlin
-// Licence:    wxWindows licence
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 // ============================================================================
@@ -144,14 +144,14 @@ bool wxContextHelp::BeginContextHelp(wxWindow* win)
     {
         wxPoint pt;
         wxWindow* winAtPtr = wxFindWindowAtPointer(pt);
-       /*
+    /*
         if (winAtPtr)
         {
-       wxString msg;
+    wxString msg;
         msg.Printf("Picked %s (%d)", (const char*) winAtPtr->GetName(), winAtPtr->GetId());
         cout << msg << '\n';
         }
-       */
+    */
 
         if (winAtPtr)
             DispatchEvent(winAtPtr, pt);
@@ -170,6 +170,7 @@ bool wxContextHelp::EndContextHelp()
 bool wxContextHelp::EventLoop()
 {
     m_inHelp = TRUE;
+    
     while ( m_inHelp )
     {
         if (wxTheApp->Pending())
@@ -181,6 +182,7 @@ bool wxContextHelp::EventLoop()
             wxTheApp->ProcessIdle();
         }
     }
+    
     return TRUE;
 }
 
@@ -223,8 +225,9 @@ bool wxContextHelp::DispatchEvent(wxWindow* win, const wxPoint& pt)
     {
         wxHelpEvent helpEvent(wxEVT_HELP, subjectOfHelp->GetId(), pt) ;
         helpEvent.SetEventObject(this);
+        
         eventProcessed = win->GetEventHandler()->ProcessEvent(helpEvent);
-
+        
         // Go up the window hierarchy until the event is handled (or not).
         // I.e. keep submitting ancestor windows until one is recognised
         // by the app code that processes the ids and displays help.
index 7f63baa20fff783663d2301ad0785a2d5f2b5945..923a68bbd1167a5b7861d2b6315acf4ec55dc6ab 100644 (file)
@@ -149,6 +149,12 @@ END_EVENT_TABLE()
 
 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 )
 {
     m_needParent = FALSE;
@@ -342,9 +348,15 @@ 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;
 }
 
index 7f63baa20fff783663d2301ad0785a2d5f2b5945..923a68bbd1167a5b7861d2b6315acf4ec55dc6ab 100644 (file)
@@ -149,6 +149,12 @@ END_EVENT_TABLE()
 
 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 )
 {
     m_needParent = FALSE;
@@ -342,9 +348,15 @@ 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;
 }