]> git.saurik.com Git - wxWidgets.git/blobdiff - src/cocoa/window.mm
Applied patch [ 708377 ] Make NET (smapi.cpp) UNICODE compatible
[wxWidgets.git] / src / cocoa / window.mm
index 92adb08bc4a085252cb11c5712dcaaffe36e1555..31c729fcca4e6c8022e04a88ade01b47157011fa 100644 (file)
@@ -116,6 +116,15 @@ void wxWindowCocoa::SetNSView(WX_NSView cocoaNSView)
     if(need_debug) wxLogDebug("wxWindowCocoa=%p::SetNSView [cocoaNSView=%p retainCount]=%d",this,cocoaNSView,[cocoaNSView retainCount]);
 }
 
+bool wxWindowCocoa::Cocoa_drawRect(const NSRect &rect)
+{
+    wxLogDebug("Cocoa_drawRect");
+    //FIXME: should probably turn that rect into the update region
+    wxPaintEvent event(m_windowId);
+    event.SetEventObject(this);
+    return GetEventHandler()->ProcessEvent(event);
+}
+
 void wxWindowCocoa::Cocoa_FrameChanged(void)
 {
     wxLogDebug("Cocoa_FrameChanged");
@@ -148,7 +157,6 @@ bool wxWindow::Show(bool show)
         // But since we also retained it ourselves
         [m_dummyNSView release];
         m_dummyNSView = nil;
-        return true;
     }
     else
     {
@@ -157,8 +165,9 @@ bool wxWindow::Show(bool show)
         // NOTE: replaceSubView will cause m_cocaNSView to be released
         [[m_cocoaNSView superview] replaceSubview:m_cocoaNSView with:m_dummyNSView];
         // m_coocaNSView is now only retained by us
-        return true;
     }
+    m_isShown = show;
+    return true;
 }
 
 void wxWindowCocoa::DoSetSize(int x, int y, int width, int height, int sizeFlags)
@@ -205,7 +214,8 @@ void wxWindowCocoa::DoMoveWindow(int x, int y, int width, int height)
 {
     wxLogDebug("wxWindow=%p::DoMoveWindow(%d,%d,%d,%d)",this,x,y,width,height);
 
-    NSView *superview = [m_cocoaNSView superview];
+    NSView *nsview = m_dummyNSView?m_dummyNSView:m_cocoaNSView;
+    NSView *superview = [nsview superview];
     wxCHECK_RET(superview,"NSView does not have a superview");
     NSRect parentRect = [superview frame];
 
@@ -229,11 +239,12 @@ void wxWindow::DoGetSize(int *w, int *h) const
 
 void wxWindow::DoGetPosition(int *x, int *y) const
 {
-    NSView *superview = [m_cocoaNSView superview];
+    NSView *nsview = m_dummyNSView?m_dummyNSView:m_cocoaNSView;
+    NSView *superview = [nsview superview];
     wxCHECK_RET(superview,"NSView does not have a superview");
     NSRect parentRect = [superview frame];
 
-    NSRect cocoaRect = [m_cocoaNSView frame];
+    NSRect cocoaRect = [nsview frame];
     if(x)
         *x=(int)cocoaRect.origin.x;
     if(y)