]> git.saurik.com Git - wxWidgets.git/commitdiff
Forward port event handler fixes to trunk.
authorKevin Ollivier <kevino@theolliviers.com>
Sat, 22 Nov 2008 04:10:31 +0000 (04:10 +0000)
committerKevin Ollivier <kevino@theolliviers.com>
Sat, 22 Nov 2008 04:10:31 +0000 (04:10 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56886 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/osx/carbon/private/mactext.h
include/wx/osx/carbon/toplevel.h
include/wx/osx/uma.h
src/html/htmlctrl/webkit/webkit.mm
src/osx/carbon/textctrl.cpp
src/osx/toplevel_osx.cpp

index e401f2b65271d39a6b623f70f20f98a0e7b5878d..5cbeb0a2dc91fbf759dc09e5d0cbd0fdd13fa14b 100644 (file)
@@ -45,6 +45,7 @@ protected :
 
     // contains the tag for the content (is different for password and non-password controls)
     OSType m_valueTag ;
+    WXEVENTHANDLERREF    m_macTextCtrlEventHandler ;
 public :
     ControlEditTextSelectionRec m_selection ;
 };
index 726c5d256a800117136105ad7692e8d293287f7d..7983b8c5c6adb1b03df4aee496ae3ce2be10aa38 100644 (file)
@@ -44,6 +44,8 @@ public:
                 const wxString& name = wxFrameNameStr);
 
     virtual ~wxTopLevelWindowMac();
+    
+    virtual bool Destroy();
 
     virtual wxPoint GetClientAreaOrigin() const;
 
index 899dae109e7de7b32be8e1b32a4c7330a8c2bb4d..451f2f71f67a74e96037774cb44e5a01f964608f 100644 (file)
@@ -1,3 +1,3 @@
-#if __WXOSX_CARBON__
+#if wxOSX_USE_CARBON
 #include "wx/osx/carbon/uma.h"
 #endif
index 27216cb00b34cc72afebc37dc6517c872425bb38..7e28d801ed57625ddf7c017c74d5d98c48a8d50d 100644 (file)
@@ -468,7 +468,16 @@ bool wxWebKitCtrl::Create(wxWindow *parent,
 
 wxWebKitCtrl::~wxWebKitCtrl()
 {
-
+    MyFrameLoadMonitor* myFrameLoadMonitor = [m_webView frameLoadDelegate];
+    MyPolicyDelegate* myPolicyDelegate = [m_webView policyDelegate];
+    [m_webView setFrameLoadDelegate: nil];
+    [m_webView setPolicyDelegate: nil];
+    
+    if (myFrameLoadMonitor)
+        [myFrameLoadMonitor release];
+        
+    if (myPolicyDelegate)
+        [myPolicyDelegate release];
 }
 
 // ----------------------------------------------------------------------------
index fc308b671229bb40f6fa7f26f9abf725852c130f..ee9dd86becd748071da269812aa249c2d9f99c0e 100644 (file)
@@ -509,11 +509,12 @@ void wxMacUnicodeTextControl::InstallEventHandlers()
 {
     ::InstallControlEventHandler( m_controlRef , GetwxMacUnicodeTextControlEventHandlerUPP(),
                                 GetEventTypeCount(unicodeTextControlEventList), unicodeTextControlEventList, this,
-                                NULL);
+                                (EventHandlerRef*) &m_macTextCtrlEventHandler);
 }
 
 wxMacUnicodeTextControl::~wxMacUnicodeTextControl()
 {
+    ::RemoveEventHandler((EventHandlerRef) m_macTextCtrlEventHandler);
 }
 
 void wxMacUnicodeTextControl::VisibilityChanged(bool shown)
index 1886e988c9bb4be69477ff7a627b9d23abb19b3b..738b5d607d38f899c0fe7b3a7f2889393379748d 100644 (file)
@@ -87,6 +87,17 @@ wxTopLevelWindowMac::~wxTopLevelWindowMac()
 {
 }
 
+bool wxTopLevelWindowMac::Destroy()
+{
+    // NB: this will get called during destruction if we don't do it now,
+    // and may fire a kill focus event on a control being destroyed
+#if wxOSX_USE_CARBON
+    if (m_nowpeer->GetWXWindow())
+        ClearKeyboardFocus( (WindowRef)m_nowpeer->GetWXWindow() );
+#endif
+    return wxTopLevelWindowBase::Destroy();
+}
+
 
 // ----------------------------------------------------------------------------
 // wxTopLevelWindowMac maximize/minimize