Refresh() didn't work as it wasn't passed to subwindows

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21754 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2003-07-08 11:19:10 +00:00
parent 3a97d2db67
commit 2f1e3c464c
3 changed files with 56 additions and 2 deletions

View File

@@ -5168,6 +5168,57 @@ void wxGenericListCtrl::RefreshItems(long itemFrom, long itemTo)
m_mainWin->RefreshLines(itemFrom, itemTo);
}
/*
* Generic wxListCtrl is more or less a container for two other
* windows which drawings are done upon. These are namely
* 'm_headerWin' and 'm_mainWin'.
* Here we override 'virtual wxWindow::Refresh()' to mimic the
* behaviour wxListCtrl has under wxMSW.
*/
void wxGenericListCtrl::Refresh(bool eraseBackground, const wxRect *rect)
{
if (!rect)
{
// The easy case, no rectangle specified.
if (m_headerWin)
m_headerWin->Refresh(eraseBackground);
if (m_mainWin)
m_mainWin->Refresh(eraseBackground);
}
else
{
// Refresh the header window
if (m_headerWin)
{
wxRect rectHeader = m_headerWin->GetRect();
rectHeader.Intersect(*rect);
if (rectHeader.GetWidth() && rectHeader.GetHeight())
{
int x, y;
m_headerWin->GetPosition(&x, &y);
rectHeader.Offset(-x, -y);
m_headerWin->Refresh(eraseBackground, &rectHeader);
}
}
// Refresh the main window
if (m_mainWin)
{
wxRect rectMain = m_mainWin->GetRect();
rectMain.Intersect(*rect);
if (rectMain.GetWidth() && rectMain.GetHeight())
{
int x, y;
m_mainWin->GetPosition(&x, &y);
rectMain.Offset(-x, -y);
m_mainWin->Refresh(eraseBackground, &rectMain);
}
}
}
}
void wxGenericListCtrl::Freeze()
{
m_mainWin->Freeze();