Index: trunk/src/comctl32/comctl32undoc.c
===================================================================
--- trunk/src/comctl32/comctl32undoc.c	(revision 721)
+++ trunk/src/comctl32/comctl32undoc.c	(revision 722)
@@ -1,3 +1,3 @@
-/* $Id: comctl32undoc.c,v 1.10 1999-08-14 16:13:10 cbratschi Exp $ */
+/* $Id: comctl32undoc.c,v 1.11 1999-08-28 09:25:56 achimha Exp $ */
 /*
  * Undocumented functions from COMCTL32.DLL
@@ -11,4 +11,6 @@
  *
  */
+
+/* WINE 990815 level */
 
 /* CB: todo
@@ -1837,5 +1839,5 @@
  */
 INT WINAPI COMCTL32_StrCmpNA( LPCSTR lpStr1, LPCSTR lpStr2, int nChar) {
-//  return lstrncmpA(lpStr1, lpStr2, nChar);
+  return strncmp(lpStr1, lpStr2, nChar);
 }
 
Index: trunk/src/comctl32/propsheet.c
===================================================================
--- trunk/src/comctl32/propsheet.c	(revision 721)
+++ trunk/src/comctl32/propsheet.c	(revision 722)
@@ -1,3 +1,3 @@
-/* $Id: propsheet.c,v 1.7 1999-08-14 16:13:12 cbratschi Exp $ */
+/* $Id: propsheet.c,v 1.8 1999-08-28 09:25:56 achimha Exp $ */
 /*
  * Property Sheets
@@ -13,4 +13,6 @@
  *   - Unicode property sheets
  */
+
+/* WINE 990815 level */
 
 /* CB: Odin problems:
@@ -67,4 +69,5 @@
   int width;
   int height;
+  HIMAGELIST hImageList;
 } PropSheetInfo;
 
@@ -159,4 +162,5 @@
   psInfo->restartWindows = FALSE;
   psInfo->rebootSystem = FALSE;
+  psInfo->hImageList = 0;
 
   return TRUE;
@@ -277,4 +281,25 @@
 //  TRACE(propsheet, "Tab %d %s\n",index,debugstr_w((LPCWSTR)p));
   p += lstrlenW((LPCWSTR)p) + 1;
+
+  /*
+   * Build the image list for icons
+   */
+  if ((dwFlags & PSP_USEHICON) || (dwFlags & PSP_USEICONID))
+  {
+    HICON hIcon;
+    int icon_cx = GetSystemMetrics(SM_CXSMICON);
+    int icon_cy = GetSystemMetrics(SM_CYSMICON);
+
+    if (dwFlags & PSP_USEICONID)
+      hIcon = LoadImageA(lppsp->hInstance, lppsp->u2.pszIcon, IMAGE_ICON, 
+                         icon_cx, icon_cy, LR_DEFAULTCOLOR);
+    else
+      hIcon = lppsp->u2.hIcon;
+
+    if (psInfo->hImageList == 0)
+      psInfo->hImageList = ImageList_Create(icon_cx, icon_cy, ILC_COLOR, 1, 1);
+
+    ImageList_AddIcon(psInfo->hImageList, hIcon);
+  }
 
   return TRUE;
@@ -577,6 +602,17 @@
   nTabs = psInfo->ppshheader->nPages;
 
