mirror of https://github.com/BOINC/boinc.git
MGR: When erasing controls in Simple Preferences dialog, align background image correctly for controls that are descendants of the dialog deeper than one level (grandchild, great-grandchild, etc.)
This commit is contained in:
parent
4f0fadc34c
commit
47bd5c0685
|
@ -180,8 +180,14 @@ void CTransparentHyperlinkCtrl::OnEraseBackground(wxEraseEvent& event)
|
|||
wxMemoryDC memDC(**m_pParentsBgBmp);
|
||||
wxSize sz = GetClientSize();
|
||||
wxDC *dc = event.GetDC();
|
||||
wxCoord x, y;
|
||||
GetPosition(&x, &y);
|
||||
wxCoord x=0, y=0, xx, yy;
|
||||
wxWindow* win = this;
|
||||
do {
|
||||
win->GetPosition(&xx, &yy);
|
||||
x += xx;
|
||||
y += yy;
|
||||
win = win->GetParent();
|
||||
} while (!win->IsTopLevel());
|
||||
dc->Blit(0, 0, sz.GetWidth(), sz.GetHeight(), &memDC, x, y, wxCOPY);
|
||||
} else {
|
||||
event.Skip();
|
||||
|
@ -365,8 +371,14 @@ void CTransparentCheckBox::OnEraseBackground(wxEraseEvent& event)
|
|||
wxMemoryDC memDC(**m_pParentsBgBmp);
|
||||
wxSize sz = GetClientSize();
|
||||
wxDC *dc = event.GetDC();
|
||||
wxCoord x, y;
|
||||
GetPosition(&x, &y);
|
||||
wxCoord x=0, y=0, xx, yy;
|
||||
wxWindow* win = this;
|
||||
do {
|
||||
win->GetPosition(&xx, &yy);
|
||||
x += xx;
|
||||
y += yy;
|
||||
win = win->GetParent();
|
||||
} while (!win->IsTopLevel());
|
||||
dc->Blit(0, 0, sz.GetWidth(), sz.GetHeight(), &memDC, x, y, wxCOPY);
|
||||
} else {
|
||||
event.Skip();
|
||||
|
|
Loading…
Reference in New Issue