Changeset 2164 for trunk/src/comctl32
- Timestamp:
- Dec 20, 1999, 7:44:08 PM (26 years ago)
- Location:
- trunk/src/comctl32
- Files:
-
- 2 edited
-
resource.asm (modified) (20 diffs)
-
toolbar.c (modified) (21 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/comctl32/resource.asm
r2126 r2164 1 1 ;/* This file is generated with wrc version 1.0.14 (08-Aug-1999). Do not edit! */ 2 2 ;/* Source : rsrc.rc */ 3 ;/* Cmdline: wrc -s -I. -I H:\IBMCPP3\include -I..\..\include -I..\..\include\win -o resource.asm rsrc.rc */4 ;/* Date : S at 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 */ 5 5 6 6 .386p … … 12 12 public _Resource_PEResTab 13 13 dd 0 14 dd 0385 bebbch14 dd 0385d1906h 15 15 dd 0 16 16 dw 0, 5 … … 27 27 L2: 28 28 dd 0 29 dd 0385 bebbch29 dd 0385d1906h 30 30 dd 0 31 31 dw 0, 7 … … 46 46 L4: 47 47 dd 0 48 dd 0385 bebbch48 dd 0385d1906h 49 49 dd 0 50 50 dw 0, 1 … … 53 53 L5: 54 54 dd 0 55 dd 0385 bebbch55 dd 0385d1906h 56 56 dd 0 57 57 dw 0, 3 … … 64 64 L6: 65 65 dd 0 66 dd 0385 bebbch66 dd 0385d1906h 67 67 dd 0 68 68 dw 0, 1 … … 71 71 L16: 72 72 dd 0 73 dd 0385 bebbch73 dd 0385d1906h 74 74 dd 0 75 75 dw 0, 1 … … 78 78 L2_120: 79 79 dd 0 80 dd 0385 bebbch80 dd 0385d1906h 81 81 dd 0 82 82 dw 0, 1 … … 85 85 L2_121: 86 86 dd 0 87 dd 0385 bebbch87 dd 0385d1906h 88 88 dd 0 89 89 dw 0, 1 … … 92 92 L2_124: 93 93 dd 0 94 dd 0385 bebbch94 dd 0385d1906h 95 95 dd 0 96 96 dw 0, 1 … … 99 99 L2_125: 100 100 dd 0 101 dd 0385 bebbch101 dd 0385d1906h 102 102 dd 0 103 103 dw 0, 1 … … 106 106 L2_130: 107 107 dd 0 108 dd 0385 bebbch108 dd 0385d1906h 109 109 dd 0 110 110 dw 0, 1 … … 113 113 L2_131: 114 114 dd 0 115 dd 0385 bebbch115 dd 0385d1906h 116 116 dd 0 117 117 dw 0, 1 … … 120 120 L2_401: 121 121 dd 0 122 dd 0385 bebbch122 dd 0385d1906h 123 123 dd 0 124 124 dw 0, 1 … … 127 127 L4_300: 128 128 dd 0 129 dd 0385 bebbch129 dd 0385d1906h 130 130 dd 0 131 131 dw 0, 1 … … 134 134 L5_200: 135 135 dd 0 136 dd 0385 bebbch136 dd 0385d1906h 137 137 dd 0 138 138 dw 0, 1 … … 141 141 L5_1006: 142 142 dd 0 143 dd 0385 bebbch143 dd 0385d1906h 144 144 dd 0 145 145 dw 0, 1 … … 148 148 L5_1020: 149 149 dd 0 150 dd 0385 bebbch150 dd 0385d1906h 151 151 dd 0 152 152 dw 0, 1 … … 155 155 L6_261: 156 156 dd 0 157 dd 0385 bebbch157 dd 0385d1906h 158 158 dd 0 159 159 dw 0, 1 … … 162 162 L16_1: 163 163 dd 0 164 dd 0385 bebbch164 dd 0385d1906h 165 165 dd 0 166 166 dw 0, 1 -
trunk/src/comctl32/toolbar.c
r2163 r2164 1 /* $Id: toolbar.c,v 1.2 1 1999-12-20 18:22:28 achimhaExp $ */1 /* $Id: toolbar.c,v 1.22 1999-12-20 18:44:08 cbratschi Exp $ */ 2 2 /* 3 3 * Toolbar control … … 1518 1518 1519 1519 /* draw text */ 1520 if ( btnPtr == NULL)1520 if (!btnPtr || btnPtr->fsStyle & TBSTYLE_SEP) 1521 1521 { //new separator 1522 1522 DrawTextA(lpdis->hDC,"Separator",-1,&rcText,DT_LEFT | DT_VCENTER | DT_SINGLELINE); … … 1613 1613 switch (uMsg) 1614 1614 { 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 else1641 {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 else1721 {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); 1726 1726 //AH: TODO: Find out why this happens!!! 1727 1727 if ((infoPtr->strings == NULL) || (infoPtr->strings[btnPtr.iString] == NULL)) 1728 1728 dprintf(("COMCTL32:TOOLBAR:CustomizeDialog - Error drawing string - pointer not found!\n")); 1729 1729 else 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 else1756 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; 1764 1764 } 1765 1765 } … … 1984 1984 INT nOldButtons, nNewButtons, nAddButtons, nCount; 1985 1985 1986 TRACE("adding %d buttons!\n", wParam);1986 // TRACE("adding %d buttons!\n", wParam); 1987 1987 1988 1988 nAddButtons = (UINT)wParam; … … 1991 1991 1992 1992 if (infoPtr->nNumButtons == 0) { 1993 infoPtr->buttons =1994 COMCTL32_Alloc (sizeof(TBUTTON_INFO) * nNewButtons);1993 infoPtr->buttons = 1994 COMCTL32_Alloc (sizeof(TBUTTON_INFO) * nNewButtons); 1995 1995 } 1996 1996 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)); 2002 2002 COMCTL32_Free (oldButtons); 2003 2003 } … … 2007 2007 /* insert new button data */ 2008 2008 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 } 2031 2031 } 2032 2032 … … 2690 2690 2691 2691 if (!(GetWindowLongA (hwnd, GWL_STYLE) & TBSTYLE_FLAT)) 2692 return -1;2692 return -1; 2693 2693 2694 2694 if (infoPtr->nHotItem < 0) 2695 return -1;2695 return -1; 2696 2696 2697 2697 return (LRESULT)infoPtr->nHotItem; … … 2945 2945 if (nIndex == -1) { 2946 2946 /* 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[] table2949 * - index of insertion is at the end of existing buttons2950 * I only see this happen with nIndex == -1, but it could have a special2951 * 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); 2955 2955 2956 2956 nIndex = infoPtr->nNumButtons; … … 3447 3447 if (GetWindowLongA (hwnd, GWL_STYLE) & TBSTYLE_FLAT) 3448 3448 { 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 ??? */ 3452 3452 3453 3453 } 3454 3454 3455 3455 if (nOldHotItem < 0) 3456 return -1;3456 return -1; 3457 3457 3458 3458 return (LRESULT)nOldHotItem; … … 3842 3842 return 0; 3843 3843 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 } 3856 3856 3857 3857 SetCapture (hwnd); … … 3925 3925 ReleaseDC (hwnd, hdc); 3926 3926 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 NMTOOLBARWnmtb;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 } 3953 3953 3954 3954 infoPtr->nButtonDown = -1; … … 4223 4223 4224 4224 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 } 4231 4231 } 4232 4232 … … 4274 4274 return TOOLBAR_AddStringW (hwnd, wParam, lParam); 4275 4275 4276 case TB_AUTOSIZE:4277 return TOOLBAR_AutoSize (hwnd);4276 case TB_AUTOSIZE: 4277 return TOOLBAR_AutoSize (hwnd); 4278 4278 4279 4279 case TB_BUTTONCOUNT: … … 4301 4301 return TOOLBAR_EnableButton (hwnd, wParam, lParam); 4302 4302 4303 case TB_GETANCHORHIGHLIGHT:4304 return TOOLBAR_GetAnchorHighlight (hwnd);4303 case TB_GETANCHORHIGHLIGHT: 4304 return TOOLBAR_GetAnchorHighlight (hwnd); 4305 4305 4306 4306 case TB_GETBITMAP: … … 4339 4339 return TOOLBAR_GetHotImageList (hwnd, wParam, lParam); 4340 4340 4341 case TB_GETHOTITEM:4342 return TOOLBAR_GetHotItem (hwnd);4341 case TB_GETHOTITEM: 4342 return TOOLBAR_GetHotItem (hwnd); 4343 4343 4344 4344 case TB_GETIMAGELIST: … … 4378 4378 return TOOLBAR_GetUnicodeFormat (hwnd, wParam, lParam); 4379 4379 4380 case CCM_GETVERSION:4381 return TOOLBAR_GetVersion (hwnd);4380 case CCM_GETVERSION: 4381 return TOOLBAR_GetVersion (hwnd); 4382 4382 4383 4383 case TB_HIDEBUTTON: … … 4435 4435 return TOOLBAR_SaveRestoreW(hwnd,wParam,lParam); 4436 4436 4437 case TB_SETANCHORHIGHLIGHT:4438 return TOOLBAR_SetAnchorHighlight (hwnd, wParam);4437 case TB_SETANCHORHIGHLIGHT: 4438 return TOOLBAR_SetAnchorHighlight (hwnd, wParam); 4439 4439 4440 4440 case TB_SETBITMAPSIZE: … … 4470 4470 return TOOLBAR_SetHotImageList (hwnd, wParam, lParam); 4471 4471 4472 case TB_SETHOTITEM:4473 return TOOLBAR_SetHotItem (hwnd, wParam);4472 case TB_SETHOTITEM: 4473 return TOOLBAR_SetHotItem (hwnd, wParam); 4474 4474 4475 4475 case TB_SETIMAGELIST: … … 4507 4507 return TOOLBAR_SetUnicodeFormat (hwnd, wParam, lParam); 4508 4508 4509 case CCM_SETVERSION:4510 return TOOLBAR_SetVersion (hwnd, (INT)wParam);4509 case CCM_SETVERSION: 4510 return TOOLBAR_SetVersion (hwnd, (INT)wParam); 4511 4511 4512 4512 /* case WM_CHAR: */ … … 4518 4518 return TOOLBAR_EraseBackground (hwnd, wParam, lParam); 4519 4519 4520 case WM_GETFONT:4521 return TOOLBAR_GetFont (hwnd, wParam, lParam);4520 case WM_GETFONT: 4521 return TOOLBAR_GetFont (hwnd, wParam, lParam); 4522 4522 4523 4523 /* case WM_KEYDOWN: */ … … 4556 4556 return TOOLBAR_Size (hwnd, wParam, lParam); 4557 4557 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); 4560 4560 4561 4561 /* case WM_SYSCOLORCHANGE: */
Note:
See TracChangeset
for help on using the changeset viewer.
