Ignore:
Timestamp:
Mar 26, 2000, 6:32:33 PM (25 years ago)
Author:
cbratschi
Message:

* empty log message *

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:02 cbratschi Exp $*/
     1/*$Id: listview.cpp,v 1.8 2000-03-26 16:32:33 cbratschi Exp $*/
    22/*
    33 * Listview control
     
    160160  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd);
    161161
    162   if (infoPtr->refreshFlags & (RF_REFRESH | RF_NOREDRAW)) return;
     162  if (infoPtr->internalFlags & IF_NOREDRAW) return;
    163163
    164164  if ((infoPtr->uView == LVS_REPORT) && !(infoPtr->dwStyle & LVS_NOCOLUMNHEADER))
     
    174174}
    175175
    176 static VOID LISTVIEW_QueueRefresh(HWND hwnd)
     176static LRESULT LISTVIEW_Timer(HWND hwnd,WPARAM wParam,LPARAM lParam)
    177177{
    178178  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd);
    179179
    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);
    210181}
    211182
     
    215186  RECT rect;
    216187
    217   if (infoPtr->refreshFlags & (RF_REFRESH | RF_NOREDRAW)) return;
     188  if (infoPtr->internalFlags & IF_NOREDRAW) return;
    218189  LISTVIEW_GetItemRect(hwnd,nItem,&rect,LVIR_SELECTBOUNDS);
    219190
     
    238209  INT xOffset = infoPtr->lefttop.x*infoPtr->scrollStep.x;
    239210
    240   if (infoPtr->refreshFlags & (RF_REFRESH | RF_NOREDRAW)) return;
     211  if (infoPtr->internalFlags & IF_NOREDRAW) return;
    241212  LISTVIEW_GetItemRect(hwnd,nItem,&rect,LVIR_SELECTBOUNDS);
    242213
     
    267238  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd);
    268239
    269   if (infoPtr->refreshFlags & (RF_REFRESH | RF_NOREDRAW)) return;
     240  if (infoPtr->internalFlags & IF_NOREDRAW) return;
    270241
    271242  if ((infoPtr->uView == LVS_REPORT) && !(infoPtr->dwStyle & LVS_NOCOLUMNHEADER))
     
    27512722
    27522723    /* refresh client area */
    2753     infoPtr->refreshFlags |= RF_UPDATESCROLL;
    2754     LISTVIEW_QueueRefresh(hwnd);
     2724    LISTVIEW_UpdateScroll(hwnd);
     2725    LISTVIEW_Refresh(hwnd);
    27552726  }
    27562727
     
    51355106    infoPtr->nItemWidth = LISTVIEW_GetItemWidth(hwnd);
    51365107
    5137     infoPtr->refreshFlags |= RF_UPDATESCROLL;
    5138     LISTVIEW_QueueRefresh(hwnd);
     5108    LISTVIEW_UpdateScroll(hwnd);
     5109    LISTVIEW_Refresh(hwnd);
    51395110  }
    51405111
     
    52715242
    52725243                /* refresh client area */
    5273                 infoPtr->refreshFlags |= RF_UPDATESCROLL;
    5274                 LISTVIEW_QueueRefresh(hwnd);
     5244                LISTVIEW_UpdateScroll(hwnd);
     5245                LISTVIEW_Refresh(hwnd);
    52755246              }
    52765247            }
     
    55515522    infoPtr->nItemWidth = LISTVIEW_GetItemWidth(hwnd);
    55525523
    5553     LISTVIEW_QueueRefresh(hwnd); // force redraw of the listview
     5524    LISTVIEW_Refresh(hwnd); // force redraw of the listview
    55545525
    55555526    return lret;
     
    56715642  HDPA hdpaSubItems;
    56725643  NMLISTVIEW nmlv;
    5673 
     5644//CB: LVS_REPORT (and other) and new text: invalidate if item rect > nItemWidth
    56745645  if (lpLVItem != NULL)
    56755646  {
     
    61676138static LRESULT LISTVIEW_Create(HWND hwnd, WPARAM wParam, LPARAM lParam)
    61686139{
    6169   LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd);
     6140  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd);
    61706141  LPCREATESTRUCTA lpcs = (LPCREATESTRUCTA)lParam;
    61716142  UINT uView = lpcs->style & LVS_TYPEMASK;
     
    66276598        return 0;
    66286599
    6629     infoPtr = (LISTVIEW_INFO *)GetWindowLongA(hwnd, 0);
     6600    infoPtr = (LISTVIEW_INFO*)getInfoPtr(hwnd);
    66306601
    66316602    if ( !infoPtr )
     
    70176988  LISTVIEW_INFO *infoPtr;
    70186989
    7019   //TRACE("(hwnd=%x,wParam=%x,lParam=%lx)\n", hwnd, wParam, lParam);
    7020 
    70216990  /* allocate memory for info structure */
    70226991  infoPtr = (LISTVIEW_INFO*)initControl(hwnd,sizeof(LISTVIEW_INFO));
     
    72307199{
    72317200  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);
    72357201
    72367202  if (infoPtr->bRButtonDown != FALSE)
     
    73407306  if (bRedraw)
    73417307  {
    7342     infoPtr->refreshFlags &= ~RF_NOREDRAW;
     7308    infoPtr->internalFlags &= ~IF_NOREDRAW;
    73437309    lResult = DefWindowProcA(hwnd, WM_SETREDRAW, bRedraw, 0);
    73447310
    73457311    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);
    73487313  } else
    73497314  {
    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;
    73547316    lResult = DefWindowProcA(hwnd, WM_SETREDRAW, bRedraw, 0);
    73557317  }
Note: See TracChangeset for help on using the changeset viewer.