Changeset 2164 for trunk/src


Ignore:
Timestamp:
Dec 20, 1999, 7:44:08 PM (26 years ago)
Author:
cbratschi
Message:

separator fix for customize dialog

Location:
trunk/src/comctl32
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/comctl32/resource.asm

    r2126 r2164  
    11;/* This file is generated with wrc version 1.0.14 (08-Aug-1999). Do not edit! */
    22;/* Source : rsrc.rc */
    3 ;/* Cmdline: wrc -s -I. -IH:\IBMCPP3\include -I..\..\include -I..\..\include\win -o resource.asm rsrc.rc */
    4 ;/* Date   : Sat Dec 18 21:17:00 1999 */
     3;/* Cmdline: wrc -s -I. -IE:\IBMCPP\include -I..\..\include -I..\..\include\win -o resource.asm rsrc.rc */
     4;/* Date   : Sun Dec 19 18:42:30 1999 */
    55
    66        .386p
     
    1212        public  _Resource_PEResTab
    1313        dd      0
    14         dd      0385bebbch
     14        dd      0385d1906h
    1515        dd      0
    1616        dw      0, 5
     
    2727L2:
    2828        dd      0
    29         dd      0385bebbch
     29        dd      0385d1906h
    3030        dd      0
    3131        dw      0, 7
     
    4646L4:
    4747        dd      0
    48         dd      0385bebbch
     48        dd      0385d1906h
    4949        dd      0
    5050        dw      0, 1
     
    5353L5:
    5454        dd      0
    55         dd      0385bebbch
     55        dd      0385d1906h
    5656        dd      0
    5757        dw      0, 3
     
    6464L6:
    6565        dd      0
    66         dd      0385bebbch
     66        dd      0385d1906h
    6767        dd      0
    6868        dw      0, 1
     
    7171L16:
    7272        dd      0
    73         dd      0385bebbch
     73        dd      0385d1906h
    7474        dd      0
    7575        dw      0, 1
     
    7878L2_120:
    7979        dd      0
    80         dd      0385bebbch
     80        dd      0385d1906h
    8181        dd      0
    8282        dw      0, 1
     
    8585L2_121:
    8686        dd      0
    87         dd      0385bebbch
     87        dd      0385d1906h
    8888        dd      0
    8989        dw      0, 1
     
    9292L2_124:
    9393        dd      0
    94         dd      0385bebbch
     94        dd      0385d1906h
    9595        dd      0
    9696        dw      0, 1
     
    9999L2_125:
    100100        dd      0
    101         dd      0385bebbch
     101        dd      0385d1906h
    102102        dd      0
    103103        dw      0, 1
     
    106106L2_130:
    107107        dd      0
    108         dd      0385bebbch
     108        dd      0385d1906h
    109109        dd      0
    110110        dw      0, 1
     
    113113L2_131:
    114114        dd      0
    115         dd      0385bebbch
     115        dd      0385d1906h
    116116        dd      0
    117117        dw      0, 1
     
    120120L2_401:
    121121        dd      0
    122         dd      0385bebbch
     122        dd      0385d1906h
    123123        dd      0
    124124        dw      0, 1
     
    127127L4_300:
    128128        dd      0
    129         dd      0385bebbch
     129        dd      0385d1906h
    130130        dd      0
    131131        dw      0, 1
     
    134134L5_200:
    135135        dd      0
    136         dd      0385bebbch
     136        dd      0385d1906h
    137137        dd      0
    138138        dw      0, 1
     
    141141L5_1006:
    142142        dd      0
    143         dd      0385bebbch
     143        dd      0385d1906h
    144144        dd      0
    145145        dw      0, 1
     
    148148L5_1020:
    149149        dd      0
    150         dd      0385bebbch
     150        dd      0385d1906h
    151151        dd      0
    152152        dw      0, 1
     
    155155L6_261:
    156156        dd      0
    157         dd      0385bebbch
     157        dd      0385d1906h
    158158        dd      0
    159159        dw      0, 1
     
    162162L16_1:
    163163        dd      0
    164         dd      0385bebbch
     164        dd      0385d1906h
    165165        dd      0
    166166        dw      0, 1
  • trunk/src/comctl32/toolbar.c

    r2163 r2164  
    1 /* $Id: toolbar.c,v 1.21 1999-12-20 18:22:28 achimha Exp $ */
     1/* $Id: toolbar.c,v 1.22 1999-12-20 18:44:08 cbratschi Exp $ */
    22/*
    33 * Toolbar control
     
    15181518
    15191519    /* draw text */
    1520     if (btnPtr == NULL)
     1520    if (!btnPtr || btnPtr->fsStyle & TBSTYLE_SEP)
    15211521    { //new separator
    15221522      DrawTextA(lpdis->hDC,"Separator",-1,&rcText,DT_LEFT | DT_VCENTER | DT_SINGLELINE);
     
    16131613    switch (uMsg)
    16141614    {
    1615         case WM_INITDIALOG:
    1616             infoPtr = (TOOLBAR_INFO *)lParam;
    1617             SetWindowLongA (hwnd, DWL_USER, (DWORD)infoPtr);
    1618 
    1619             hDsa = DSA_Create (sizeof(TBUTTON_INFO), 5);
    1620 
    1621             if (infoPtr)
    1622             {
    1623                 TBUTTON_INFO *btnPtr;
    1624                 INT i;
    1625 
    1626                 /* insert 'virtual' separator button into 'available buttons' list */
    1627                 SendDlgItemMessageA (hwnd, IDC_AVAILBTN_LBOX, LB_ADDSTRING, 0, (LPARAM)"");
    1628 
    1629                 /* copy all buttons and append them to the right listbox */             
    1630                 btnPtr = infoPtr->buttons;
    1631                 for (i = 0; i < infoPtr->nNumButtons; i++, btnPtr++)
    1632                 {
    1633                     DSA_InsertItem (hDsa, i, btnPtr);
    1634 
    1635                     /* FIXME: hidden buttons appear in the 'toolbar buttons' list too */
    1636                     if (btnPtr->fsState & TBSTATE_HIDDEN)
    1637                     {
    1638                         SendDlgItemMessageA (hwnd, IDC_AVAILBTN_LBOX, LB_ADDSTRING, 0, (LPARAM)"");
    1639                     }
    1640                     else
    1641                     {
    1642                         SendDlgItemMessageA (hwnd, IDC_TOOLBARBTN_LBOX, LB_ADDSTRING, 0, (LPARAM)"");
    1643                     }
    1644                 }
    1645 
    1646                 /* append 'virtual' separator button to the 'toolbar buttons' list */
    1647                 /* TODO */
    1648             }
    1649             return TRUE;
    1650 
    1651         case WM_CLOSE:
    1652             EndDialog(hwnd, FALSE);
    1653             return TRUE;
    1654 
    1655         case WM_COMMAND:
    1656             switch (LOWORD(wParam))
    1657             {
    1658                 case IDCANCEL:
    1659                     EndDialog(hwnd, FALSE);
    1660                     break;
    1661             }
    1662             return TRUE;
    1663 
    1664         case WM_DESTROY:
    1665             if (hDsa)
    1666                 DSA_Destroy (hDsa);
    1667             return TRUE;
    1668 
    1669         case WM_DRAWITEM:
    1670             if (wParam == IDC_AVAILBTN_LBOX || wParam == IDC_TOOLBARBTN_LBOX)
    1671             {
    1672                 LPDRAWITEMSTRUCT lpdis = (LPDRAWITEMSTRUCT)lParam;
    1673                 TBUTTON_INFO btnPtr;
    1674                 RECT rcButton;
    1675                 RECT rcText;
    1676                 HPEN hOldPen;
    1677                 HBRUSH hOldBrush;
    1678                 COLORREF oldText = 0;
    1679                 COLORREF oldBk = 0;
    1680 
    1681                 FIXME("action: %x itemState: %x\n",
    1682                       lpdis->itemAction, lpdis->itemState);             
    1683 
    1684                 DSA_GetItem (hDsa, 0 /*lpdis->itemID*/, &btnPtr);
    1685 
    1686                 if (lpdis->itemState & ODS_FOCUS)
    1687                 {
    1688                     oldBk = SetBkColor (lpdis->hDC, GetSysColor(COLOR_HIGHLIGHT));
    1689                     oldText = SetTextColor (lpdis->hDC, GetSysColor(COLOR_HIGHLIGHTTEXT));
    1690                 }
    1691 
    1692                 hOldPen = SelectObject (lpdis->hDC, GetSysColorPen ((lpdis->itemState & ODS_SELECTED)?COLOR_HIGHLIGHT:COLOR_WINDOW));
    1693                 hOldBrush = SelectObject (lpdis->hDC, GetSysColorBrush ((lpdis->itemState & ODS_FOCUS)?COLOR_HIGHLIGHT:COLOR_WINDOW));
    1694 
    1695                 /* fill background rectangle */
    1696                 Rectangle (lpdis->hDC, lpdis->rcItem.left, lpdis->rcItem.top,
    1697                            lpdis->rcItem.right, lpdis->rcItem.bottom);
    1698 
    1699                 /* calculate button and text rectangles */
    1700                 CopyRect (&rcButton, &lpdis->rcItem);
    1701                 InflateRect (&rcButton, -1, -1);
    1702                 CopyRect (&rcText, &rcButton);
    1703                 rcButton.right = rcButton.left + infoPtr->nBitmapWidth + 6;
    1704                 rcText.left = rcButton.right + 2;
    1705 
    1706                 /* draw focus rectangle */
    1707                 if (lpdis->itemState & ODS_FOCUS)
    1708                     DrawFocusRect (lpdis->hDC, &lpdis->rcItem);
    1709 
    1710                 /* draw button */
    1711                 DrawEdge (lpdis->hDC, &rcButton, EDGE_RAISED, BF_RECT|BF_MIDDLE|BF_SOFT);
    1712 
    1713                 /* draw image and text */
    1714                 if (wParam == IDC_AVAILBTN_LBOX && lpdis->itemID == 0)
    1715                 {
    1716                     /* virtual separator in the 'available' list */
    1717                     DrawTextA (lpdis->hDC, "Separator", -1, &rcText,
    1718                                DT_LEFT | DT_VCENTER | DT_SINGLELINE);
    1719                 }
    1720                 else
    1721                 {
    1722                     /* real button */
    1723 
    1724                     ImageList_Draw (infoPtr->himlDef, btnPtr.iBitmap, lpdis->hDC,
    1725                                     rcButton.left+1, rcButton.top+1, ILD_NORMAL);
     1615        case WM_INITDIALOG:
     1616            infoPtr = (TOOLBAR_INFO *)lParam;
     1617            SetWindowLongA (hwnd, DWL_USER, (DWORD)infoPtr);
     1618
     1619            hDsa = DSA_Create (sizeof(TBUTTON_INFO), 5);
     1620
     1621            if (infoPtr)
     1622            {
     1623                TBUTTON_INFO *btnPtr;
     1624                INT i;
     1625
     1626                /* insert 'virtual' separator button into 'available buttons' list */
     1627                SendDlgItemMessageA (hwnd, IDC_AVAILBTN_LBOX, LB_ADDSTRING, 0, (LPARAM)"");
     1628
     1629                /* copy all buttons and append them to the right listbox */
     1630                btnPtr = infoPtr->buttons;
     1631                for (i = 0; i < infoPtr->nNumButtons; i++, btnPtr++)
     1632                {
     1633                    DSA_InsertItem (hDsa, i, btnPtr);
     1634
     1635                    /* FIXME: hidden buttons appear in the 'toolbar buttons' list too */
     1636                    if (btnPtr->fsState & TBSTATE_HIDDEN)
     1637                    {
     1638                        SendDlgItemMessageA (hwnd, IDC_AVAILBTN_LBOX, LB_ADDSTRING, 0, (LPARAM)"");
     1639                    }
     1640                    else
     1641                    {
     1642                        SendDlgItemMessageA (hwnd, IDC_TOOLBARBTN_LBOX, LB_ADDSTRING, 0, (LPARAM)"");
     1643                    }
     1644                }
     1645
     1646                /* append 'virtual' separator button to the 'toolbar buttons' list */
     1647                /* TODO */
     1648            }
     1649            return TRUE;
     1650
     1651        case WM_CLOSE:
     1652            EndDialog(hwnd, FALSE);
     1653            return TRUE;
     1654
     1655        case WM_COMMAND:
     1656            switch (LOWORD(wParam))
     1657            {
     1658                case IDCANCEL:
     1659                    EndDialog(hwnd, FALSE);
     1660                    break;
     1661            }
     1662            return TRUE;
     1663
     1664        case WM_DESTROY:
     1665            if (hDsa)
     1666                DSA_Destroy (hDsa);
     1667            return TRUE;
     1668
     1669        case WM_DRAWITEM:
     1670            if (wParam == IDC_AVAILBTN_LBOX || wParam == IDC_TOOLBARBTN_LBOX)
     1671            {
     1672                LPDRAWITEMSTRUCT lpdis = (LPDRAWITEMSTRUCT)lParam;
     1673                TBUTTON_INFO btnPtr;
     1674                RECT rcButton;
     1675                RECT rcText;
     1676                HPEN hOldPen;
     1677                HBRUSH hOldBrush;
     1678                COLORREF oldText = 0;
     1679                COLORREF oldBk = 0;
     1680
     1681                FIXME("action: %x itemState: %x\n",
     1682                      lpdis->itemAction, lpdis->itemState);
     1683
     1684                DSA_GetItem (hDsa, 0 /*lpdis->itemID*/, &btnPtr);
     1685
     1686                if (lpdis->itemState & ODS_FOCUS)
     1687                {
     1688                    oldBk = SetBkColor (lpdis->hDC, GetSysColor(COLOR_HIGHLIGHT));
     1689                    oldText = SetTextColor (lpdis->hDC, GetSysColor(COLOR_HIGHLIGHTTEXT));
     1690                }
     1691
     1692                hOldPen = SelectObject (lpdis->hDC, GetSysColorPen ((lpdis->itemState & ODS_SELECTED)?COLOR_HIGHLIGHT:COLOR_WINDOW));
     1693                hOldBrush = SelectObject (lpdis->hDC, GetSysColorBrush ((lpdis->itemState & ODS_FOCUS)?COLOR_HIGHLIGHT:COLOR_WINDOW));
     1694
     1695                /* fill background rectangle */
     1696                Rectangle (lpdis->hDC, lpdis->rcItem.left, lpdis->rcItem.top,
     1697                           lpdis->rcItem.right, lpdis->rcItem.bottom);
     1698
     1699                /* calculate button and text rectangles */
     1700                CopyRect (&rcButton, &lpdis->rcItem);
     1701                InflateRect (&rcButton, -1, -1);
     1702                CopyRect (&rcText, &rcButton);
     1703                rcButton.right = rcButton.left + infoPtr->nBitmapWidth + 6;
     1704                rcText.left = rcButton.right + 2;
     1705
     1706                /* draw focus rectangle */
     1707                if (lpdis->itemState & ODS_FOCUS)
     1708                    DrawFocusRect (lpdis->hDC, &lpdis->rcItem);
     1709
     1710                /* draw button */
     1711                DrawEdge (lpdis->hDC, &rcButton, EDGE_RAISED, BF_RECT|BF_MIDDLE|BF_SOFT);
     1712
     1713                /* draw image and text */
     1714                if (wParam == IDC_AVAILBTN_LBOX && lpdis->itemID == 0)
     1715                {
     1716                    /* virtual separator in the 'available' list */
     1717                    DrawTextA (lpdis->hDC, "Separator", -1, &rcText,
     1718                               DT_LEFT | DT_VCENTER | DT_SINGLELINE);
     1719                }
     1720                else
     1721                {
     1722                    /* real button */
     1723
     1724                    ImageList_Draw (infoPtr->himlDef, btnPtr.iBitmap, lpdis->hDC,
     1725                                    rcButton.left+1, rcButton.top+1, ILD_NORMAL);
    17261726//AH: TODO: Find out why this happens!!!
    17271727if ((infoPtr->strings == NULL) || (infoPtr->strings[btnPtr.iString] == NULL))
    17281728  dprintf(("COMCTL32:TOOLBAR:CustomizeDialog - Error drawing string - pointer not found!\n"));
    17291729else
    1730                     DrawTextW (lpdis->hDC,  infoPtr->strings[btnPtr.iString], -1, &rcText,
    1731                                DT_LEFT | DT_VCENTER | DT_SINGLELINE);
    1732 
    1733                 }
    1734 
    1735                 if (lpdis->itemState & ODS_FOCUS)
    1736                 {
    1737                     SetBkColor (lpdis->hDC, oldBk);
    1738                     SetTextColor (lpdis->hDC, oldText);
    1739                 }
    1740 
    1741                 SelectObject (lpdis->hDC, hOldBrush);
    1742                 SelectObject (lpdis->hDC, hOldPen);
    1743 
    1744                 return TRUE;
    1745             }
    1746             return FALSE;
    1747 
    1748         case WM_MEASUREITEM:
    1749             if (wParam == IDC_AVAILBTN_LBOX || wParam == IDC_TOOLBARBTN_LBOX)
    1750             {
    1751                 MEASUREITEMSTRUCT *lpmis = (MEASUREITEMSTRUCT*)lParam;
    1752 
    1753                 if (infoPtr)
    1754                     lpmis->itemHeight = infoPtr->nBitmapHeight + 8;
    1755                 else
    1756                     lpmis->itemHeight = 16 + 8; /* default height */
    1757 
    1758                 return TRUE;
    1759             }
    1760             return FALSE;
    1761 
    1762         default:
    1763             return FALSE;
     1730                    DrawTextW (lpdis->hDC,  infoPtr->strings[btnPtr.iString], -1, &rcText,
     1731                               DT_LEFT | DT_VCENTER | DT_SINGLELINE);
     1732
     1733                }
     1734
     1735                if (lpdis->itemState & ODS_FOCUS)
     1736                {
     1737                    SetBkColor (lpdis->hDC, oldBk);
     1738                    SetTextColor (lpdis->hDC, oldText);
     1739                }
     1740
     1741                SelectObject (lpdis->hDC, hOldBrush);
     1742                SelectObject (lpdis->hDC, hOldPen);
     1743
     1744                return TRUE;
     1745            }
     1746            return FALSE;
     1747
     1748        case WM_MEASUREITEM:
     1749            if (wParam == IDC_AVAILBTN_LBOX || wParam == IDC_TOOLBARBTN_LBOX)
     1750            {
     1751                MEASUREITEMSTRUCT *lpmis = (MEASUREITEMSTRUCT*)lParam;
     1752
     1753                if (infoPtr)
     1754                    lpmis->itemHeight = infoPtr->nBitmapHeight + 8;
     1755                else
     1756                    lpmis->itemHeight = 16 + 8; /* default height */
     1757
     1758                return TRUE;
     1759            }
     1760            return FALSE;
     1761
     1762        default:
     1763            return FALSE;
    17641764    }
    17651765}
     
    19841984    INT nOldButtons, nNewButtons, nAddButtons, nCount;
    19851985
    1986     TRACE("adding %d buttons!\n", wParam);
     1986//    TRACE("adding %d buttons!\n", wParam);
    19871987
    19881988    nAddButtons = (UINT)wParam;
     
    19911991
    19921992    if (infoPtr->nNumButtons == 0) {
    1993         infoPtr->buttons =
    1994             COMCTL32_Alloc (sizeof(TBUTTON_INFO) * nNewButtons);
     1993        infoPtr->buttons =
     1994            COMCTL32_Alloc (sizeof(TBUTTON_INFO) * nNewButtons);
    19951995    }
    19961996    else {
    1997         TBUTTON_INFO *oldButtons = infoPtr->buttons;
    1998         infoPtr->buttons =
    1999             COMCTL32_Alloc (sizeof(TBUTTON_INFO) * nNewButtons);
    2000         memcpy (&infoPtr->buttons[0], &oldButtons[0],
    2001                 nOldButtons * sizeof(TBUTTON_INFO));
     1997        TBUTTON_INFO *oldButtons = infoPtr->buttons;
     1998        infoPtr->buttons =
     1999            COMCTL32_Alloc (sizeof(TBUTTON_INFO) * nNewButtons);
     2000        memcpy (&infoPtr->buttons[0], &oldButtons[0],
     2001                nOldButtons * sizeof(TBUTTON_INFO));
    20022002        COMCTL32_Free (oldButtons);
    20032003    }
     
    20072007    /* insert new button data */
    20082008    for (nCount = 0; nCount < nAddButtons; nCount++) {
    2009         TBUTTON_INFO *btnPtr = &infoPtr->buttons[nOldButtons+nCount];
    2010         btnPtr->iBitmap   = lpTbb[nCount].iBitmap;
    2011         btnPtr->idCommand = lpTbb[nCount].idCommand;
    2012         btnPtr->fsState   = lpTbb[nCount].fsState;
    2013         btnPtr->fsStyle   = lpTbb[nCount].fsStyle;
    2014         btnPtr->dwData    = lpTbb[nCount].dwData;
    2015         btnPtr->iString   = lpTbb[nCount].iString;
    2016         btnPtr->bHot      = FALSE;
    2017 
    2018         if ((infoPtr->hwndToolTip) && !(btnPtr->fsStyle & TBSTYLE_SEP)) {
    2019             TTTOOLINFOW ti;
    2020 
    2021             ZeroMemory (&ti, sizeof(TTTOOLINFOW));
    2022             ti.cbSize   = sizeof (TTTOOLINFOW);
    2023             ti.hwnd     = hwnd;
    2024             ti.uId      = btnPtr->idCommand;
    2025             ti.hinst    = 0;
    2026             ti.lpszText = LPSTR_TEXTCALLBACKW;
    2027 
    2028             SendMessageW (infoPtr->hwndToolTip, TTM_ADDTOOLW,
    2029                             0, (LPARAM)&ti);
    2030         }
     2009        TBUTTON_INFO *btnPtr = &infoPtr->buttons[nOldButtons+nCount];
     2010        btnPtr->iBitmap   = lpTbb[nCount].iBitmap;
     2011        btnPtr->idCommand = lpTbb[nCount].idCommand;
     2012        btnPtr->fsState   = lpTbb[nCount].fsState;
     2013        btnPtr->fsStyle   = lpTbb[nCount].fsStyle;
     2014        btnPtr->dwData    = lpTbb[nCount].dwData;
     2015        btnPtr->iString   = lpTbb[nCount].iString;
     2016        btnPtr->bHot      = FALSE;
     2017
     2018        if ((infoPtr->hwndToolTip) && !(btnPtr->fsStyle & TBSTYLE_SEP)) {
     2019            TTTOOLINFOW ti;
     2020
     2021            ZeroMemory (&ti, sizeof(TTTOOLINFOW));
     2022            ti.cbSize   = sizeof (TTTOOLINFOW);
     2023            ti.hwnd     = hwnd;
     2024            ti.uId      = btnPtr->idCommand;
     2025            ti.hinst    = 0;
     2026            ti.lpszText = LPSTR_TEXTCALLBACKW;
     2027
     2028            SendMessageW (infoPtr->hwndToolTip, TTM_ADDTOOLW,
     2029                            0, (LPARAM)&ti);
     2030        }
    20312031    }
    20322032
     
    26902690
    26912691    if (!(GetWindowLongA (hwnd, GWL_STYLE) & TBSTYLE_FLAT))
    2692         return -1;
     2692        return -1;
    26932693
    26942694    if (infoPtr->nHotItem < 0)
    2695         return -1;
     2695        return -1;
    26962696
    26972697    return (LRESULT)infoPtr->nHotItem;
     
    29452945    if (nIndex == -1) {
    29462946       /* EPP: this seems to be an undocumented call (from my IE4)
    2947         * I assume in that case that:
    2948         * - lpTbb->iString is a string pointer (not a string index in strings[] table
    2949         * - index of insertion is at the end of existing buttons
    2950         * I only see this happen with nIndex == -1, but it could have a special
    2951         * meaning (like -nIndex (or ~nIndex) to get the real position of insertion).
    2952         */
    2953        int      len = lstrlenA((char*)lpTbb->iString) + 2;
    2954        LPSTR    ptr = COMCTL32_Alloc(len);
     2947        * I assume in that case that:
     2948        * - lpTbb->iString is a string pointer (not a string index in strings[] table
     2949        * - index of insertion is at the end of existing buttons
     2950        * I only see this happen with nIndex == -1, but it could have a special
     2951        * meaning (like -nIndex (or ~nIndex) to get the real position of insertion).
     2952        */
     2953       int      len = lstrlenA((char*)lpTbb->iString) + 2;
     2954       LPSTR    ptr = COMCTL32_Alloc(len);
    29552955
    29562956       nIndex = infoPtr->nNumButtons;
     
    34473447    if (GetWindowLongA (hwnd, GWL_STYLE) & TBSTYLE_FLAT)
    34483448    {
    3449         infoPtr->nHotItem = (INT)wParam;
    3450 
    3451         /* FIXME: What else must be done ??? */
     3449        infoPtr->nHotItem = (INT)wParam;
     3450
     3451        /* FIXME: What else must be done ??? */
    34523452
    34533453    }
    34543454
    34553455    if (nOldHotItem < 0)
    3456         return -1;
     3456        return -1;
    34573457
    34583458    return (LRESULT)nOldHotItem;
     
    38423842            return 0;
    38433843
    3844         if (btnPtr->fsStyle &  TBSTYLE_DROPDOWN)
    3845         {
    3846             NMTOOLBARA nmtb;
    3847 
    3848             nmtb.hdr.hwndFrom = hwnd;
    3849             nmtb.hdr.idFrom = GetWindowLongA (hwnd, GWL_ID);
    3850             nmtb.hdr.code = TBN_DROPDOWN;
    3851             nmtb.iItem = btnPtr->idCommand;
    3852 
    3853             SendMessageA (infoPtr->hwndNotify, WM_NOTIFY,
    3854                           (WPARAM)nmtb.hdr.idFrom, (LPARAM)&nmtb);
    3855         }
     3844        if (btnPtr->fsStyle &  TBSTYLE_DROPDOWN)
     3845        {
     3846            NMTOOLBARA nmtb;
     3847
     3848            nmtb.hdr.hwndFrom = hwnd;
     3849            nmtb.hdr.idFrom = GetWindowLongA (hwnd, GWL_ID);
     3850            nmtb.hdr.code = TBN_DROPDOWN;
     3851            nmtb.iItem = btnPtr->idCommand;
     3852
     3853            SendMessageA (infoPtr->hwndNotify, WM_NOTIFY,
     3854                          (WPARAM)nmtb.hdr.idFrom, (LPARAM)&nmtb);
     3855        }
    38563856
    38573857        SetCapture (hwnd);
     
    39253925        ReleaseDC (hwnd, hdc);
    39263926
    3927         if (bSendMessage) {
    3928             SendMessageA (GetParent(hwnd), WM_COMMAND,
    3929                           MAKEWPARAM(btnPtr->idCommand, 0), (LPARAM)hwnd);
    3930 
    3931             if ((GetWindowLongA(hwnd, GWL_STYLE) & TBSTYLE_DROPDOWN) ||
    3932                 (btnPtr->fsStyle & 0x08/* BTNS_DROPDOWN */)) {
    3933                NMTOOLBARW       nmtb;
    3934 
    3935                nmtb.hdr.hwndFrom = hwnd;
    3936                nmtb.hdr.idFrom   = GetWindowLongA (hwnd, GWL_ID);
    3937                nmtb.hdr.code     = TBN_DROPDOWN;
    3938                nmtb.iItem        = nHit;
    3939                /* nmtb.tbButton not used with TBN_DROPDOWN */
    3940                if ((btnPtr->iString >= 0) && (btnPtr->iString < infoPtr->nNumStrings)) {
    3941                   nmtb.pszText      = infoPtr->strings[btnPtr->iString];
    3942                   nmtb.cchText      = lstrlenW(nmtb.pszText);
    3943                } else {
    3944                   nmtb.pszText      = NULL;
    3945                   nmtb.cchText      = 0;
    3946                }
    3947                nmtb.rcButton     = btnPtr->rect;
    3948 
    3949                SendMessageW(infoPtr->hwndNotify, WM_NOTIFY,
    3950                             (WPARAM)nmtb.hdr.idFrom, (LPARAM)&nmtb);
    3951             }
    3952         }
     3927        if (bSendMessage) {
     3928            SendMessageA (GetParent(hwnd), WM_COMMAND,
     3929                          MAKEWPARAM(btnPtr->idCommand, 0), (LPARAM)hwnd);
     3930
     3931            if ((GetWindowLongA(hwnd, GWL_STYLE) & TBSTYLE_DROPDOWN) ||
     3932                (btnPtr->fsStyle & 0x08/* BTNS_DROPDOWN */)) {
     3933               NMTOOLBARW       nmtb;
     3934
     3935               nmtb.hdr.hwndFrom = hwnd;
     3936               nmtb.hdr.idFrom   = GetWindowLongA (hwnd, GWL_ID);
     3937               nmtb.hdr.code     = TBN_DROPDOWN;
     3938               nmtb.iItem        = nHit;
     3939               /* nmtb.tbButton not used with TBN_DROPDOWN */
     3940               if ((btnPtr->iString >= 0) && (btnPtr->iString < infoPtr->nNumStrings)) {
     3941                  nmtb.pszText      = infoPtr->strings[btnPtr->iString];
     3942                  nmtb.cchText      = lstrlenW(nmtb.pszText);
     3943               } else {
     3944                  nmtb.pszText      = NULL;
     3945                  nmtb.cchText      = 0;
     3946               }
     3947               nmtb.rcButton     = btnPtr->rect;
     3948
     3949               SendMessageW(infoPtr->hwndNotify, WM_NOTIFY,
     3950                            (WPARAM)nmtb.hdr.idFrom, (LPARAM)&nmtb);
     3951            }
     3952        }
    39533953
    39543954        infoPtr->nButtonDown = -1;
     
    42234223
    42244224    if (nType == GWL_STYLE) {
    4225         if (lpStyle->styleNew & TBSTYLE_LIST) {
    4226             infoPtr->dwDTFlags = DT_LEFT | DT_VCENTER | DT_SINGLELINE;
    4227         }
    4228         else {
    4229             infoPtr->dwDTFlags = DT_CENTER;
    4230         }
     4225        if (lpStyle->styleNew & TBSTYLE_LIST) {
     4226            infoPtr->dwDTFlags = DT_LEFT | DT_VCENTER | DT_SINGLELINE;
     4227        }
     4228        else {
     4229            infoPtr->dwDTFlags = DT_CENTER;
     4230        }
    42314231    }
    42324232
     
    42744274            return TOOLBAR_AddStringW (hwnd, wParam, lParam);
    42754275
    4276         case TB_AUTOSIZE:
    4277             return TOOLBAR_AutoSize (hwnd);
     4276        case TB_AUTOSIZE:
     4277            return TOOLBAR_AutoSize (hwnd);
    42784278
    42794279        case TB_BUTTONCOUNT:
     
    43014301            return TOOLBAR_EnableButton (hwnd, wParam, lParam);
    43024302
    4303         case TB_GETANCHORHIGHLIGHT:
    4304             return TOOLBAR_GetAnchorHighlight (hwnd);
     4303        case TB_GETANCHORHIGHLIGHT:
     4304            return TOOLBAR_GetAnchorHighlight (hwnd);
    43054305
    43064306        case TB_GETBITMAP:
     
    43394339            return TOOLBAR_GetHotImageList (hwnd, wParam, lParam);
    43404340
    4341         case TB_GETHOTITEM:
    4342             return TOOLBAR_GetHotItem (hwnd);
     4341        case TB_GETHOTITEM:
     4342            return TOOLBAR_GetHotItem (hwnd);
    43434343
    43444344        case TB_GETIMAGELIST:
     
    43784378            return TOOLBAR_GetUnicodeFormat (hwnd, wParam, lParam);
    43794379
    4380         case CCM_GETVERSION:
    4381             return TOOLBAR_GetVersion (hwnd);
     4380        case CCM_GETVERSION:
     4381            return TOOLBAR_GetVersion (hwnd);
    43824382
    43834383        case TB_HIDEBUTTON:
     
    44354435            return TOOLBAR_SaveRestoreW(hwnd,wParam,lParam);
    44364436
    4437         case TB_SETANCHORHIGHLIGHT:
    4438             return TOOLBAR_SetAnchorHighlight (hwnd, wParam);
     4437        case TB_SETANCHORHIGHLIGHT:
     4438            return TOOLBAR_SetAnchorHighlight (hwnd, wParam);
    44394439
    44404440        case TB_SETBITMAPSIZE:
     
    44704470            return TOOLBAR_SetHotImageList (hwnd, wParam, lParam);
    44714471
    4472         case TB_SETHOTITEM:
    4473             return TOOLBAR_SetHotItem (hwnd, wParam);
     4472        case TB_SETHOTITEM:
     4473            return TOOLBAR_SetHotItem (hwnd, wParam);
    44744474
    44754475        case TB_SETIMAGELIST:
     
    45074507            return TOOLBAR_SetUnicodeFormat (hwnd, wParam, lParam);
    45084508
    4509         case CCM_SETVERSION:
    4510             return TOOLBAR_SetVersion (hwnd, (INT)wParam);
     4509        case CCM_SETVERSION:
     4510            return TOOLBAR_SetVersion (hwnd, (INT)wParam);
    45114511
    45124512/*      case WM_CHAR: */
     
    45184518            return TOOLBAR_EraseBackground (hwnd, wParam, lParam);
    45194519
    4520         case WM_GETFONT:
    4521                 return TOOLBAR_GetFont (hwnd, wParam, lParam);
     4520        case WM_GETFONT:
     4521                return TOOLBAR_GetFont (hwnd, wParam, lParam);
    45224522
    45234523/*      case WM_KEYDOWN: */
     
    45564556            return TOOLBAR_Size (hwnd, wParam, lParam);
    45574557
    4558         case WM_STYLECHANGED:
    4559             return TOOLBAR_StyleChanged (hwnd, (INT)wParam, (LPSTYLESTRUCT)lParam);
     4558        case WM_STYLECHANGED:
     4559            return TOOLBAR_StyleChanged (hwnd, (INT)wParam, (LPSTYLESTRUCT)lParam);
    45604560
    45614561/*      case WM_SYSCOLORCHANGE: */
Note: See TracChangeset for help on using the changeset viewer.