Changeset 1085 for trunk/src


Ignore:
Timestamp:
Sep 28, 1999, 6:36:04 PM (26 years ago)
Author:
cbratschi
Message:

improvements

Location:
trunk/src/comctl32
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/comctl32/header.c

    r968 r1085  
    1 /* $Id: header.c,v 1.9 1999-09-18 12:21:25 cbratschi Exp $ */
     1/* $Id: header.c,v 1.10 1999-09-28 16:36:04 cbratschi Exp $ */
    22/*
    33 *  Header control
     
    2121 *     HEADER_DrawItem.
    2222 *   - Little flaw when drawing a bitmap on the right side of the text.
     23 *
     24 * Status: Development in progress
     25 * Version: Unknown
    2326 */
    2427
     
    3639#define VERT_BORDER     4
    3740#define DIVIDER_WIDTH  10
     41#define MIN_ITEMWIDTH  0
    3842
    3943#define HEADER_GetInfoPtr(hwnd) ((HEADER_INFO *)GetWindowLongA(hwnd,0))
     
    426430    oldRop = SetROP2 (hdc, R2_XORPEN);
    427431    MoveToEx (hdc, x, rect.top, NULL);
    428     LineTo (hdc, x, rect.bottom-1);
     432    LineTo (hdc, x, rect.bottom);
    429433    SetROP2 (hdc, oldRop);
    430434    SelectObject (hdc, hOldPen);
     
    12631267            if (HEADER_SendHeaderNotify (hwnd, HDN_ITEMCHANGINGA, infoPtr->iMoveItem))
    12641268                infoPtr->items[infoPtr->iMoveItem].cxy = infoPtr->nOldWidth;
    1265             else {
     1269            else
     1270            {
    12661271                nWidth = pt.x - infoPtr->items[infoPtr->iMoveItem].rect.left + infoPtr->xTrackOffset;
    1267                 if (nWidth < 0)
    1268                     nWidth = 0;
    1269                 infoPtr->items[infoPtr->iMoveItem].cxy = nWidth;
    1270                 HEADER_SendHeaderNotify (hwnd, HDN_ITEMCHANGEDA, infoPtr->iMoveItem);
    1271             }
    1272 
    1273             HEADER_SetItemBounds (hwnd);
    1274             hdc = GetDC (hwnd);
    1275             HEADER_Refresh (hwnd, hdc);
    1276             ReleaseDC (hwnd, hdc);
     1272                if (nWidth < MIN_ITEMWIDTH)
     1273                    nWidth = MIN_ITEMWIDTH;
     1274
     1275                if (infoPtr->nOldWidth != nWidth)
     1276                {
     1277                  RECT rect;
     1278
     1279                  infoPtr->items[infoPtr->iMoveItem].cxy = nWidth;
     1280                  HEADER_SendHeaderNotify (hwnd, HDN_ITEMCHANGEDA, infoPtr->iMoveItem);
     1281
     1282                  GetClientRect(hwnd,&rect);
     1283                  rect.left = infoPtr->items[infoPtr->iMoveItem].rect.right-2;
     1284                  HEADER_SetItemBounds (hwnd);
     1285                  rect.left = MIN(infoPtr->items[infoPtr->iMoveItem].rect.right-2,rect.left);
     1286                  InvalidateRect(hwnd,&rect,FALSE);
     1287                }
     1288            }
    12771289        }
    12781290    }
     
    13441356                else {
    13451357                    nWidth = pt.x - infoPtr->items[infoPtr->iMoveItem].rect.left + infoPtr->xTrackOffset;
    1346                     if (nWidth < 0)
    1347                         nWidth = 0;
     1358                    if (nWidth < MIN_ITEMWIDTH)
     1359                        nWidth = MIN_ITEMWIDTH;
    13481360                    infoPtr->items[infoPtr->iMoveItem].cxy = nWidth;
    13491361                    HEADER_SendHeaderNotify (hwnd, HDN_ITEMCHANGEDA,
  • trunk/src/comctl32/listview.c

    r1058 r1085  
    24502450
    24512451    /* invalidate client area (optimization needed) */
    2452     InvalidateRect(hwnd, NULL, TRUE);
     2452    InvalidateRect(hwnd, NULL, FALSE);
    24532453  }
    24542454
     
    25862586
    25872587    /* refresh client area */
    2588     InvalidateRect(hwnd, NULL, TRUE);
     2588    InvalidateRect(hwnd, NULL, FALSE);
    25892589  }
    25902590
     
    31783178    /* make sure we can get the listview info */
    31793179    if (!(infoPtr = (LISTVIEW_INFO *)GetWindowLongA(hwnd, 0)))
    3180         return (0);
     3180        return (0);
    31813181    return (infoPtr->dwExStyle);
    31823182}
     
    34523452    /* make sure we can get the listview info */
    34533453    if (!(infoPtr = (LISTVIEW_INFO *)GetWindowLongA(hwnd, 0)))
    3454         return (-1);
     3454        return (-1);
    34553455    return (infoPtr->nHotItem);
    34563456}
     
    36843684          {
    36853685            bResult = TRUE;
    3686             nLeftPos = lprc->left = ptItem.x + ptOrigin.x; 
     3686            nLeftPos = lprc->left = ptItem.x + ptOrigin.x;
    36873687            lprc->top = ptItem.y + ptOrigin.y;
    36883688            lprc->bottom = lprc->top + infoPtr->nItemHeight;
     
    37123712        {
    37133713          bResult = TRUE;
    3714           nLeftPos = lprc->left = ptItem.x; 
     3714          nLeftPos = lprc->left = ptItem.x;
    37153715          lprc->top = ptItem.y;
    37163716          lprc->bottom = lprc->top + infoPtr->nItemHeight;
     
    37263726          }
    37273727
    3728           nLabelWidth = LISTVIEW_GetLabelWidth(hwnd, nItem);
    3729           if (lprc->left + nLabelWidth < nLeftPos + infoPtr->nItemWidth)
    3730           {
    3731             lprc->right = lprc->left + nLabelWidth;
    3732           }
    3733           else
    3734           {
    3735             lprc->right = nLeftPos + infoPtr->nItemWidth;
    3736           }
     3728          nLabelWidth = LISTVIEW_GetLabelWidth(hwnd, nItem);
     3729          if (lprc->left + nLabelWidth < nLeftPos + infoPtr->nItemWidth)
     3730          {
     3731            lprc->right = lprc->left + nLabelWidth;
     3732          }
     3733          else
     3734          {
     3735            lprc->right = nLeftPos + infoPtr->nItemWidth;
     3736          }
    37373737        }
    37383738        break;
     
    37873787          }
    37883788
    3789             nLabelWidth = LISTVIEW_GetLabelWidth(hwnd, nItem);
    3790             if (lprc->right + nLabelWidth < lprc->left + infoPtr->nItemWidth)
    3791             {
    3792               lprc->right += nLabelWidth;
    3793             }
    3794             else
    3795             {
    3796               lprc->right = lprc->left + infoPtr->nItemWidth;
    3797             }
     3789            nLabelWidth = LISTVIEW_GetLabelWidth(hwnd, nItem);
     3790            if (lprc->right + nLabelWidth < lprc->left + infoPtr->nItemWidth)
     3791            {
     3792              lprc->right += nLabelWidth;
     3793            }
     3794            else
     3795            {
     3796              lprc->right = lprc->left + infoPtr->nItemWidth;
     3797            }
    37983798        }
    37993799        break;
     
    38193819          {
    38203820            bResult = TRUE;
    3821             nLeftPos= lprc->left = ptItem.x + ptOrigin.x; 
     3821            nLeftPos= lprc->left = ptItem.x + ptOrigin.x;
    38223822            lprc->top = ptItem.y + ptOrigin.y;
    38233823            lprc->bottom = lprc->top + infoPtr->nItemHeight;
     
    38353835            }
    38363836
    3837           nLabelWidth = LISTVIEW_GetLabelWidth(hwnd, nItem);
    3838           if (lprc->right + nLabelWidth < lprc->left + infoPtr->nItemWidth)
    3839           {
    3840             lprc->right += nLabelWidth;
    3841           }
    3842           else
    3843           {
    3844             lprc->right = lprc->left + infoPtr->nItemWidth;
    3845           }
     3837          nLabelWidth = LISTVIEW_GetLabelWidth(hwnd, nItem);
     3838          if (lprc->right + nLabelWidth < lprc->left + infoPtr->nItemWidth)
     3839          {
     3840            lprc->right += nLabelWidth;
    38463841          }
     3842          else
     3843          {
     3844            lprc->right = lprc->left + infoPtr->nItemWidth;
     3845          }
     3846          }
    38473847        }
    38483848        else
    38493849        {
    38503850          bResult = TRUE;
    3851           nLeftPos = lprc->left = ptItem.x; 
     3851          nLeftPos = lprc->left = ptItem.x;
    38523852          lprc->top = ptItem.y;
    38533853          lprc->bottom = lprc->top + infoPtr->nItemHeight;
     
    38653865          }
    38663866
    3867           nLabelWidth = LISTVIEW_GetLabelWidth(hwnd, nItem);
    3868           if (lprc->right + nLabelWidth < nLeftPos + infoPtr->nItemWidth)
    3869           {
    3870             lprc->right += nLabelWidth;
    3871           }
    3872           else
    3873           {
    3874             lprc->right = nLeftPos + infoPtr->nItemWidth;
    3875           }
     3867          nLabelWidth = LISTVIEW_GetLabelWidth(hwnd, nItem);
     3868          if (lprc->right + nLabelWidth < nLeftPos + infoPtr->nItemWidth)
     3869          {
     3870            lprc->right += nLabelWidth;
     3871          }
     3872          else
     3873          {
     3874            lprc->right = nLeftPos + infoPtr->nItemWidth;
     3875          }
    38763876        }
    38773877        break;
     
    45434543}
    45444544
    4545 static LRESULT LISTVIEW_InsertColumnW(HWND hwnd, INT nColumn, 
     4545static LRESULT LISTVIEW_InsertColumnW(HWND hwnd, INT nColumn,
    45464546                                      LPLVCOLUMNW lpColumn)
    45474547{
    4548   LVCOLUMNA     lvca;
    4549   LRESULT               lres;
    4550      
     4548  LVCOLUMNA     lvca;
     4549  LRESULT               lres;
     4550
    45514551  memcpy(&lvca,lpColumn,sizeof(lvca));
    45524552//AH: todo
     
    47304730
    47314731  infoPtr->clrBk = clrBk;
    4732   InvalidateRect(hwnd, NULL, TRUE);
     4732  InvalidateRect(hwnd, NULL, FALSE);
    47334733
    47344734  return TRUE;
     
    49144914    infoPtr->nItemWidth = LISTVIEW_GetItemWidth(hwnd);
    49154915
    4916     InvalidateRect(hwnd, NULL, TRUE); // force redraw of the listview
     4916    InvalidateRect(hwnd, NULL, FALSE); // force redraw of the listview
    49174917
    49184918    return lret;
     
    49384938    /* make sure we can get the listview info */
    49394939    if (!(infoPtr = (LISTVIEW_INFO *)GetWindowLongA(hwnd, 0)))
    4940         return (0);
     4940        return (0);
    49414941    /* store previous style */
    49424942    dwOldStyle = infoPtr->dwExStyle;
     
    49664966    /* make sure we can get the listview info */
    49674967    if (!(infoPtr = (LISTVIEW_INFO *)GetWindowLongA(hwnd, 0)))
    4968         return (-1);
     4968        return (-1);
    49694969    /* store previous index */
    49704970    iOldIndex = infoPtr->nHotItem;
     
    52565256
    52575257  infoPtr->clrTextBk = clrTextBk;
    5258   InvalidateRect(hwnd, NULL, TRUE);
     5258  InvalidateRect(hwnd, NULL, FALSE);
    52595259
    52605260  return TRUE;
     
    52785278
    52795279  infoPtr->clrText = clrText;
    5280   InvalidateRect(hwnd, NULL, TRUE);
     5280  InvalidateRect(hwnd, NULL, FALSE);
    52815281
    52825282  return TRUE;
     
    54105410      rc.left = LVIR_BOUNDS;
    54115411      ListView_GetItemRect(hwnd, nItem, &rc);
    5412       InvalidateRect(hwnd, &rc, TRUE);
     5412      InvalidateRect(hwnd, &rc, FALSE);
    54135413    }
    54145414  }
     
    56625662      scrollInfo.fMask = SIF_POS;
    56635663      SetScrollInfo(hwnd, SB_VERT, &scrollInfo, TRUE);
    5664       InvalidateRect(hwnd, NULL, TRUE);
     5664      InvalidateRect(hwnd, NULL, FALSE);
    56655665    }
    56665666  }
     
    57715771      scrollInfo.fMask = SIF_POS;
    57725772      SetScrollInfo(hwnd, SB_HORZ, &scrollInfo, TRUE);
    5773       InvalidateRect(hwnd, NULL, TRUE);
     5773      InvalidateRect(hwnd, NULL, FALSE);
    57745774    }
    57755775  }
     
    58735873    {
    58745874      /* refresh client area */
    5875       InvalidateRect(hwnd, NULL, TRUE);
     5875      InvalidateRect(hwnd, NULL, FALSE);
    58765876      UpdateWindow(hwnd);
    58775877    }
     
    60296029  }
    60306030
    6031   InvalidateRect(hwnd, NULL, TRUE);
     6031  //InvalidateRect(hwnd, NULL, TRUE);
    60326032
    60336033  return 0;
     
    61656165    {
    61666166      infoPtr->nItemWidth = LISTVIEW_GetItemWidth(hwnd);
    6167       InvalidateRect(hwnd, NULL, TRUE);
     6167      InvalidateRect(hwnd, NULL, FALSE);
    61686168    }
    61696169  }
     
    63896389  infoPtr->bFocus = TRUE;
    63906390
    6391   InvalidateRect(hwnd, NULL, TRUE);
     6391  InvalidateRect(hwnd, NULL, FALSE);
    63926392  UpdateWindow(hwnd);
    63936393
     
    64316431
    64326432  /* invalidate listview control client area */
    6433   InvalidateRect(hwnd, NULL, TRUE);
     6433  InvalidateRect(hwnd, NULL, FALSE);
    64346434
    64356435  if (fRedraw != FALSE)
     
    64786478
    64796479  /* invalidate client area + erase background */
    6480   InvalidateRect(hwnd, NULL, TRUE);
     6480  InvalidateRect(hwnd, NULL, FALSE);
    64816481
    64826482  return 0;
     
    66366636
    66376637    /* invalidate client area + erase background */
    6638     InvalidateRect(hwnd, NULL, TRUE);
     6638    InvalidateRect(hwnd, NULL, FALSE);
    66396639
    66406640    /* print the list of unsupported window styles */
     
    68646864    return LISTVIEW_SetItemTextA(hwnd, (INT)wParam, (LPLVITEMA)lParam);
    68656865
    6866 /*      case LVM_SETITEMTEXTW: */
     6866/*      case LVM_SETITEMTEXTW: */
    68676867
    68686868  case LVM_SETSELECTIONMARK:
Note: See TracChangeset for help on using the changeset viewer.