Changeset 496 for trunk/src/comctl32/toolbar.c
- Timestamp:
- Aug 14, 1999, 6:13:16 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/comctl32/toolbar.c
r295 r496 1 /* $Id: toolbar.c,v 1.1 1 1999-07-12 15:58:49cbratschi Exp $ */1 /* $Id: toolbar.c,v 1.12 1999-08-14 16:13:13 cbratschi Exp $ */ 2 2 /* 3 3 * Toolbar control … … 14 14 * - Fix TB_SETROWS. 15 15 * - Tooltip support (almost complete). 16 * - Internal COMMCTL32 bitmaps.17 16 * - Fix TOOLBAR_SetButtonInfo32A. 18 17 * - Drag & drop of buttons … … 45 44 #define BOTTOM_BORDER 2 46 45 47 #define TOOLBAR_GetInfoPtr( wndPtr) ((TOOLBAR_INFO *)GetWindowLongA(hwnd,0))46 #define TOOLBAR_GetInfoPtr(hwnd) ((TOOLBAR_INFO *)GetWindowLongA(hwnd,0)) 48 47 49 48 … … 130 129 internals directly */ 131 130 132 HDC hdcImageList = CreateCompatibleDC (0);133 HDC hdcMask = CreateCompatibleDC (0);134 131 HIMAGELIST himl = infoPtr->himlDef; 135 132 HBITMAP hbmMask; 133 HDC hdcImageList; 134 HDC hdcMask; 135 136 if (!himl) 137 return; 138 139 /* create new dc's */ 140 hdcImageList = CreateCompatibleDC (0); 141 hdcMask = CreateCompatibleDC (0); 136 142 137 143 /* create new bitmap */ … … 179 185 180 186 rc = btnPtr->rect; 187 188 /* separator */ 181 189 if (btnPtr->fsStyle & TBSTYLE_SEP) 182 190 { 183 if ((dwStyle & TBSTYLE_FLAT) && (btnPtr->i dCommand== 0))191 if ((dwStyle & TBSTYLE_FLAT) && (btnPtr->iBitmap == 0)) 184 192 TOOLBAR_DrawFlatSeparator (&rc, hdc); 185 193 return; … … 1544 1552 * This function implements the toolbar customization dialog. 1545 1553 */ 1546 BOOL WINAPI1554 static BOOL WINAPI 1547 1555 TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) 1548 1556 { … … 1585 1593 LPTBADDBITMAP lpAddBmp = (LPTBADDBITMAP)lParam; 1586 1594 INT nIndex = 0,nButtons; 1595 HBITMAP hbmLoad; 1587 1596 1588 1597 if (!lpAddBmp) … … 1602 1611 // TRACE ("adding %d internal bitmaps!\n", nButtons); 1603 1612 1604 /* Windows resize all the buttons to the size of a newly added STandard Image*/1613 /* Windows resize all the buttons to the size of a newly added standard Image*/ 1605 1614 if (lpAddBmp->nID & 1) 1606 1615 { … … 1650 1659 else if (lpAddBmp->hInst == HINST_COMMCTRL) 1651 1660 { 1652 /* add internal bitmaps */ 1653 // FIXME ("internal bitmaps not supported!\n"); 1654 1655 /* Hack to "add" some reserved images within the image list 1656 to get the right image indices */ 1657 nIndex = ImageList_GetImageCount (infoPtr->himlDef); 1658 ImageList_SetImageCount (infoPtr->himlDef, nIndex + nButtons); 1661 /* Add system bitmaps */ 1662 switch (lpAddBmp->nID) 1663 { 1664 case IDB_STD_SMALL_COLOR: 1665 hbmLoad = LoadBitmapA (COMCTL32_hModule, 1666 MAKEINTRESOURCEA(IDB_STD_SMALL)); 1667 nIndex = ImageList_AddMasked (infoPtr->himlDef, 1668 hbmLoad, CLR_DEFAULT); 1669 DeleteObject (hbmLoad); 1670 break; 1671 1672 case IDB_STD_LARGE_COLOR: 1673 hbmLoad = LoadBitmapA (COMCTL32_hModule, 1674 MAKEINTRESOURCEA(IDB_STD_LARGE)); 1675 nIndex = ImageList_AddMasked (infoPtr->himlDef, 1676 hbmLoad, CLR_DEFAULT); 1677 DeleteObject (hbmLoad); 1678 break; 1679 1680 case IDB_VIEW_SMALL_COLOR: 1681 hbmLoad = LoadBitmapA (COMCTL32_hModule, 1682 MAKEINTRESOURCEA(IDB_VIEW_SMALL)); 1683 nIndex = ImageList_AddMasked (infoPtr->himlDef, 1684 hbmLoad, CLR_DEFAULT); 1685 DeleteObject (hbmLoad); 1686 break; 1687 1688 case IDB_VIEW_LARGE_COLOR: 1689 hbmLoad = LoadBitmapA (COMCTL32_hModule, 1690 MAKEINTRESOURCEA(IDB_VIEW_LARGE)); 1691 nIndex = ImageList_AddMasked (infoPtr->himlDef, 1692 hbmLoad, CLR_DEFAULT); 1693 DeleteObject (hbmLoad); 1694 break; 1695 1696 case IDB_HIST_SMALL_COLOR: 1697 hbmLoad = LoadBitmapA (COMCTL32_hModule, 1698 MAKEINTRESOURCEA(IDB_HIST_SMALL)); 1699 nIndex = ImageList_AddMasked (infoPtr->himlDef, 1700 hbmLoad, CLR_DEFAULT); 1701 DeleteObject (hbmLoad); 1702 break; 1703 1704 case IDB_HIST_LARGE_COLOR: 1705 hbmLoad = LoadBitmapA (COMCTL32_hModule, 1706 MAKEINTRESOURCEA(IDB_HIST_LARGE)); 1707 nIndex = ImageList_AddMasked (infoPtr->himlDef, 1708 hbmLoad, CLR_DEFAULT); 1709 DeleteObject (hbmLoad); 1710 break; 1711 1712 default: 1713 nIndex = ImageList_GetImageCount (infoPtr->himlDef); 1714 //ERR ("invalid imagelist!\n"); 1715 break; 1716 } 1659 1717 } 1660 1718 else 1661 1719 { 1662 HBITMAP hBmp = 1663 LoadBitmapA (lpAddBmp->hInst, (LPSTR)lpAddBmp->nID); 1664 nIndex = ImageList_AddMasked (infoPtr->himlDef, hBmp, CLR_DEFAULT); 1665 1666 DeleteObject (hBmp); 1720 hbmLoad = LoadBitmapA (lpAddBmp->hInst, (LPSTR)lpAddBmp->nID); 1721 nIndex = ImageList_AddMasked (infoPtr->himlDef, hbmLoad, CLR_DEFAULT); 1722 DeleteObject (hbmLoad); 1667 1723 } 1668 1724 … … 3825 3881 3826 3882 3827 LRESULT WINAPI3883 static LRESULT WINAPI 3828 3884 ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) 3829 3885 {
Note:
See TracChangeset
for help on using the changeset viewer.