X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/767b35a56f556e3ae3c85c00367aff64cb6e6839..5f7348ce627157e21bec507623ebd31c1e9dc762:/src/msw/window.cpp diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 950b149b59..315f7bdd6d 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -231,28 +231,6 @@ bool GetCursorPosWinCE(POINT* pt) } #endif -// --------------------------------------------------------------------------- -// wxWindowExtraData -// --------------------------------------------------------------------------- - -#if USE_DEFER_BUG_WORKAROUND -// This class is used to hold additional data memebers that were added after -// the stable 2.6.0 release. They should be moved into wxWindow for 2.7 after -// binary compatibility is no longer being maintained. - -class wxWindowExtraData { -public: - wxWindowExtraData() - : m_pendingPosition(wxDefaultPosition), - m_pendingSize(wxDefaultSize) - {} - - wxPoint m_pendingPosition; - wxSize m_pendingSize; -}; - -#endif - // --------------------------------------------------------------------------- // event tables // --------------------------------------------------------------------------- @@ -488,9 +466,8 @@ void wxWindowMSW::Init() m_lastMouseEvent = -1; #endif // wxUSE_MOUSEEVENT_HACK -#if USE_DEFER_BUG_WORKAROUND - m_extraData = new wxWindowExtraData; -#endif + m_pendingPosition = wxDefaultPosition; + m_pendingSize = wxDefaultSize; } // Destructor @@ -539,9 +516,6 @@ wxWindowMSW::~wxWindowMSW() delete m_childrenDisabled; -#if USE_DEFER_BUG_WORKAROUND - delete m_extraData; -#endif } // real construction (Init() must have been called before!) @@ -846,7 +820,7 @@ inline int GetScrollPosition(HWND hWnd, int wOrient) wOrient, &scrollInfo) ) { - // Not neccessarily an error, if there are no scrollbars yet. + // Not necessarily an error, if there are no scrollbars yet. // wxLogLastError(_T("GetScrollInfo")); } return scrollInfo.nPos; @@ -1396,7 +1370,7 @@ void wxWindowMSW::Refresh(bool eraseBack, const wxRect *rect) pRect = NULL; } - // RedrawWindow not available on SmartPhone or eVC++ 3 + // RedrawWindow not available on SmartPhone or eVC++ 3 #if !defined(__SMARTPHONE__) && !(defined(_WIN32_WCE) && _WIN32_WCE < 400) UINT flags = RDW_INVALIDATE | RDW_ALLCHILDREN; if ( eraseBack ) @@ -1612,19 +1586,19 @@ void wxWindowMSW::DoSetSize(int x, int y, int width, int height, int sizeFlags) int currentW, currentH; #if USE_DEFER_BUG_WORKAROUND - currentX = m_extraData->m_pendingPosition.x; + currentX = m_pendingPosition.x; if (currentX == wxDefaultCoord) GetPosition(¤tX, NULL); - currentY = m_extraData->m_pendingPosition.y; + currentY = m_pendingPosition.y; if (currentY == wxDefaultCoord) GetPosition(NULL, ¤tY); - currentW = m_extraData->m_pendingSize.x; + currentW = m_pendingSize.x; if (currentW == wxDefaultCoord) GetSize(¤tW, NULL); - currentH = m_extraData->m_pendingSize.y; + currentH = m_pendingSize.y; if (currentH == wxDefaultCoord) GetSize(NULL, ¤tH); #else @@ -1685,16 +1659,17 @@ void wxWindowMSW::DoSetSize(int x, int y, int width, int height, int sizeFlags) // save the pending dimensions or not. This isn't done in DoMoveWindow // (where the hdwp is used) because some controls have thier own // DoMoveWindow so it is easier to catch it here. - HDWP hdwp = GetParent() && !IsTopLevel() ? (HDWP)GetParent()->m_hDWP : NULL; + wxWindowMSW *parent = GetParent(); + HDWP hdwp = parent && !IsTopLevel() ? (HDWP)parent->m_hDWP : NULL; if (hdwp) { - m_extraData->m_pendingPosition = wxPoint(x, y); - m_extraData->m_pendingSize = wxSize(width, height); + m_pendingPosition = wxPoint(x, y); + m_pendingSize = wxSize(width, height); } else { - m_extraData->m_pendingPosition = wxDefaultPosition; - m_extraData->m_pendingSize = wxDefaultSize; + m_pendingPosition = wxDefaultPosition; + m_pendingSize = wxDefaultSize; } #endif @@ -3958,6 +3933,7 @@ extern wxCOLORMAP *wxGetStdColourMap() // we want to avoid Windows' "help" and for this we need to have a // reference bitmap which can tell us what the RGB values change // to. + wxLogNull logNo; // suppress error if we couldn't load the bitmap wxBitmap stdColourBitmap(_T("wxBITMAP_STD_COLOURS")); if ( stdColourBitmap.Ok() ) { @@ -4174,6 +4150,11 @@ bool wxWindowMSW::HandlePrintClient(WXHDC hDC) if ( IsTopLevel() || InheritsBackgroundColour() ) return false; + // sometimes we don't want the parent to handle it at all, instead + // return whatever value this window wants + if ( !MSWShouldPropagatePrintChild() ) + return MSWPrintChild(hDC, (wxWindow *)this); + for ( wxWindow *win = GetParent(); win; win = win->GetParent() ) { if ( win->MSWPrintChild(hDC, (wxWindow *)this) ) @@ -4311,9 +4292,9 @@ bool wxWindowMSW::HandleSize(int WXUNUSED(w), int WXUNUSED(h), WXUINT wParam) node; node = node->GetNext() ) { - wxWindow *child = node->GetData(); - child->m_extraData->m_pendingPosition = wxDefaultPosition; - child->m_extraData->m_pendingSize = wxDefaultSize; + wxWindowMSW *child = node->GetData(); + child->m_pendingPosition = wxDefaultPosition; + child->m_pendingSize = wxDefaultSize; } #endif } @@ -5071,7 +5052,7 @@ bool wxWindowMSW::MSWOnScroll(int orientation, WXWORD wParam, : SB_VERT, &scrollInfo) ) { - // Not neccessarily an error, if there are no scrollbars yet. + // Not necessarily an error, if there are no scrollbars yet. // wxLogLastError(_T("GetScrollInfo")); }