]> git.saurik.com Git - wxWidgets.git/commitdiff
wxWebKitCtrl now properly detects a wxNotebook anywhere in the hierarchy.
authorKevin Ollivier <kevino@theolliviers.com>
Wed, 2 Jun 2004 00:26:57 +0000 (00:26 +0000)
committerKevin Ollivier <kevino@theolliviers.com>
Wed, 2 Jun 2004 00:26:57 +0000 (00:26 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27575 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/html/htmlctrl/webkit/webkit.mm

index 93609c92948f4eae99f0f0ac2f76929264e7d318..adb86342ff202e5147157df251482d51e1d43a64 100755 (executable)
@@ -255,12 +255,21 @@ void wxWebKitCtrl::SetPageSource(wxString& source, const wxString& baseUrl){
 }
 
 void wxWebKitCtrl::OnSize(wxSizeEvent &event){
-    if ( GetParent()->IsKindOf( CLASSINFO( wxNotebook) ) ){
-        NSRect bounds = [m_webView frame];
-        bounds.origin.x += GetParent()->GetPosition().x;
-        bounds.origin.y += 18;
-        [m_webView setFrame:bounds];
-     } 
+    wxWindow* parent = GetParent();
+    bool inNotebook = false;
+    int x, y; 
+    while(parent != NULL)
+    {
+        if( parent->IsKindOf( CLASSINFO( wxNotebook ) ) ){
+            NSRect bounds = [m_webView frame];
+            bounds.origin.x += parent->GetPosition().x;
+            bounds.origin.y += 18;
+            [m_webView setFrame:bounds];
+            break;
+            }
+        parent = parent->GetParent();
+    }
+    
     [m_webView display];
     event.Skip();
 }