]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/nonownedwnd_osx.cpp
Get wxSearchCtrl text events working, and share the text event handler code among...
[wxWidgets.git] / src / osx / nonownedwnd_osx.cpp
index bdc9be1d32f0efb777e5ba90e9f5bd313160d46f..017107215f22521e3e247c280e9dc01380018a69 100644 (file)
@@ -159,12 +159,26 @@ wxNonOwnedWindow::~wxNonOwnedWindow()
     DestroyChildren();
 
     delete m_nowpeer;
     DestroyChildren();
 
     delete m_nowpeer;
+    m_nowpeer = NULL;
 
     // avoid dangling refs
     if ( s_macDeactivateWindow == this )
         s_macDeactivateWindow = NULL;
 }
 
 
     // avoid dangling refs
     if ( s_macDeactivateWindow == this )
         s_macDeactivateWindow = NULL;
 }
 
+bool wxNonOwnedWindow::Destroy()
+{
+    WillBeDestroyed();
+    
+    return wxWindow::Destroy();
+}
+
+void wxNonOwnedWindow::WillBeDestroyed()
+{
+    if ( m_nowpeer )
+        m_nowpeer->WillBeDestroyed();
+}
+
 // ----------------------------------------------------------------------------
 // wxNonOwnedWindow misc
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 // wxNonOwnedWindow misc
 // ----------------------------------------------------------------------------
@@ -217,6 +231,17 @@ bool wxNonOwnedWindow::SetBackgroundColour(const wxColour& c )
     return true;
 }
 
     return true;
 }
 
+void wxNonOwnedWindow::SetWindowStyleFlag(long flags)
+{
+    if (flags == GetWindowStyleFlag())
+        return;
+        
+    wxWindow::SetWindowStyleFlag(flags);
+    
+    if (m_nowpeer)
+        m_nowpeer->SetWindowStyleFlag(flags);
+}
+
 // Raise the window to the top of the Z order
 void wxNonOwnedWindow::Raise()
 {
 // Raise the window to the top of the Z order
 void wxNonOwnedWindow::Raise()
 {