Ignore:
Timestamp:
Aug 28, 1999, 11:25:56 AM (26 years ago)
Author:
achimha
Message:

merged with latest WINE changes

File:
1 edited

Legend:

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

    r496 r722  
    1 /* $Id: propsheet.c,v 1.7 1999-08-14 16:13:12 cbratschi Exp $ */
     1/* $Id: propsheet.c,v 1.8 1999-08-28 09:25:56 achimha Exp $ */
    22/*
    33 * Property Sheets
     
    1313 *   - Unicode property sheets
    1414 */
     15
     16/* WINE 990815 level */
    1517
    1618/* CB: Odin problems:
     
    6769  int width;
    6870  int height;
     71  HIMAGELIST hImageList;
    6972} PropSheetInfo;
    7073
     
    159162  psInfo->restartWindows = FALSE;
    160163  psInfo->rebootSystem = FALSE;
     164  psInfo->hImageList = 0;
    161165
    162166  return TRUE;
     
    277281//  TRACE(propsheet, "Tab %d %s\n",index,debugstr_w((LPCWSTR)p));
    278282  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  }
    279304
    280305  return TRUE;
     
    577602  nTabs = psInfo->ppshheader->nPages;
    578603
     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
    579613  for (i = 0; i < nTabs; i++)
    580614  {
     615    item.iImage = i;
     616
    581617    WideCharToMultiByte(CP_ACP, 0,
    582618                        (LPCWSTR)psInfo->proppage[i].pszText,
     
    11931229  COMCTL32_Free(psInfo->proppage);
    11941230  COMCTL32_Free(psInfo->strPropertiesFor);
     1231  ImageList_Destroy(psInfo->hImageList);
    11951232
    11961233  GlobalFree((HGLOBAL)psInfo);
Note: See TracChangeset for help on using the changeset viewer.