Changeset 3242 for trunk/src/comctl32/listview.cpp
- Timestamp:
- Mar 26, 2000, 6:32:33 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/comctl32/listview.cpp
r3216 r3242 1 /*$Id: listview.cpp,v 1. 7 2000-03-24 17:14:02cbratschi Exp $*/1 /*$Id: listview.cpp,v 1.8 2000-03-26 16:32:33 cbratschi Exp $*/ 2 2 /* 3 3 * Listview control … … 160 160 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd); 161 161 162 if (infoPtr-> refreshFlags & (RF_REFRESH | RF_NOREDRAW)) return;162 if (infoPtr->internalFlags & IF_NOREDRAW) return; 163 163 164 164 if ((infoPtr->uView == LVS_REPORT) && !(infoPtr->dwStyle & LVS_NOCOLUMNHEADER)) … … 174 174 } 175 175 176 static VOID LISTVIEW_QueueRefresh(HWND hwnd)176 static LRESULT LISTVIEW_Timer(HWND hwnd,WPARAM wParam,LPARAM lParam) 177 177 { 178 178 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd); 179 179 180 if (infoPtr->refreshFlags & RF_NOREDRAW) return; 181 182 if (infoPtr->refreshFlags & RF_REFRESH) 183 KillTimer (hwnd,LV_REFRESH_TIMER); 184 infoPtr->refreshFlags |= RF_REFRESH; 185 SetTimer(hwnd,LV_REFRESH_TIMER,LV_REFRESH_DELAY,0); 186 } 187 188 static LRESULT LISTVIEW_Timer(HWND hwnd,WPARAM wParam,LPARAM lParam) 189 { 190 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd); 191 192 switch (wParam) 193 { 194 case LV_REFRESH_TIMER: 195 KillTimer(hwnd,LV_REFRESH_TIMER); 196 if (infoPtr->refreshFlags & RF_UPDATESCROLL) 197 { 198 LISTVIEW_UpdateScroll(hwnd); 199 infoPtr->refreshFlags &= ~RF_UPDATESCROLL; 200 } 201 if (infoPtr->refreshFlags & RF_REFRESH) 202 { 203 infoPtr->refreshFlags &= ~RF_REFRESH; 204 LISTVIEW_Refresh(hwnd); 205 } 206 return 0; 207 } 208 209 return 1; 180 return DefWindowProcA(hwnd,WM_TIMER,wParam,lParam); 210 181 } 211 182 … … 215 186 RECT rect; 216 187 217 if (infoPtr-> refreshFlags & (RF_REFRESH | RF_NOREDRAW)) return;188 if (infoPtr->internalFlags & IF_NOREDRAW) return; 218 189 LISTVIEW_GetItemRect(hwnd,nItem,&rect,LVIR_SELECTBOUNDS); 219 190 … … 238 209 INT xOffset = infoPtr->lefttop.x*infoPtr->scrollStep.x; 239 210 240 if (infoPtr-> refreshFlags & (RF_REFRESH | RF_NOREDRAW)) return;211 if (infoPtr->internalFlags & IF_NOREDRAW) return; 241 212 LISTVIEW_GetItemRect(hwnd,nItem,&rect,LVIR_SELECTBOUNDS); 242 213 … … 267 238 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd); 268 239 269 if (infoPtr-> refreshFlags & (RF_REFRESH | RF_NOREDRAW)) return;240 if (infoPtr->internalFlags & IF_NOREDRAW) return; 270 241 271 242 if ((infoPtr->uView == LVS_REPORT) && !(infoPtr->dwStyle & LVS_NOCOLUMNHEADER)) … … 2751 2722 2752 2723 /* refresh client area */ 2753 infoPtr->refreshFlags |= RF_UPDATESCROLL;2754 LISTVIEW_ QueueRefresh(hwnd);2724 LISTVIEW_UpdateScroll(hwnd); 2725 LISTVIEW_Refresh(hwnd); 2755 2726 } 2756 2727 … … 5135 5106 infoPtr->nItemWidth = LISTVIEW_GetItemWidth(hwnd); 5136 5107 5137 infoPtr->refreshFlags |= RF_UPDATESCROLL;5138 LISTVIEW_ QueueRefresh(hwnd);5108 LISTVIEW_UpdateScroll(hwnd); 5109 LISTVIEW_Refresh(hwnd); 5139 5110 } 5140 5111 … … 5271 5242 5272 5243 /* refresh client area */ 5273 infoPtr->refreshFlags |= RF_UPDATESCROLL;5274 LISTVIEW_ QueueRefresh(hwnd);5244 LISTVIEW_UpdateScroll(hwnd); 5245 LISTVIEW_Refresh(hwnd); 5275 5246 } 5276 5247 } … … 5551 5522 infoPtr->nItemWidth = LISTVIEW_GetItemWidth(hwnd); 5552 5523 5553 LISTVIEW_ QueueRefresh(hwnd); // force redraw of the listview5524 LISTVIEW_Refresh(hwnd); // force redraw of the listview 5554 5525 5555 5526 return lret; … … 5671 5642 HDPA hdpaSubItems; 5672 5643 NMLISTVIEW nmlv; 5673 5644 //CB: LVS_REPORT (and other) and new text: invalidate if item rect > nItemWidth 5674 5645 if (lpLVItem != NULL) 5675 5646 { … … 6167 6138 static LRESULT LISTVIEW_Create(HWND hwnd, WPARAM wParam, LPARAM lParam) 6168 6139 { 6169 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO 6140 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd); 6170 6141 LPCREATESTRUCTA lpcs = (LPCREATESTRUCTA)lParam; 6171 6142 UINT uView = lpcs->style & LVS_TYPEMASK; … … 6627 6598 return 0; 6628 6599 6629 infoPtr = (LISTVIEW_INFO *)GetWindowLongA(hwnd, 0);6600 infoPtr = (LISTVIEW_INFO*)getInfoPtr(hwnd); 6630 6601 6631 6602 if ( !infoPtr ) … … 7017 6988 LISTVIEW_INFO *infoPtr; 7018 6989 7019 //TRACE("(hwnd=%x,wParam=%x,lParam=%lx)\n", hwnd, wParam, lParam);7020 7021 6990 /* allocate memory for info structure */ 7022 6991 infoPtr = (LISTVIEW_INFO*)initControl(hwnd,sizeof(LISTVIEW_INFO)); … … 7230 7199 { 7231 7200 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd); 7232 INT nCtrlId = GetWindowLongA(hwnd, GWL_ID);7233 7234 // TRACE("(hwnd=%x,key=%hu,X=%hu,Y=%hu)\n", hwnd, wKey, wPosX, wPosY);7235 7201 7236 7202 if (infoPtr->bRButtonDown != FALSE) … … 7340 7306 if (bRedraw) 7341 7307 { 7342 infoPtr-> refreshFlags &= ~RF_NOREDRAW;7308 infoPtr->internalFlags &= ~IF_NOREDRAW; 7343 7309 lResult = DefWindowProcA(hwnd, WM_SETREDRAW, bRedraw, 0); 7344 7310 7345 7311 LISTVIEW_UpdateScroll(hwnd); 7346 //CB: WINE calls RedrawWindow but many (all?) programs invalidate the control themself 7347 // RedrawWindow(hwnd,NULL,0,RDW_INVALIDATE | RDW_FRAME | RDW_ERASE | RDW_ALLCHILDREN | RDW_ERASENOW); 7312 RedrawWindow(hwnd,NULL,0,RDW_INVALIDATE | RDW_FRAME | RDW_ERASE | RDW_ALLCHILDREN | RDW_ERASENOW); 7348 7313 } else 7349 7314 { 7350 infoPtr->refreshFlags |= RF_NOREDRAW; 7351 if (infoPtr->refreshFlags & RF_REFRESH) 7352 KillTimer(hwnd,LV_REFRESH_TIMER); 7353 infoPtr->refreshFlags &= ~(RF_REFRESH | RF_UPDATESCROLL); 7315 infoPtr->internalFlags |= IF_NOREDRAW; 7354 7316 lResult = DefWindowProcA(hwnd, WM_SETREDRAW, bRedraw, 0); 7355 7317 }
Note:
See TracChangeset
for help on using the changeset viewer.