X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8cb172b4f12fae80b06d5936108a1bc7f2521674..34dc8f910f88dc39a2f5fd9c3d894d797212a074:/src/univ/winuniv.cpp diff --git a/src/univ/winuniv.cpp b/src/univ/winuniv.cpp index 5066ebe080..dbb420c484 100644 --- a/src/univ/winuniv.cpp +++ b/src/univ/winuniv.cpp @@ -5,7 +5,7 @@ // Modified by: // Created: 06.08.00 // RCS-ID: $Id$ -// Copyright: (c) 2000 Vadim Zeitlin +// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) // Licence: wxWindows license /////////////////////////////////////////////////////////////////////////////// @@ -54,6 +54,10 @@ #undef WXDEBUG_REFRESH #endif +#if defined(WXDEBUG_REFRESH) && defined(__WXMSW__) && !defined(__WXMICROWIN__) +#include "wx/msw/private.h" +#endif + // ============================================================================ // implementation // ============================================================================ @@ -69,6 +73,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxWindowGTK) #elif defined(__WXMGL__) IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxWindowMGL) +#elif defined(__WXPM__) + IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxWindowOS2) #endif BEGIN_EVENT_TABLE(wxWindow, wxWindowNative) @@ -109,12 +115,11 @@ bool wxWindow::Create(wxWindow *parent, long style, const wxString& name) { - // we add wxCLIP_CHILDREN and wxNO_FULL_REPAINT_ON_RESIZE because without - // these styles we can't get rid of flicker on wxMSW + // we add wxCLIP_CHILDREN to get the same ("natural") behaviour under MSW + // as under the other platforms if ( !wxWindowNative::Create(parent, id, pos, size, - style | - wxCLIP_CHILDREN | - wxNO_FULL_REPAINT_ON_RESIZE, name) ) + style | wxCLIP_CHILDREN, + name) ) { return FALSE; } @@ -130,11 +135,6 @@ bool wxWindow::Create(wxWindow *parent, PositionScrollbars(); } - // the colours/fonts are default - m_hasBgCol = - m_hasFgCol = - m_hasFont = FALSE; - return TRUE; } @@ -366,7 +366,7 @@ bool wxWindow::Enable(bool enable) return FALSE; // disabled window can't keep focus - if ( FindFocus() == this ) + if ( FindFocus() == this && GetParent() != NULL ) { GetParent()->SetFocus(); } @@ -482,6 +482,15 @@ wxPoint wxWindow::GetClientAreaOrigin() const void wxWindow::DoGetClientSize(int *width, int *height) const { + // if it is a native window, we assume it handles the scrollbars itself + // too - and if it doesn't, there is not much we can do + if ( !m_renderer ) + { + wxWindowNative::DoGetClientSize(width, height); + + return; + } + int w, h; wxWindowNative::DoGetClientSize(&w, &h); @@ -645,9 +654,12 @@ void wxWindow::SetScrollbar(int orient, int range, bool refresh) { + wxASSERT_MSG( pageSize <= range, + _T("page size can't be greater than range") ); + bool hasClientSizeChanged = FALSE; wxScrollBar *scrollbar = GetScrollbar(orient); - if ( range ) + if ( range && (pageSize < range) ) { if ( !scrollbar ) { @@ -720,8 +732,13 @@ void wxWindow::SetScrollPos(int orient, int pos, bool refresh) wxCHECK_RET( scrollbar, _T("no scrollbar to set position for") ); scrollbar->SetThumbPosition(pos); + + // VZ: I think we can safely ignore this as we always refresh it + // automatically whenever the value chanegs +#if 0 if ( refresh ) Refresh(); +#endif } int wxWindow::GetScrollPos(int orient) const @@ -843,7 +860,7 @@ wxRect wxWindow::ScrollNoRefresh(int dx, int dy, const wxRect *rectTotal) dcMem.SelectObject(bmp); dcMem.Blit(wxPoint(0, 0), size, &dc, ptSource -#if defined(__WXGTK__) && !defined(__WX_DC_BLIT_FIXED__) +#if defined(__WXGTK__) && !defined(wxHAS_WORKING_GTK_DC_BLIT) + GetClientAreaOrigin() #endif // broken wxGTK wxDC::Blit ); @@ -916,40 +933,6 @@ wxRect wxWindow::ScrollNoRefresh(int dx, int dy, const wxRect *rectTotal) return rect; } -// ---------------------------------------------------------------------------- -// colours/fonts -// ---------------------------------------------------------------------------- - -bool wxWindow::SetBackgroundColour(const wxColour& colour) -{ - if ( !wxWindowNative::SetBackgroundColour(colour) ) - return FALSE; - - m_hasBgCol = TRUE; - - return TRUE; -} - -bool wxWindow::SetForegroundColour(const wxColour& colour) -{ - if ( !wxWindowNative::SetForegroundColour(colour) ) - return FALSE; - - m_hasFgCol = TRUE; - - return TRUE; -} - -bool wxWindow::SetFont(const wxFont& font) -{ - if ( !wxWindowNative::SetFont(font) ) - return FALSE; - - m_hasFont = TRUE; - - return TRUE; -} - // ---------------------------------------------------------------------------- // mouse capture // ---------------------------------------------------------------------------- @@ -962,6 +945,8 @@ struct WXDLLEXPORT wxWindowNext void wxWindow::CaptureMouse() { + wxLogTrace(_T("mousecapture"), _T("CaptureMouse(0x%08x)"), this); + wxWindow *winOld = GetCapture(); if ( winOld ) { @@ -989,6 +974,10 @@ void wxWindow::ReleaseMouse() delete item; } //else: stack is empty, no previous capture + + wxLogTrace(_T("mousecapture"), + _T("After ReleaseMouse() mouse is captured by 0x%08x"), + GetCapture()); } // ----------------------------------------------------------------------------