+  /*
+   * Set the image list for icons.
+   */
+  if (psInfo->hImageList)
+  {
+    item.mask |= TCIF_IMAGE;
+    SendMessageA(hwndTabCtrl, TCM_SETIMAGELIST, 0, (LPARAM)psInfo->hImageList);
+  }
+
   for (i = 0; i < nTabs; i++)
   {
+    item.iImage = i;
+
     WideCharToMultiByte(CP_ACP, 0,
                         (LPCWSTR)psInfo->proppage[i].pszText,
@@ -1193,4 +1229,5 @@
   COMCTL32_Free(psInfo->proppage);
   COMCTL32_Free(psInfo->strPropertiesFor);
+  ImageList_Destroy(psInfo->hImageList);
 
   GlobalFree((HGLOBAL)psInfo);
Index: trunk/src/comctl32/tab.c
===================================================================
--- trunk/src/comctl32/tab.c	(revision 721)
+++ trunk/src/comctl32/tab.c	(revision 722)
@@ -1,3 +1,3 @@
-/* $Id: tab.c,v 1.11 1999-08-21 12:10:02 cbratschi Exp $ */
+/* $Id: tab.c,v 1.12 1999-08-28 09:25:56 achimha Exp $ */
 /*
  * Tab control
@@ -12,5 +12,8 @@
  *  Image list support
  *  Multiline support
+ *  Unicode support
  */
+
+/* WINE 990815 level */
 
 #include <string.h>
@@ -643,6 +646,6 @@
    * a font.
    */
-  hdc = GetDC(hwnd);
-
+  hdc = GetDC(hwnd); 
+    
   hFont = infoPtr->hFont ? infoPtr->hFont : GetStockObject (SYSTEM_FONT);
   hOldFont = SelectObject (hdc, hFont);
@@ -653,5 +656,5 @@
    */
   GetClientRect(hwnd, &clientRect);
-
+  
   /*
    * The leftmost item will be "0" aligned
@@ -661,4 +664,7 @@
   if (!((lStyle & TCS_FIXEDWIDTH) || (lStyle & TCS_OWNERDRAWFIXED)))
   {
+    int item_height;
+    int icon_height = 0;
+
     /*
      * Use the current font to determine the height of a tab.
@@ -667,8 +673,22 @@
 
     /*
-     * Make sure there is enough space for the letters + growing the
-     * selected item + extra space for the selected item.
-     */
-    infoPtr->tabHeight = fontMetrics.tmHeight + 2*VERTICAL_ITEM_PADDING +
+     * Get the icon height
+     */
+    if (infoPtr->himl)
+      ImageList_GetIconSize(infoPtr->himl, 0, &icon_height);
+
+    /*
+     * Take the highest between font or icon
+     */
+    if (fontMetrics.tmHeight > icon_height)
+      item_height = fontMetrics.tmHeight;
+    else
+      item_height = icon_height;
+
+    /*
+     * Make sure there is enough space for the letters + icon + growing the 
+     * selected item + extra space for the selected item.   
+     */
+    infoPtr->tabHeight = item_height + 2*VERTICAL_ITEM_PADDING +  
       SELECTED_TAB_OFFSET;
   }
@@ -679,16 +699,16 @@
      * Calculate the vertical position of the tab
      */
-    if (lStyle & TCS_BOTTOM)
-    {
-      infoPtr->items[curItem].rect.bottom = clientRect.bottom -
+    if (lStyle & TCS_BOTTOM) 
+    {
+      infoPtr->items[curItem].rect.bottom = clientRect.bottom - 
                                             SELECTED_TAB_OFFSET;
-      infoPtr->items[curItem].rect.top = clientRect.bottom -
+      infoPtr->items[curItem].rect.top = clientRect.bottom - 
                                          infoPtr->tabHeight;
     }
-    else
-    {
-      infoPtr->items[curItem].rect.top = clientRect.top +
+    else 
+    {
+      infoPtr->items[curItem].rect.top = clientRect.top + 
                                          SELECTED_TAB_OFFSET;
-      infoPtr->items[curItem].rect.bottom = clientRect.top +
+      infoPtr->items[curItem].rect.bottom = clientRect.top + 
                                             infoPtr->tabHeight;
     }
@@ -707,20 +727,33 @@
     else
     {
+      int icon_width  = 0;
+      int num = 2;
+
       /*
        * Calculate how wide the tab is depending on the text it contains
        */
-      GetTextExtentPoint32W(hdc, infoPtr->items[curItem].pszText,
-                            lstrlenW(infoPtr->items[curItem].pszText), &size);
+      GetTextExtentPoint32A(hdc, infoPtr->items[curItem].pszText, 
+                            lstrlenA(infoPtr->items[curItem].pszText), &size);
+
+      /*
+       * Add the icon width
+       */
+      if (infoPtr->himl)
+      {
+        ImageList_GetIconSize(infoPtr->himl, &icon_width, 0);
+        num++;
+      }
 
       infoPtr->items[curItem].rect.right = infoPtr->items[curItem].rect.left +
-                                           size.cx + 2*HORIZONTAL_ITEM_PADDING;
-    }
-
-//    TRACE(tab, "TextSize: %i\n ", size.cx);
-//    TRACE(tab, "Rect: T %i, L %i, B %i, R %i\n",
-//        infoPtr->items[curItem].rect.top,
-//        infoPtr->items[curItem].rect.left,
-//        infoPtr->items[curItem].rect.bottom,
-//        infoPtr->items[curItem].rect.right);
+                                           size.cx + icon_width + 
+                                           num*HORIZONTAL_ITEM_PADDING;
+    }
+
+//    TRACE("TextSize: %i\n ", size.cx);
+//    TRACE("Rect: T %i, L %i, B %i, R %i\n", 
+//	  infoPtr->items[curItem].rect.top,
+//	  infoPtr->items[curItem].rect.left,
+//	  infoPtr->items[curItem].rect.bottom,
+//	  infoPtr->items[curItem].rect.right);  
 
     /*
@@ -737,9 +770,9 @@
    * Check if we need a scrolling control.
    */
-  infoPtr->needsScrolling = (curItemLeftPos + (2*SELECTED_TAB_OFFSET) >
+  infoPtr->needsScrolling = (curItemLeftPos + (2*SELECTED_TAB_OFFSET) > 
                              clientRect.right);
 
-  TAB_SetupScrolling(hwnd, infoPtr, &clientRect);
-
+  TAB_SetupScrolling(hwnd, infoPtr, &clientRect);      
+  
   /*
    * Cleanup
@@ -933,5 +966,5 @@
                       r.left, r.top+1, ILD_NORMAL);
       ImageList_GetIconSize (infoPtr->himl, &cx, &cy);
-      r.left+=cx;
+      r.left+=(cx + HORIZONTAL_ITEM_PADDING);
     }
 
@@ -1398,15 +1431,15 @@
 }
 
-static LRESULT
+static LRESULT 
 TAB_SetItemA (HWND hwnd, WPARAM wParam, LPARAM lParam)
 {
   TAB_INFO *infoPtr = TAB_GetInfoPtr(hwnd);
-  TCITEMA *tabItem;
-  TAB_ITEM *wineItem;
+  TCITEMA *tabItem; 
+  TAB_ITEM *wineItem; 
   INT    iItem,len;
 
   iItem=(INT) wParam;
   tabItem=(LPTCITEMA ) lParam;
-//  TRACE (tab,"%d %p\n",iItem, tabItem);
+//  TRACE("%d %p\n",iItem, tabItem);
   if ((iItem<0) || (iItem>infoPtr->uNumItem)) return FALSE;
 
@@ -1419,16 +1452,22 @@
     wineItem->lParam=tabItem->lParam;
 
-//  if (tabItem->mask & TCIF_RTLREADING)
-//    FIXME (tab,"TCIF_RTLREADING\n");
-
-  if (tabItem->mask & TCIF_STATE)
+//  if (tabItem->mask & TCIF_RTLREADING) 
+//    FIXME("TCIF_RTLREADING\n");
+
+  if (tabItem->mask & TCIF_STATE) 
     wineItem->dwState=tabItem->dwState;
 
   if (tabItem->mask & TCIF_TEXT) {
-   len = lstrlenA (tabItem->pszText);
-   if (len>wineItem->cchTextMax)
-     wineItem->pszText = COMCTL32_ReAlloc (wineItem->pszText, (len+1)*sizeof(WCHAR));
-   lstrcpyAtoW (wineItem->pszText, tabItem->pszText);
-  }
+   len=lstrlenA (tabItem->pszText);
+   if (len>wineItem->cchTextMax) 
+     wineItem->pszText= COMCTL32_ReAlloc (wineItem->pszText, len+1);
+   lstrcpyA (wineItem->pszText, tabItem->pszText);
+  }
+
+  /*
+   * Update and repaint tabs.
+   */
+  TAB_SetItemBounds(hwnd);
+  TAB_InvalidateTabArea(hwnd,infoPtr);
 
   return TRUE;
