X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d449cf47c341df0d7ed66cbcdee38a00f6cc8aa3..1eb9ddb9f8136af0e13a767762bb52f6c23bbcd7:/src/cocoa/window.mm diff --git a/src/cocoa/window.mm b/src/cocoa/window.mm index 554fdf65b4..af1a027817 100644 --- a/src/cocoa/window.mm +++ b/src/cocoa/window.mm @@ -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,13 +165,14 @@ 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) { - wxLogDebug("wxWindow=%p::DoSetSizeWindow(%d,%d,%d,%d,Auto: %s%s)",this,x,y,width,height,(sizeFlags&wxSIZE_AUTO_WIDTH)?"W":".",sizeFlags&wxSIZE_AUTO_HEIGHT?"H":"."); +// wxLogDebug("wxWindow=%p::DoSetSizeWindow(%d,%d,%d,%d,Auto: %s%s)",this,x,y,width,height,(sizeFlags&wxSIZE_AUTO_WIDTH)?"W":".",sizeFlags&wxSIZE_AUTO_HEIGHT?"H":"."); int currentX, currentY; int currentW, currentH; DoGetPosition(¤tX, ¤tY); @@ -203,7 +212,7 @@ void wxWindowCocoa::DoSetSize(int x, int y, int width, int height, int sizeFlags void wxWindowCocoa::DoMoveWindow(int x, int y, int width, int height) { - wxLogDebug("wxWindow=%p::DoMoveWindow(%d,%d,%d,%d)",this,x,y,width,height); +// wxLogDebug("wxWindow=%p::DoMoveWindow(%d,%d,%d,%d)",this,x,y,width,height); NSView *nsview = m_dummyNSView?m_dummyNSView:m_cocoaNSView; NSView *superview = [nsview superview]; @@ -225,7 +234,7 @@ void wxWindow::DoGetSize(int *w, int *h) const *w=(int)cocoaRect.size.width; if(h) *h=(int)cocoaRect.size.height; - wxLogDebug("wxWindow=%p::DoGetSize = (%d,%d)",this,(int)cocoaRect.size.width,(int)cocoaRect.size.height); +// wxLogDebug("wxWindow=%p::DoGetSize = (%d,%d)",this,(int)cocoaRect.size.width,(int)cocoaRect.size.height); } void wxWindow::DoGetPosition(int *x, int *y) const @@ -240,7 +249,7 @@ void wxWindow::DoGetPosition(int *x, int *y) const *x=(int)cocoaRect.origin.x; if(y) *y=(int)(parentRect.size.height-(cocoaRect.origin.y+cocoaRect.size.height)); - wxLogDebug("wxWindow=%p::DoGetPosition = (%d,%d)",this,(int)cocoaRect.origin.x,(int)cocoaRect.origin.y); +// wxLogDebug("wxWindow=%p::DoGetPosition = (%d,%d)",this,(int)cocoaRect.origin.x,(int)cocoaRect.origin.y); } WXWidget wxWindow::GetHandle() const @@ -248,6 +257,11 @@ WXWidget wxWindow::GetHandle() const return m_cocoaNSView; } +void wxWindow::Refresh(bool eraseBack, const wxRect *rect) +{ + [m_cocoaNSView setNeedsDisplay:YES]; +} + void wxWindow::SetFocus() { // TODO @@ -305,11 +319,6 @@ void wxWindow::GetTextExtent(const wxString& string, int *x, int *y, // TODO } -void wxWindow::Refresh(bool eraseBack, const wxRect *rect) -{ - // TODO -} - // Coordinates relative to the window void wxWindow::WarpPointer (int x_pos, int y_pos) {