]> git.saurik.com Git - wxWidgets.git/blobdiff - src/motif/window.cpp
Up-ported code to make tree item visible when programmatically
[wxWidgets.git] / src / motif / window.cpp
index c639ebf2107321e7f5abe12a6948fd865831c512..b2f4037d0ee0468160dabd288c1e339242a7ce7e 100644 (file)
@@ -80,6 +80,8 @@ static const int SCROLL_MARGIN = 4;
 // ----------------------------------------------------------------------------
 
 extern wxHashTable *wxWidgetHashTable;
 // ----------------------------------------------------------------------------
 
 extern wxHashTable *wxWidgetHashTable;
+static wxWindow* g_captureWindow = NULL;
+
 
 // ----------------------------------------------------------------------------
 // private functions
 
 // ----------------------------------------------------------------------------
 // private functions
@@ -383,6 +385,9 @@ bool wxWindow::Create(wxWindow *parent, wxWindowID id,
 // Destructor
 wxWindow::~wxWindow()
 {
 // Destructor
 wxWindow::~wxWindow()
 {
+    if (g_captureWindow == this)
+       g_captureWindow = NULL;
+    
     m_isBeingDeleted = TRUE;
     
     // Motif-specific actions first
     m_isBeingDeleted = TRUE;
     
     // Motif-specific actions first
@@ -710,6 +715,7 @@ wxString wxWindow::GetTitle() const
 
 void wxWindow::CaptureMouse()
 {
 
 void wxWindow::CaptureMouse()
 {
+    g_captureWindow = this;
     if ( m_winCaptured )
         return;
 
     if ( m_winCaptured )
         return;
 
@@ -722,6 +728,7 @@ void wxWindow::CaptureMouse()
 
 void wxWindow::ReleaseMouse()
 {
 
 void wxWindow::ReleaseMouse()
 {
+    g_captureWindow = NULL;
     if ( !m_winCaptured )
         return;
 
     if ( !m_winCaptured )
         return;
 
@@ -2977,6 +2984,13 @@ wxWindow *wxGetActiveWindow()
     return NULL;
 }
 
     return NULL;
 }
 
+/* static */
+wxWindow *wxWindowBase::GetCapture()
+{
+    return (wxWindow *)g_captureWindow;
+}
+
+
 // Find the wxWindow at the current mouse position, returning the mouse
 // position.
 wxWindow* wxFindWindowAtPointer(wxPoint& pt)
 // Find the wxWindow at the current mouse position, returning the mouse
 // position.
 wxWindow* wxFindWindowAtPointer(wxPoint& pt)
@@ -3001,12 +3015,10 @@ wxPoint wxGetMousePosition()
     return wxPoint(rootX, rootY);
 }
 
     return wxPoint(rootX, rootY);
 }
 
+
 // ----------------------------------------------------------------------------
 // wxNoOptimize: switch off size optimization
 // ----------------------------------------------------------------------------
 
 int wxNoOptimize::ms_count = 0;
 
 // ----------------------------------------------------------------------------
 // wxNoOptimize: switch off size optimization
 // ----------------------------------------------------------------------------
 
 int wxNoOptimize::ms_count = 0;
 
-
-
-