From 05d14b3fa01469ec45b6b988ebe93094d2d9df8b Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Wed, 7 Mar 2007 05:16:51 +0000 Subject: [PATCH] fix bug in drawing of canvas scrollbars in the case that the canvas has not yet been moved svn: r5745 --- src/mred/wxme/wx_medad.cxx | 8 ++++++++ src/wxmac/src/mac/wx_canvs.cc | 7 +++++++ src/wxmac/src/mac/wx_win.cc | 3 +++ 3 files changed, 18 insertions(+) diff --git a/src/mred/wxme/wx_medad.cxx b/src/mred/wxme/wx_medad.cxx index 7fc44e1933..20ab0723d4 100644 --- a/src/mred/wxme/wx_medad.cxx +++ b/src/mred/wxme/wx_medad.cxx @@ -215,6 +215,14 @@ wxMediaCanvas::wxMediaCanvas(wxWindow *parent, 1, 1, #endif 1, 1, 0, 0, FALSE); + +#ifdef wx_mac + /* Fixes update, somehow. There's a similar call in + the constructor for wxCanvas, but somehow we need + another one after SetScrollbars: */ + OnClientAreaDSize(1, 1, 1, 1); +#endif + if (fakeXScroll) { SimpleScroll *ss; ss = new WXGC_PTRS SimpleScroll(this, wxHORIZONTAL, 0, 1, 0) ; diff --git a/src/wxmac/src/mac/wx_canvs.cc b/src/wxmac/src/mac/wx_canvs.cc index d99b0723de..87c5043953 100644 --- a/src/wxmac/src/mac/wx_canvs.cc +++ b/src/wxmac/src/mac/wx_canvs.cc @@ -167,6 +167,13 @@ void wxCanvas::InitDefaults(wxGLConfig *gl_cfg) if (cStyle & wxINVISIBLE) Show(FALSE); InitInternalGray(); + + if (cStyle & wxVSCROLL || cStyle & wxHSCROLL) { + /* Somehow fixes initial update. There's another + call like this one in the constructor for + wxMediaCanvas. */ + OnClientAreaDSize(1, 1, 1, 1); + } } //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/src/wxmac/src/mac/wx_win.cc b/src/wxmac/src/mac/wx_win.cc index ef648385d4..833c6bc5da 100644 --- a/src/wxmac/src/mac/wx_win.cc +++ b/src/wxmac/src/mac/wx_win.cc @@ -769,6 +769,7 @@ void wxWindow::SetSize(int x, int y, int width, int height, int flags) // mac pl int dH = cWindowHeight - oldWindowHeight; int dX = cWindowX - oldWindowX; int dY = cWindowY - oldWindowY; + OnWindowDSize(dW, dH, dX, dY); } } @@ -1159,6 +1160,8 @@ void wxWindow::GetClipRect(wxArea* area, Rect* clipRect) // get clipRect in area c.s. ::SetRect(clipRect, 0, 0, area->Width(), area->Height()); // area c.s. + // Clipping to the parent area should be unnecessary. + // Try disabling this sometime... [2007-MAR-07] if (ParentArea()) { wxWindow* windowParent; Rect parentClipRect;