made ProvideBackground() const

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17329 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2002-09-21 20:38:05 +00:00
parent a34d639546
commit ad2e39c11d
4 changed files with 36 additions and 35 deletions

View File

@@ -83,7 +83,7 @@ public:
#ifdef __WXUNIVERSAL__ #ifdef __WXUNIVERSAL__
virtual bool IsCanvasWindow() const { return TRUE; } virtual bool IsCanvasWindow() const { return TRUE; }
virtual bool ProvidesBackground() { return TRUE; } virtual bool ProvidesBackground() const { return TRUE; }
#endif #endif
WX_DECLARE_CONTROL_CONTAINER(); WX_DECLARE_CONTROL_CONTAINER();

View File

@@ -143,7 +143,7 @@ public:
virtual int GetMinWidth() const; virtual int GetMinWidth() const;
virtual int GetMinHeight() const; virtual int GetMinHeight() const;
virtual bool ProvidesBackground() { return TRUE; } virtual bool ProvidesBackground() const { return TRUE; }
protected: protected:
// handle titlebar button click event // handle titlebar button click event

View File

@@ -179,7 +179,7 @@ public:
// to be used with function above: transparent windows get // to be used with function above: transparent windows get
// their background from parents that return TRUE here, // their background from parents that return TRUE here,
// so this is mostly for wxPanel, wxTopLevelWindow etc. // so this is mostly for wxPanel, wxTopLevelWindow etc.
virtual bool ProvidesBackground() { return FALSE; } virtual bool ProvidesBackground() const { return FALSE; }
// return TRUE if this control can be highlighted when the mouse is over // return TRUE if this control can be highlighted when the mouse is over
// it (the theme decides itself whether it is really highlighted or not) // it (the theme decides itself whether it is really highlighted or not)

View File

@@ -274,7 +274,8 @@ bool wxWindow::DoDrawBackground(wxDC& dc)
rect.width = size.x; rect.width = size.x;
rect.height = size.y; rect.height = size.y;
if (HasTransparentBackground() && GetParent() && GetParent()->ProvidesBackground()) wxWindow * const parent = GetParent();
if ( HasTransparentBackground() && parent && parent->ProvidesBackground() )
{ {
wxASSERT( !IsTopLevel() ); wxASSERT( !IsTopLevel() );
@@ -294,12 +295,12 @@ bool wxWindow::DoDrawBackground(wxDC& dc)
rect.y = pos.y; rect.y = pos.y;
// Let parent draw the background // Let parent draw the background
GetParent()->EraseBackground( dc, rect ); parent->EraseBackground( dc, rect );
} }
else else
{ {
// Draw background ouselves // Draw background ouselves
EraseBackground( dc, rect ); EraseBackground( dc, rect );
} }
return TRUE; return TRUE;
@@ -915,7 +916,7 @@ void wxWindow::ScrollWindow(int dx, int dy, const wxRect *rect)
wxWindowNative::ScrollWindow(dx, dy, rect); wxWindowNative::ScrollWindow(dx, dy, rect);
#else #else // !wxX11
// before scrolling it, ensure that we don't have any unpainted areas // before scrolling it, ensure that we don't have any unpainted areas
Update(); Update();
@@ -971,7 +972,7 @@ void wxWindow::ScrollWindow(int dx, int dy, const wxRect *rect)
child->Move(child->GetPosition() + offset); child->Move(child->GetPosition() + offset);
} }
} }
#endif #endif // wxX11/!wxX11
} }
wxRect wxWindow::ScrollNoRefresh(int dx, int dy, const wxRect *rectTotal) wxRect wxWindow::ScrollNoRefresh(int dx, int dy, const wxRect *rectTotal)