Ignore:
Timestamp:
Feb 22, 2000, 6:11:41 PM (26 years ago)
Author:
cbratschi
Message:

Corel 20000212, TREEVIEW_Sort fix, CCBase

File:
1 edited

Legend:

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

    r2523 r2858  
    1 /* $Id: toolbar.c,v 1.25 2000-01-26 18:04:30 cbratschi Exp $ */
     1/* $Id: toolbar.c,v 1.26 2000-02-22 17:11:40 cbratschi Exp $ */
    22/*
    33 * Toolbar control
     
    2828 */
    2929
    30 /* WINE 991212 level */
     30/*
     31 - Corel 20000212 level
     32 - WINE 991212 level
     33*/
    3134
    3235/* CB: Odin32/WINE bugs
     
    616619    /* the last row.                                                    */
    617620    infoPtr->nHeight = TOP_BORDER + (nRows + 1) * infoPtr->nButtonHeight +
    618                         nSepRows * SEPARATOR_WIDTH * 2 / 3 +
     621                        nSepRows * (SEPARATOR_WIDTH * 2 / 3) +
    619622                        nSepRows * (infoPtr->nBitmapHeight + 1) +
    620623                        BOTTOM_BORDER;
     
    21972200    RECT parent_rect;
    21982201    HWND parent;
    2199     /* INT32  x, y; */
     2202    INT  x, y;
    22002203    INT  cx, cy;
    22012204    UINT uPosFlags = 0;
    22022205
    2203 //    TRACE (toolbar, "resize forced!\n");
    2204 
     2206    //TRACE (toolbar, "resize forced!\n");
     2207
     2208    x = y = 0;
    22052209    parent = GetParent (hwnd);
    22062210    GetClientRect(parent, &parent_rect);
     
    22252229        cy += GetSystemMetrics(SM_CYEDGE);
    22262230
     2231    if (dwStyle & WS_BORDER)
     2232    {
     2233        x = y = 1;
     2234        cy += GetSystemMetrics(SM_CYEDGE);
     2235        cx += GetSystemMetrics(SM_CYEDGE);
     2236    }
     2237
    22272238    infoPtr->bAutoSize = TRUE;
    2228     SetWindowPos (hwnd, HWND_TOP, parent_rect.left, parent_rect.top,
     2239    SetWindowPos (hwnd, HWND_TOP, parent_rect.left - x, parent_rect.top - y,
    22292240                    cx, cy, uPosFlags);
    22302241
     
    22902301    INT nIndex;
    22912302    INT nOldIndex = -1;
     2303    BOOL bChecked = FALSE;
    22922304
    22932305    nIndex = TOOLBAR_GetButtonIndex (infoPtr, (INT)wParam);
     
    22992311    if (!(btnPtr->fsStyle & TBSTYLE_CHECK))
    23002312        return FALSE;
     2313
     2314    bChecked = (btnPtr->fsState & TBSTATE_CHECKED) ? TRUE : FALSE;
    23012315
    23022316    if (LOWORD(lParam) == FALSE)
     
    23142328    }
    23152329
    2316     hdc = GetDC (hwnd);
    2317     if (nOldIndex != -1)
    2318         TOOLBAR_DrawButton (hwnd, &infoPtr->buttons[nOldIndex], hdc);
    2319     TOOLBAR_DrawButton (hwnd, btnPtr, hdc);
    2320     ReleaseDC (hwnd, hdc);
     2330    if( bChecked != LOWORD(lParam) )
     2331    {
     2332      hdc = GetDC (hwnd);
     2333      if (nOldIndex != -1)
     2334          TOOLBAR_DrawButton (hwnd, &infoPtr->buttons[nOldIndex], hdc);
     2335     TOOLBAR_DrawButton (hwnd, btnPtr, hdc);
     2336      ReleaseDC (hwnd, hdc);
     2337    }
    23212338
    23222339    /* FIXME: Send a WM_NOTIFY?? */
     
    24392456    HDC hdc;
    24402457    INT nIndex;
     2458    BOOL bEnabled = FALSE;
    24412459
    24422460    nIndex = TOOLBAR_GetButtonIndex (infoPtr, (INT)wParam);
     
    24452463
    24462464    btnPtr = &infoPtr->buttons[nIndex];
     2465    bEnabled = (btnPtr->fsState & TBSTATE_ENABLED )? TRUE : FALSE ;
     2466
    24472467    if (LOWORD(lParam) == FALSE)
    24482468        btnPtr->fsState &= ~(TBSTATE_ENABLED | TBSTATE_PRESSED);
     
    24502470        btnPtr->fsState |= TBSTATE_ENABLED;
    24512471
    2452     hdc = GetDC (hwnd);
    2453     TOOLBAR_DrawButton (hwnd, btnPtr, hdc);
    2454     ReleaseDC (hwnd, hdc);
     2472    if( bEnabled !=  LOWORD(lParam) )
     2473    {
     2474      hdc = GetDC (hwnd);
     2475      TOOLBAR_DrawButton (hwnd, btnPtr, hdc);
     2476      ReleaseDC (hwnd, hdc);
     2477    }
    24552478
    24562479    return TRUE;
     
    32303253    if (((INT)LOWORD(lParam) <= 0) || ((INT)HIWORD(lParam) <= 0)) return FALSE;
    32313254
     3255    /* Bitmap size can only be set before adding any button to the toolbar
     3256       according to the documentation.  */
     3257    if( infoPtr->nNumButtons != 0 )
     3258        return FALSE;
     3259
    32323260    infoPtr->nBitmapWidth = (INT)LOWORD(lParam);
    32333261    infoPtr->nBitmapHeight = (INT)HIWORD(lParam);
     
    33393367    if (((INT)LOWORD(lParam) <= 0) || ((INT)HIWORD(lParam) <= 0)) return FALSE;
    33403368
     3369    /* Button size can only be set before adding any button to the toolbar
     3370       according to the documentation.  */
     3371    if( infoPtr->nNumButtons != 0 )
     3372        return FALSE;
     3373
    33413374    infoPtr->nButtonWidth = (INT)LOWORD(lParam);
    33423375    infoPtr->nButtonHeight = (INT)HIWORD(lParam);
     
    36703703    /* initialize info structure */
    36713704    infoPtr->nButtonHeight = 22;
    3672     infoPtr->nButtonWidth = 23;
     3705    infoPtr->nButtonWidth = 24;
    36733706    infoPtr->nBitmapHeight = 15;
    36743707    infoPtr->nBitmapWidth = 16;
     
    41014134        GetWindowRect (hwnd, &rcWindow);
    41024135        OffsetRect (&rcWindow, -rcWindow.left, -rcWindow.top);
     4136        if( dwStyle & WS_BORDER )
     4137            OffsetRect (&rcWindow, 1, 1);
    41034138        DrawEdge (hdc, &rcWindow, EDGE_ETCHED, BF_TOP);
    41044139    }
     
    41624197    RECT parent_rect;
    41634198    HWND parent;
    4164     INT  x,y,cx,cy;
     4199    INT  x = 0,y = 0,cx,cy;
    41654200    INT  flags;
    41664201    UINT uPosFlags = 0;
     
    42134248            cy += GetSystemMetrics(SM_CYEDGE);
    42144249
    4215         SetWindowPos (hwnd, 0, x, y,
     4250        if (dwStyle & WS_BORDER)
     4251        {
     4252            x = y = 1;
     4253            cy += GetSystemMetrics(SM_CYEDGE);
     4254            cx += GetSystemMetrics(SM_CYEDGE);
     4255        }
     4256
     4257        SetWindowPos (hwnd, 0, parent_rect.left - x, parent_rect.top - y,
    42164258                        cx, cy, uPosFlags | SWP_NOZORDER);
    42174259    }
     
    45874629{
    45884630    WNDCLASSA wndClass;
    4589 
    4590 //SvL: Don't check this now
    4591 //    if (GlobalFindAtomA (TOOLBARCLASSNAMEA)) return;
    45924631
    45934632    ZeroMemory (&wndClass, sizeof(WNDCLASSA));
     
    46074646TOOLBAR_Unregister (VOID)
    46084647{
    4609     if (GlobalFindAtomA (TOOLBARCLASSNAMEA))
    4610         UnregisterClassA (TOOLBARCLASSNAMEA, (HINSTANCE)NULL);
    4611 }
    4612 
     4648    UnregisterClassA (TOOLBARCLASSNAMEA, (HINSTANCE)NULL);
     4649}
     4650
Note: See TracChangeset for help on using the changeset viewer.