even controls with transparent background should draw it if they have an explicitly set background colour, so handle this at wxWindowUniv level instead of adding hacks to individual controls, such as wxStaticText, to deal with this (replaces patch 1700004) [backport from HEAD]

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@45447 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2007-04-14 01:17:28 +00:00
parent 127e4f1caf
commit 0a3c4e03f4
3 changed files with 2 additions and 9 deletions

View File

@@ -117,6 +117,7 @@ wxGTK:
wxUniv: wxUniv:
- Fix wxTextCtrl::SetSelection(-1, -1) to behave as documented (Anders Larsen) - Fix wxTextCtrl::SetSelection(-1, -1) to behave as documented (Anders Larsen)
- Fix setting background colour for controls with transparent background
2.8.3 2.8.3

View File

@@ -88,14 +88,6 @@ wxSize wxStaticText::DoGetBestClientSize() const
void wxStaticText::DoDraw(wxControlRenderer *renderer) void wxStaticText::DoDraw(wxControlRenderer *renderer)
{ {
if ( UseBgCol() )
{
wxDC& dc = renderer->GetDC();
dc.SetBrush(GetBackgroundColour());
dc.SetPen(*wxTRANSPARENT_PEN);
dc.DrawRectangle(renderer->GetRect());
}
renderer->DrawLabel(); renderer->DrawLabel();
} }

View File

@@ -336,7 +336,7 @@ bool wxWindow::DoDrawBackground(wxDC& dc)
rect.height = size.y; rect.height = size.y;
wxWindow * const parent = GetParent(); wxWindow * const parent = GetParent();
if ( HasTransparentBackground() && parent ) if ( HasTransparentBackground() && !UseBgCol() && parent )
{ {
wxASSERT( !IsTopLevel() ); wxASSERT( !IsTopLevel() );