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

improvements

File:
1 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,
Note: See TracChangeset for help on using the changeset viewer.