mirror of https://github.com/BOINC/boinc.git
MGR: To reduce flicker, redraw only changed cells in List Control on non-Mac systems
svn path=/trunk/boinc/; revision=16185
This commit is contained in:
parent
d2332b193f
commit
2277846114
|
@ -8264,3 +8264,11 @@ Charlie 9 Oct 2008
|
||||||
|
|
||||||
clientgui/
|
clientgui/
|
||||||
sg_SGUIListControl.cpp,.h
|
sg_SGUIListControl.cpp,.h
|
||||||
|
|
||||||
|
Charlie 10 Oct 2008
|
||||||
|
- MGR: To reduce flicker, redraw only changed cells in List Control
|
||||||
|
(not entire row) on non-Mac systems.
|
||||||
|
|
||||||
|
clientgui/
|
||||||
|
BOINCBaseView.cpp
|
||||||
|
BOINCListCtrl.cpp,.h
|
||||||
|
|
|
@ -466,13 +466,19 @@ int CBOINCBaseView::SynchronizeCache() {
|
||||||
|
|
||||||
for (iColumnIndex = 0; iColumnIndex < iColumnTotal; iColumnIndex++) {
|
for (iColumnIndex = 0; iColumnIndex < iColumnTotal; iColumnIndex++) {
|
||||||
if (SynchronizeCacheItem(iRowIndex, iColumnIndex)) {
|
if (SynchronizeCacheItem(iRowIndex, iColumnIndex)) {
|
||||||
|
#ifdef __WXMAC__
|
||||||
bNeedRefreshData = true;
|
bNeedRefreshData = true;
|
||||||
|
#else
|
||||||
|
// To reduce flicker, refresh only changed columns
|
||||||
|
m_pListPane->RefreshCell(iRowIndex, iColumnIndex);
|
||||||
|
#endif
|
||||||
if (iColumnIndex == m_iSortColumn) {
|
if (iColumnIndex == m_iSortColumn) {
|
||||||
bNeedSort = true;
|
bNeedSort = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Mac is double-buffered to avoid flicker, so this is more efficient
|
||||||
if (bNeedRefreshData) {
|
if (bNeedRefreshData) {
|
||||||
m_pListPane->RefreshItem(iRowIndex);
|
m_pListPane->RefreshItem(iRowIndex);
|
||||||
}
|
}
|
||||||
|
|
|
@ -412,4 +412,27 @@ void MyEvtHandler::OnPaint(wxPaintEvent & event)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
// To reduce flicker, refresh only changed columns (except
|
||||||
|
// on Mac, which is double-buffered to eliminate flicker.)
|
||||||
|
void CBOINCListCtrl::RefreshCell(int row, int col) {
|
||||||
|
wxRect r;
|
||||||
|
|
||||||
|
#if (defined (__WXMSW__) && wxCHECK_VERSION(2,8,0))
|
||||||
|
GetSubItemRect(row, col, r);
|
||||||
|
#else
|
||||||
|
int i;
|
||||||
|
|
||||||
|
GetItemRect(row, r);
|
||||||
|
#if ! USE_NATIVE_LISTCONTROL
|
||||||
|
r.y = r.y - GetHeaderHeight() - 1;
|
||||||
|
#endif
|
||||||
|
for (i=0; i< col; i++) {
|
||||||
|
r.x += GetColumnWidth(i);
|
||||||
|
}
|
||||||
|
r.width = GetColumnWidth(col);;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
RefreshRect(r);
|
||||||
|
}
|
||||||
|
|
||||||
const char *BOINC_RCSID_5cf411daa0 = "$Id$";
|
const char *BOINC_RCSID_5cf411daa0 = "$Id$";
|
||||||
|
|
|
@ -62,6 +62,7 @@ public:
|
||||||
long GetNextSelected(int i) { return GetNextItem(i, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); }
|
long GetNextSelected(int i) { return GetNextItem(i, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); }
|
||||||
void SelectRow(int row, bool setSelected);
|
void SelectRow(int row, bool setSelected);
|
||||||
void AddPendingProgressBar(int row);
|
void AddPendingProgressBar(int row);
|
||||||
|
void RefreshCell(int row, int col);
|
||||||
|
|
||||||
bool m_bIsSingleSelection;
|
bool m_bIsSingleSelection;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue