- Timestamp:
- Aug 28, 1999, 11:25:56 AM (26 years ago)
- Location:
- trunk/src/comctl32
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/comctl32/comctl32undoc.c
r496 r722 1 /* $Id: comctl32undoc.c,v 1.1 0 1999-08-14 16:13:10 cbratschiExp $ */1 /* $Id: comctl32undoc.c,v 1.11 1999-08-28 09:25:56 achimha Exp $ */ 2 2 /* 3 3 * Undocumented functions from COMCTL32.DLL … … 11 11 * 12 12 */ 13 14 /* WINE 990815 level */ 13 15 14 16 /* CB: todo … … 1837 1839 */ 1838 1840 INT WINAPI COMCTL32_StrCmpNA( LPCSTR lpStr1, LPCSTR lpStr2, int nChar) { 1839 // return lstrncmpA(lpStr1, lpStr2, nChar);1841 return strncmp(lpStr1, lpStr2, nChar); 1840 1842 } 1841 1843 -
trunk/src/comctl32/propsheet.c
r496 r722 1 /* $Id: propsheet.c,v 1. 7 1999-08-14 16:13:12 cbratschiExp $ */1 /* $Id: propsheet.c,v 1.8 1999-08-28 09:25:56 achimha Exp $ */ 2 2 /* 3 3 * Property Sheets … … 13 13 * - Unicode property sheets 14 14 */ 15 16 /* WINE 990815 level */ 15 17 16 18 /* CB: Odin problems: … … 67 69 int width; 68 70 int height; 71 HIMAGELIST hImageList; 69 72 } PropSheetInfo; 70 73 … … 159 162 psInfo->restartWindows = FALSE; 160 163 psInfo->rebootSystem = FALSE; 164 psInfo->hImageList = 0; 161 165 162 166 return TRUE; … … 277 281 // TRACE(propsheet, "Tab %d %s\n",index,debugstr_w((LPCWSTR)p)); 278 282 p += lstrlenW((LPCWSTR)p) + 1; 283 284 /* 285 * Build the image list for icons 286 */ 287 if ((dwFlags & PSP_USEHICON) || (dwFlags & PSP_USEICONID)) 288 { 289 HICON hIcon; 290 int icon_cx = GetSystemMetrics(SM_CXSMICON); 291 int icon_cy = GetSystemMetrics(SM_CYSMICON); 292 293 if (dwFlags & PSP_USEICONID) 294 hIcon = LoadImageA(lppsp->hInstance, lppsp->u2.pszIcon, IMAGE_ICON, 295 icon_cx, icon_cy, LR_DEFAULTCOLOR); 296 else 297 hIcon = lppsp->u2.hIcon; 298 299 if (psInfo->hImageList == 0) 300 psInfo->hImageList = ImageList_Create(icon_cx, icon_cy, ILC_COLOR, 1, 1); 301 302 ImageList_AddIcon(psInfo->hImageList, hIcon); 303 } 279 304 280 305 return TRUE; … … 577 602 nTabs = psInfo->ppshheader->nPages; 578 603 604 /* 605 * Set the image list for icons. 606 */ 607 if (psInfo->hImageList) 608 { 609 item.mask |= TCIF_IMAGE; 610 SendMessageA(hwndTabCtrl, TCM_SETIMAGELIST, 0, (LPARAM)psInfo->hImageList); 611 } 612 579 613 for (i = 0; i < nTabs; i++) 580 614 { 615 item.iImage = i; 616 581 617 WideCharToMultiByte(CP_ACP, 0, 582 618 (LPCWSTR)psInfo->proppage[i].pszText, … … 1193 1229 COMCTL32_Free(psInfo->proppage); 1194 1230 COMCTL32_Free(psInfo->strPropertiesFor); 1231 ImageList_Destroy(psInfo->hImageList); 1195 1232 1196 1233 GlobalFree((HGLOBAL)psInfo); -
trunk/src/comctl32/tab.c
r603 r722 1 /* $Id: tab.c,v 1.1 1 1999-08-21 12:10:02 cbratschiExp $ */1 /* $Id: tab.c,v 1.12 1999-08-28 09:25:56 achimha Exp $ */ 2 2 /* 3 3 * Tab control … … 12 12 * Image list support 13 13 * Multiline support 14 * Unicode support 14 15 */ 16 17 /* WINE 990815 level */ 15 18 16 19 #include <string.h> … … 643 646 * a font. 644 647 */ 645 hdc = GetDC(hwnd); 646 648 hdc = GetDC(hwnd); 649 647 650 hFont = infoPtr->hFont ? infoPtr->hFont : GetStockObject (SYSTEM_FONT); 648 651 hOldFont = SelectObject (hdc, hFont); … … 653 656 */ 654 657 GetClientRect(hwnd, &clientRect); 655 658 656 659 /* 657 660 * The leftmost item will be "0" aligned … … 661 664 if (!((lStyle & TCS_FIXEDWIDTH) || (lStyle & TCS_OWNERDRAWFIXED))) 662 665 { 666 int item_height; 667 int icon_height = 0; 668 663 669 /* 664 670 * Use the current font to determine the height of a tab. … … 667 673 668 674 /* 669 * Make sure there is enough space for the letters + growing the 670 * selected item + extra space for the selected item. 671 */ 672 infoPtr->tabHeight = fontMetrics.tmHeight + 2*VERTICAL_ITEM_PADDING + 675 * Get the icon height 676 */ 677 if (infoPtr->himl) 678 ImageList_GetIconSize(infoPtr->himl, 0, &icon_height); 679 680 /* 681 * Take the highest between font or icon 682 */ 683 if (fontMetrics.tmHeight > icon_height) 684 item_height = fontMetrics.tmHeight; 685 else 686 item_height = icon_height; 687 688 /* 689 * Make sure there is enough space for the letters + icon + growing the 690 * selected item + extra space for the selected item. 691 */ 692 infoPtr->tabHeight = item_height + 2*VERTICAL_ITEM_PADDING + 673 693 SELECTED_TAB_OFFSET; 674 694 } … … 679 699 * Calculate the vertical position of the tab 680 700 */ 681 if (lStyle & TCS_BOTTOM) 682 { 683 infoPtr->items[curItem].rect.bottom = clientRect.bottom - 701 if (lStyle & TCS_BOTTOM) 702 { 703 infoPtr->items[curItem].rect.bottom = clientRect.bottom - 684 704 SELECTED_TAB_OFFSET; 685 infoPtr->items[curItem].rect.top = clientRect.bottom - 705 infoPtr->items[curItem].rect.top = clientRect.bottom - 686 706 infoPtr->tabHeight; 687 707 } 688 else 689 { 690 infoPtr->items[curItem].rect.top = clientRect.top + 708 else 709 { 710 infoPtr->items[curItem].rect.top = clientRect.top + 691 711 SELECTED_TAB_OFFSET; 692 infoPtr->items[curItem].rect.bottom = clientRect.top + 712 infoPtr->items[curItem].rect.bottom = clientRect.top + 693 713 infoPtr->tabHeight; 694 714 } … … 707 727 else 708 728 { 729 int icon_width = 0; 730 int num = 2; 731 709 732 /* 710 733 * Calculate how wide the tab is depending on the text it contains 711 734 */ 712 GetTextExtentPoint32W(hdc, infoPtr->items[curItem].pszText, 713 lstrlenW(infoPtr->items[curItem].pszText), &size); 735 GetTextExtentPoint32A(hdc, infoPtr->items[curItem].pszText, 736 lstrlenA(infoPtr->items[curItem].pszText), &size); 737 738 /* 739 * Add the icon width 740 */ 741 if (infoPtr->himl) 742 { 743 ImageList_GetIconSize(infoPtr->himl, &icon_width, 0); 744 num++; 745 } 714 746 715 747 infoPtr->items[curItem].rect.right = infoPtr->items[curItem].rect.left + 716 size.cx + 2*HORIZONTAL_ITEM_PADDING; 717 } 718 719 // TRACE(tab, "TextSize: %i\n ", size.cx); 720 // TRACE(tab, "Rect: T %i, L %i, B %i, R %i\n", 721 // infoPtr->items[curItem].rect.top, 722 // infoPtr->items[curItem].rect.left, 723 // infoPtr->items[curItem].rect.bottom, 724 // infoPtr->items[curItem].rect.right); 748 size.cx + icon_width + 749 num*HORIZONTAL_ITEM_PADDING; 750 } 751 752 // TRACE("TextSize: %i\n ", size.cx); 753 // TRACE("Rect: T %i, L %i, B %i, R %i\n", 754 // infoPtr->items[curItem].rect.top, 755 // infoPtr->items[curItem].rect.left, 756 // infoPtr->items[curItem].rect.bottom, 757 // infoPtr->items[curItem].rect.right); 725 758 726 759 /* … … 737 770 * Check if we need a scrolling control. 738 771 */ 739 infoPtr->needsScrolling = (curItemLeftPos + (2*SELECTED_TAB_OFFSET) > 772 infoPtr->needsScrolling = (curItemLeftPos + (2*SELECTED_TAB_OFFSET) > 740 773 clientRect.right); 741 774 742 TAB_SetupScrolling(hwnd, infoPtr, &clientRect); 743 775 TAB_SetupScrolling(hwnd, infoPtr, &clientRect); 776 744 777 /* 745 778 * Cleanup … … 933 966 r.left, r.top+1, ILD_NORMAL); 934 967 ImageList_GetIconSize (infoPtr->himl, &cx, &cy); 935 r.left+= cx;968 r.left+=(cx + HORIZONTAL_ITEM_PADDING); 936 969 } 937 970 … … 1398 1431 } 1399 1432 1400 static LRESULT 1433 static LRESULT 1401 1434 TAB_SetItemA (HWND hwnd, WPARAM wParam, LPARAM lParam) 1402 1435 { 1403 1436 TAB_INFO *infoPtr = TAB_GetInfoPtr(hwnd); 1404 TCITEMA *tabItem; 1405 TAB_ITEM *wineItem; 1437 TCITEMA *tabItem; 1438 TAB_ITEM *wineItem; 1406 1439 INT iItem,len; 1407 1440 1408 1441 iItem=(INT) wParam; 1409 1442 tabItem=(LPTCITEMA ) lParam; 1410 // TRACE (tab,"%d %p\n",iItem, tabItem);1443 // TRACE("%d %p\n",iItem, tabItem); 1411 1444 if ((iItem<0) || (iItem>infoPtr->uNumItem)) return FALSE; 1412 1445 … … 1419 1452 wineItem->lParam=tabItem->lParam; 1420 1453 1421 // if (tabItem->mask & TCIF_RTLREADING) 1422 // FIXME (tab,"TCIF_RTLREADING\n");1423 1424 if (tabItem->mask & TCIF_STATE) 1454 // if (tabItem->mask & TCIF_RTLREADING) 1455 // FIXME("TCIF_RTLREADING\n"); 1456 1457 if (tabItem->mask & TCIF_STATE) 1425 1458 wineItem->dwState=tabItem->dwState; 1426 1459 1427 1460 if (tabItem->mask & TCIF_TEXT) { 1428 len = lstrlenA (tabItem->pszText); 1429 if (len>wineItem->cchTextMax) 1430 wineItem->pszText = COMCTL32_ReAlloc (wineItem->pszText, (len+1)*sizeof(WCHAR)); 1431 lstrcpyAtoW (wineItem->pszText, tabItem->pszText); 1432 } 1461 len=lstrlenA (tabItem->pszText); 1462 if (len>wineItem->cchTextMax) 1463 wineItem->pszText= COMCTL32_ReAlloc (wineItem->pszText, len+1); 1464 lstrcpyA (wineItem->pszText, tabItem->pszText); 1465 } 1466 1467 /* 1468 * Update and repaint tabs. 1469 */ 1470 TAB_SetItemBounds(hwnd); 1471 TAB_InvalidateTabArea(hwnd,infoPtr); 1433 1472 1434 1473 return TRUE;
Note:
See TracChangeset
for help on using the changeset viewer.