+ else{
+ if (!parent->IsTopLevel()) {
+ //printf("Parent: %s\n", parent->GetClassInfo()->GetClassName());
+ int plusx = 0;
+ plusx = parent->GetClientAreaOrigin().x + parent->GetPosition().x;
+ if (plusx > 0){
+ x += plusx;
+ //printf("Parent: %s Added x: %d\n", parent->GetClassInfo()->GetClassName(), parent->GetClientAreaOrigin().x + parent->GetPosition().x);
+ }
+
+ int plusy = 0;
+ plusy = parent->GetClientAreaOrigin().y + parent->GetPosition().y;
+ if (plusy > 0){
+ y += plusy;
+ //printf("Parent: %s Added y: %d\n", parent->GetClassInfo()->GetClassName(), parent->GetClientAreaOrigin().y + parent->GetPosition().y);
+ }
+ else{
+ //printf("Parent: %s Origin: %d Position:%d\n", parent->GetClassInfo()->GetClassName(), parent->GetClientAreaOrigin().y, parent->GetPosition().y);
+ }
+
+ }
+ else{
+ //
+ x += parent->GetClientAreaOrigin().x;
+ // calculate the title bar height (26 pixels) into the top offset.
+ // This becomes important later when we must flip the y coordinate
+ // to convert to Cocoa's coordinate system.
+ y += parent->GetClientAreaOrigin().y += 26;
+ //printf("x: %d, y:%d\n", x, y);
+ }
+ //we still need to add the y, because we have to convert/flip coordinates for Cocoa
+
+ if ( parent->IsKindOf( CLASSINFO( wxNotebook ) ) ){
+ //Not sure why calcs are off in this one scenario...
+ y -= 4;
+ //printf("x: %d, y:%d\n", x, y);
+ }
+
+ if (parent->IsKindOf( CLASSINFO( wxPanel ) ) ){
+ // Another strange case. Adding a wxPanel to the parent heirarchy
+ // causes wxWebKitCtrl's Cocoa y origin to be 4 pixels off
+ // for some reason, even if the panel has a position and origin of 0.
+ // This corrects that. Man, I wish I could debug Carbon/HIWebView!! ;)
+ y -= 4;