Index: trunk/src/user32/Makefile
===================================================================
--- trunk/src/user32/Makefile	(revision 2092)
+++ trunk/src/user32/Makefile	(revision 2093)
@@ -1,3 +1,3 @@
-# $Id: Makefile,v 1.48 1999-12-16 00:11:45 sandervl Exp $
+# $Id: Makefile,v 1.49 1999-12-16 16:53:56 cbratschi Exp $
 
 #
@@ -42,5 +42,5 @@
         winprop.obj wingdi.obj oslibgdi.obj winaccel.obj win32wbasepos.obj \
         oslibres.obj dummy.obj oslibmenu.obj dc.obj timer.obj \
-        caret.obj resource.obj winproc.obj \
+        caret.obj resource.obj winproc.obj text.obj \
         windlgmsg.obj windlg.obj win32wdesktop.obj
 
@@ -52,10 +52,10 @@
 !ifdef DEBUG
 !ifdef NODEBUGINFO
-	ilink /nodeb /map /noe /NOD /NoLogo /NOFREE @$(TARGET).lrf
+        ilink /nodeb /map /noe /NOD /NoLogo /NOFREE @$(TARGET).lrf
 !else
-	ilink /de /map  /noe /NOD /dbgpack /NoLogo /NOFREE @$(TARGET).lrf
+        ilink /de /map  /noe /NOD /dbgpack /NoLogo /NOFREE @$(TARGET).lrf
 !endif
 !else
-	ilink /map  /noe /NOD /NoLogo /FREE @$(TARGET).lrf
+        ilink /map  /noe /NOD /NoLogo /FREE @$(TARGET).lrf
 !endif
         $(CP) $@ $(PDWIN32_BIN)
@@ -64,9 +64,9 @@
         @echo Creating file <<$(@B).lrf
 $(OBJS)
-$(PDWIN32_LIB)/pmwinx.lib 
-$(PDWIN32_LIB)/gdi32.lib 
-$(PDWIN32_LIB)/kernel32.lib 
+$(PDWIN32_LIB)/pmwinx.lib
+$(PDWIN32_LIB)/gdi32.lib
+$(PDWIN32_LIB)/kernel32.lib
 $(PDWIN32_LIB)/libuls.lib
-$(PDWIN32_LIB)/odincrt.lib 
+$(PDWIN32_LIB)/odincrt.lib
 OS2386.LIB
 $(RTLLIB_O)
@@ -82,6 +82,6 @@
 
 
-resource.asm: user32.rc 
-    $(RC) $(RCFLAGS) -o resource.asm user32.rc 
+resource.asm: user32.rc
+    $(RC) $(RCFLAGS) -o resource.asm user32.rc
 
 resource.obj: resource.asm
@@ -148,4 +148,5 @@
 timer.obj:      timer.cpp win32wbase.h timer.h
 caret.obj:      caret.cpp win32wbase.h caret.h dcdata.h
+text.obj:       text.cpp
 
 clipboard.obj:  clipboard.cpp
Index: trunk/src/user32/edit.cpp
===================================================================
--- trunk/src/user32/edit.cpp	(revision 2092)
+++ trunk/src/user32/edit.cpp	(revision 2093)
@@ -1,3 +1,3 @@
-/* $Id: edit.cpp,v 1.22 1999-12-03 17:30:15 cbratschi Exp $ */
+/* $Id: edit.cpp,v 1.23 1999-12-16 16:53:56 cbratschi Exp $ */
 /*
  *      Edit control
@@ -12,5 +12,5 @@
  *
  * Status:  complete
- * Version: 5.00 (without undocumented specs)
+ * Version: 5.00
  */
 
@@ -20,8 +20,4 @@
     new in Win98, Win2k: for single line too
   - WinNT/Win2k: higher size limits (single: 0x7FFFFFFE, multi: none)
-  - problems with selection update: perhaps an Open32 bug
-    TextOutA: draws at wrong position
-    I've removed the workarounds, it makes no sense to fix GDI32 bugs here
-    -> rewrite TextOut and TabbedTextOut
 */
 
@@ -1150,5 +1146,5 @@
 
                 if (IntersectRect(&rcUpdate, &rcWnd, &rcLine))
-                        InvalidateRect(hwnd, &rcUpdate, FALSE);
+                        InvalidateRect(hwnd, &rcUpdate, TRUE);
         } else {
                 EDIT_GetLineRect(hwnd, es, sl, sc,
@@ -1157,5 +1153,5 @@
                                 &rcLine);
                 if (IntersectRect(&rcUpdate, &rcWnd, &rcLine))
-                        InvalidateRect(hwnd, &rcUpdate, FALSE);
+                        InvalidateRect(hwnd, &rcUpdate, TRUE);
                 for (l = sl + 1 ; l < el ; l++) {
                         EDIT_GetLineRect(hwnd, es, l, 0,
@@ -1164,9 +1160,9 @@
                                 &rcLine);
                         if (IntersectRect(&rcUpdate, &rcWnd, &rcLine))
-                                InvalidateRect(hwnd, &rcUpdate, FALSE);
+                                InvalidateRect(hwnd, &rcUpdate, TRUE);
                 }
                 EDIT_GetLineRect(hwnd, es, el, 0, ec, &rcLine);
                 if (IntersectRect(&rcUpdate, &rcWnd, &rcLine))
-                        InvalidateRect(hwnd, &rcUpdate, FALSE);
+                        InvalidateRect(hwnd, &rcUpdate, TRUE);
         }
         ShowCaret(hwnd);
@@ -1574,10 +1570,58 @@
         e = MIN(li + ll, MAX(li, e));
 
-        if (rev && (s != e) &&
-                        ((es->flags & EF_FOCUSED) || (es->style & ES_NOHIDESEL)))
+        if (rev && (s != e) && ((es->flags & EF_FOCUSED) || (es->style & ES_NOHIDESEL)))
         {
-          x += EDIT_PaintText(hwnd, es, dc, x, y, line, 0, s - li, FALSE);
-          x += EDIT_PaintText(hwnd, es, dc, x, y, line, s - li, e - s, TRUE);
-          x += EDIT_PaintText(hwnd, es, dc, x, y, line, e - li, li + ll - e, FALSE);
+          HRGN oldRgn,newRgn,combRgn;
+          RECT rect;
+          //CB: OS/2 has problems with relative string positions (i.e. Communicator)
+          //    fix: always calculate string from starting point, tab bugs fixed too
+          //    otherwise we have 'dancing characters'
+
+          if (!(es->style & ES_MULTILINE))
+          {
+            SIZE size;
+
+            rect.top = y;
+            rect.bottom = y+es->line_height;
+            GetTextExtentPoint32A(dc,es->text+li,s-li,&size);
+            rect.left = x+size.cx;
+            GetTextExtentPoint32A(dc,es->text+li,e-li,&size);
+            rect.right = x+size.cx;
+
+            oldRgn = CreateRectRgnIndirect(&rect); //dummy parameter
+            GetClipRgn(dc,oldRgn);
+            newRgn = CreateRectRgnIndirect(&rect);
+            combRgn = CreateRectRgnIndirect(&rect); //dummy parameter
+            CombineRgn(combRgn,oldRgn,newRgn,RGN_XOR);
+            SelectClipRgn(dc,combRgn);
+            EDIT_PaintText(hwnd,es,dc,x,y,line,0,ll,FALSE);
+            CombineRgn(combRgn,oldRgn,newRgn,RGN_AND);
+            SelectClipRgn(dc,combRgn);
+            EDIT_PaintText(hwnd,es,dc,x,y,line,0,e-li,TRUE);
+            DeleteObject(oldRgn);
+            DeleteObject(newRgn);
+            DeleteObject(combRgn);
+          } else
+          {
+            rect.top = y;
+            rect.bottom = y+es->line_height;
+            rect.left = x+LOWORD(TabbedTextOutA(dc,x,y,es->text+li,s-li,es->tabs_count,es->tabs,es->format_rect.left-es->x_offset));
+            rect.right = x+LOWORD(TabbedTextOutA(dc,x,y,es->text+li,e-li,es->tabs_count,es->tabs,es->format_rect.left-es->x_offset));
+
+            oldRgn = CreateRectRgnIndirect(&rect); //dummy parameter
+            GetClipRgn(dc,oldRgn);
+            newRgn = CreateRectRgnIndirect(&rect);
+            combRgn = CreateRectRgnIndirect(&rect); //dummy parameter
+            CombineRgn(combRgn,oldRgn,newRgn,RGN_XOR);
+            SelectClipRgn(dc,combRgn);
+            EDIT_PaintText(hwnd,es,dc,x,y,line,0,ll,FALSE);
+            CombineRgn(combRgn,oldRgn,newRgn,RGN_AND);
+            SelectClipRgn(dc,combRgn);
+            EDIT_PaintText(hwnd,es,dc,x,y,line,0,e-li,TRUE);
+            SelectClipRgn(dc,oldRgn);
+            DeleteObject(oldRgn);
+            DeleteObject(newRgn);
+            DeleteObject(combRgn);
+          }
         } else  EDIT_PaintText(hwnd, es, dc, x, y, line, 0, ll, FALSE);
 }
@@ -1600,10 +1644,12 @@
         BkColor = GetBkColor(dc);
         TextColor = GetTextColor(dc);
-        if (rev) {
+        if (rev)
+        {
                 SetBkColor(dc, GetSysColor(COLOR_HIGHLIGHT));
                 SetTextColor(dc, GetSysColor(COLOR_HIGHLIGHTTEXT));
         }
         li = EDIT_EM_LineIndex(hwnd, es, line);
-        if (es->style & ES_MULTILINE) {
+        if (es->style & ES_MULTILINE)
+        {
                 ret = (INT)LOWORD(TabbedTextOutA(dc, x, y, es->text + li + col, count,
                                         es->tabs_count, es->tabs, es->format_rect.left - es->x_offset));
@@ -1624,5 +1670,6 @@
             HeapFree(es->heap, 0, text);
         }
-        if (rev) {
+        if (rev)
+        {
                 SetBkColor(dc, BkColor);
                 SetTextColor(dc, TextColor);
Index: trunk/src/user32/scroll.cpp
===================================================================
--- trunk/src/user32/scroll.cpp	(revision 2092)
+++ trunk/src/user32/scroll.cpp	(revision 2093)
@@ -1,3 +1,3 @@
-/* $Id: scroll.cpp,v 1.27 1999-12-03 17:30:17 cbratschi Exp $ */
+/* $Id: scroll.cpp,v 1.28 1999-12-16 16:53:57 cbratschi Exp $ */
 /*
  * Scrollbar control
@@ -638,5 +638,6 @@
   HDC hdc;
 
-    hdc = GetDCEx( hwnd, 0, DCX_CACHE | ((nBar == SB_CTL) ? 0 : DCX_WINDOW));
+
+    hdc = GetDC(hwnd);
 
     if (!hdc) return;
@@ -810,5 +811,5 @@
         if (SCROLL_FocusWin == hwnd && SCROLL_Highlighted)
         {
-          hdc = GetDCEx(hwnd,0,DCX_CACHE);
+          hdc = GetDC(hwnd);
           SCROLL_DrawScrollBar(hwnd,hdc,nBar,FALSE,TRUE);
           ReleaseDC(hwnd,hdc);
@@ -866,5 +867,5 @@
           {
             SCROLL_Highlighted = FALSE;
-            hdc = GetDCEx(hwnd,0,DCX_CACHE);
+            hdc = GetDC(hwnd);
             SCROLL_DrawScrollBar(hwnd,hdc,nBar,FALSE,TRUE);
             ReleaseDC(hwnd,hdc);
@@ -885,5 +886,5 @@
           if (!SCROLL_Scrolling)
           {
-            hdc = GetDCEx(hwnd,0,DCX_CACHE);
+            hdc = GetDC(hwnd);
             SCROLL_DrawScrollBar(hwnd,hdc,nBar,FALSE,TRUE);
             ReleaseDC(hwnd,hdc);
@@ -896,5 +897,5 @@
     }
 
-    hdc = GetDCEx(hwnd,0,DCX_CACHE | ((nBar == SB_CTL) ? 0:DCX_WINDOW));
+    hdc = GetDC(hwnd);
 
     switch(SCROLL_trackHitTest)
Index: trunk/src/user32/text.cpp
===================================================================
--- trunk/src/user32/text.cpp	(revision 2093)
+++ trunk/src/user32/text.cpp	(revision 2093)
@@ -0,0 +1,200 @@
+/* $Id: text.cpp,v 1.1 1999-12-16 16:53:57 cbratschi Exp $ */
+
+/*
+ * Font and Text Functions
+ *
+ * Copyright 1999 Christoph Bratschi
+ *
+ *
+ * Project Odin Software License can be found in LICENSE.TXT
+ */
+
+#include "winuser.h"
+#include "user32.h"
+
+static const WORD wPattern55AA[] =
+{
+    0x5555, 0xaaaa, 0x5555, 0xaaaa,
+    0x5555, 0xaaaa, 0x5555, 0xaaaa
+};
+
+static HBRUSH  hPattern55AABrush = 0;
+static HBITMAP hPattern55AABitmap = 0;
+
+/*********************************************************************
+ *	CACHE_GetPattern55AABitmap
+ */
+HBITMAP CACHE_GetPattern55AABitmap(void)
+{
+    if (!hPattern55AABitmap)
+        hPattern55AABitmap = CreateBitmap( 8, 8, 1, 1, wPattern55AA );
+    return hPattern55AABitmap;
+}
+
+/*********************************************************************
+ *	CACHE_GetPattern55AABrush
+ */
+HBRUSH CACHE_GetPattern55AABrush(void)
+{
+    if (!hPattern55AABrush)
+        hPattern55AABrush = CreatePatternBrush(CACHE_GetPattern55AABitmap());
+    return hPattern55AABrush;
+}
+
+INT WIN32API DrawTextA(HDC hDC,LPCSTR lpString,INT nCount,PRECT lpRect,UINT nFormat)
+{
+  dprintf2(("USER32: DrawTextA %x",hDC));
+
+  return InternalDrawTextExA(hDC,lpString,nCount,lpRect,nFormat,NULL,FALSE);
+}
+//******************************************************************************
+//******************************************************************************
+INT WIN32API DrawTextW(HDC hDC,LPCWSTR lpString,INT nCount,PRECT lpRect,UINT nFormat)
+{
+  dprintf2(("USER32: DrawTextW %x",hDC));
+
+  return InternalDrawTextExW(hDC,lpString,nCount,lpRect,nFormat,NULL,FALSE);
+}
+//******************************************************************************
+//******************************************************************************
+INT WIN32API DrawTextExA(HDC hdc,LPCSTR lpchText,INT cchText,LPRECT lprc,UINT dwDTFormat,LPDRAWTEXTPARAMS lpDTParams)
+{
+  dprintf2(("USER32:DrawTextExA %x\n",hdc));
+
+  return InternalDrawTextExA(hdc,lpchText,cchText,lprc,dwDTFormat,lpDTParams,TRUE);
+}
+//******************************************************************************
+//******************************************************************************
+int WIN32API DrawTextExW(HDC hdc,LPWSTR lpchText,INT cchText,LPRECT lprc,UINT dwDTFormat,LPDRAWTEXTPARAMS lpDTParams)
+{
+  dprintf2(("USER32: DrawTextExW %x",hDC));
+
+  return InternalDrawTextExW(hdc,lpchText,cchText,lprc,dwDTFormat,lpDTParams,TRUE);
+}
+//******************************************************************************
+//******************************************************************************
+DWORD WIN32API GetTabbedTextExtentA( HDC hDC, LPCSTR lpString, int nCount, int nTabPositions, LPINT lpnTabStopPositions)
+{
+  dprintf2(("USER32: GetTabbedTextExtentA %x",hDC));
+
+  return InternalGetTabbedTextExtentA(hDC,lpString,nCount,nTabPositions,lpnTabStopPositions);
+}
+//******************************************************************************
+//******************************************************************************
+DWORD WIN32API GetTabbedTextExtentW(HDC hDC,LPCWSTR lpString,INT nCount,INT nTabPositions,LPINT lpnTabStopPositions)
+{
+  dprintf2(("USER32: GetTabbedTextExtentW %x",hDC));
+
+  return InternalGetTabbedTextExtentW(hDC,lpString,nCount,nTabPositions,lpnTabStopPositions);
+}
+//******************************************************************************
+//******************************************************************************
+LONG WIN32API TabbedTextOutA(HDC hdc,INT x,INT y,LPCSTR lpString,INT nCount,INT nTabPositions, LPINT lpnTabStopPositions,INT nTabOrigin)
+{
+  dprintf2(("USER32: TabbedTextOutA %x",hDC));
+
+  return InternalTabbedTextOutA(hdc,x,y,lpString,nCount,nTabPositions,lpnTabStopPositions,nTabOrigin);
+}
+//******************************************************************************
+//******************************************************************************
+LONG WIN32API TabbedTextOutW( HDC hdc, int x, int y, LPCWSTR lpString, int nCount, int nTabPositions, LPINT lpnTabStopPositions, int  nTabOrigin)
+{
+  dprintf2(("USER32: TabbedTextOutW %x",hDC));
+
+  return InternalTabbedTextOutW(hdc,x,y,lpString,nCount,nTabPositions,lpnTabStopPositions,nTabOrigin);
+}
+//******************************************************************************
+// WINE/objects/text.c
+//******************************************************************************
+static BOOL InternalGrayString(HDC hdc,HBRUSH hBrush,GRAYSTRINGPROC lpOutputFunc,LPARAM lpData,INT nCount,INT x,INT y,INT nWidth,INT nHeight,BOOL isUnicode)
+{
+    HBITMAP hbm, hbmsave;
+    HBRUSH hbsave;
+    HFONT hfsave;
+    HDC memdc = CreateCompatibleDC(hdc);
+    BOOL retval = TRUE;
+    RECT r;
+    COLORREF fg, bg;
+
+  if (!hdc) return FALSE;
+
+  if (nCount == 0)
+    nCount = isUnicode ? lstrlenW((LPCWSTR)lpData):lstrlenA((LPCSTR)lpData);
+
+  if((nWidth == 0 || nHeight == 0) && nCount != -1)
+  {
+    SIZE s;
+
+    if (isUnicode)
+      GetTextExtentPoint32W(hdc,(LPCWSTR)lpData,nCount,&s);
+    else
+      GetTextExtentPoint32A(hdc,(LPCSTR)lpData,nCount,&s);
+    if (nWidth == 0) nWidth = s.cx;
+    if (nHeight == 0) nHeight = s.cy;
+  }
+
+  r.left = r.top = 0;
+  r.right = nWidth;
+  r.bottom = nHeight;
+
+  hbm = CreateBitmap(nWidth,nHeight,1,1,NULL);
+  hbmsave = (HBITMAP)SelectObject(memdc,hbm);
+  FillRect(memdc,&r,(HBRUSH)GetStockObject(BLACK_BRUSH));
+  SetTextColor(memdc,RGB(255,255,255));
+  SetBkColor(memdc,RGB(0,0,0));
+  hfsave = (HFONT)SelectObject(memdc,GetCurrentObject(hdc,OBJ_FONT));
+
+  if (lpOutputFunc)
+    retval = lpOutputFunc(memdc,lpData,nCount);
+  else
+    if (isUnicode)
+      TextOutW(memdc,0,0,(LPCWSTR)lpData,nCount);
+    else
+      TextOutA(memdc,0,0,(LPCSTR)lpData,nCount);
+  SelectObject(memdc, hfsave);
+
+  /*
+   * Windows doc says that the bitmap isn't grayed when len == -1 and
+   * the callback function returns FALSE. However, testing this on
+   * win95 showed otherwise...
+   */
+#ifdef GRAYSTRING_USING_DOCUMENTED_BEHAVIOUR
+  if(retval || nCount != -1)
+#endif
+  {
+    hbsave = (HBRUSH)SelectObject(memdc, CACHE_GetPattern55AABrush());
+    PatBlt(memdc,0,0,nWidth,nHeight,0x000A0329);
+    SelectObject(memdc, hbsave);
+  }
+
+  if (hBrush) hbsave = (HBRUSH)SelectObject(hdc,hBrush);
+  fg = SetTextColor(hdc, RGB(0, 0, 0));
+  bg = SetBkColor(hdc, RGB(255, 255, 255));
+  BitBlt(hdc,x,y,nWidth,nHeight,memdc,0,0,0x00E20746);
+  SetTextColor(hdc, fg);
+  SetBkColor(hdc, bg);
+  if (hBrush) SelectObject(hdc,hbsave);
+
+  SelectObject(memdc, hbmsave);
+  DeleteObject(hbm);
+  DeleteDC(memdc);
+
+  return retval;
+}
+//******************************************************************************
+//******************************************************************************
+BOOL WIN32API GrayStringA(HDC hdc,HBRUSH hBrush,GRAYSTRINGPROC lpOutputFunc,LPARAM lpData,int nCount,int X,int Y,int nWidth,int nHeight)
+{
+  dprintf2(("USER32: GrayStringA %x",hDC));
+
+  return InternalGrayString(hdc,hBrush,lpOutputFunc,lpData,nCount,X,Y,nWidth,nHeight,FALSE);
+}
+//******************************************************************************
+//******************************************************************************
+BOOL WIN32API GrayStringW(HDC hdc,HBRUSH hBrush,GRAYSTRINGPROC lpOutputFunc,LPARAM lpData,int nCount,int X,int Y,int nWidth,int nHeight)
+{
+  dprintf2(("USER32: GrayStringW %x",hDC));
+
+  return InternalGrayString(hdc,hBrush,lpOutputFunc,lpData,nCount,X,Y,nWidth,nHeight,TRUE);
+}
+
Index: trunk/src/user32/uitools.cpp
===================================================================
--- trunk/src/user32/uitools.cpp	(revision 2092)
+++ trunk/src/user32/uitools.cpp	(revision 2093)
@@ -1,3 +1,3 @@
-/* $Id: uitools.cpp,v 1.17 1999-11-19 17:59:35 cbratschi Exp $ */
+/* $Id: uitools.cpp,v 1.18 1999-12-16 16:53:57 cbratschi Exp $ */
 /*
  * User Interface Functions
@@ -1358,125 +1358,4 @@
     return FALSE;
 }
-
-
-/*****************************************************************************
- * Name      : int WIN32API DrawTextExA
- * Purpose   : The DrawTextEx function draw the text in the rectangle
- * Parameters:
- * Variables :
- * Result    : If the function succeeds, the return value is the height of the
- *             text, otherwise zero.
- * Remark    : TODO: Returned number of characters is always the entire string
- *             since there is no way to know the real answer this way.
- * Status    : PARTIALLY IMPLEMENTED AND TESTED
- *
- * Author    : Rene Pronk [Thu, 1999/07/29 15:03]
- *             Christoph Bratschi: implemented DT_END_ELLIPSIS (Header control)
- *****************************************************************************/
-
-int WIN32API DrawTextExA (HDC hdc, LPCSTR lpchText, int cchText, LPRECT lprc,
-                          UINT dwDTFormat, LPDRAWTEXTPARAMS lpDTParams) {
-
-   int result;
-   UINT oldDTFormat;
-
-   dprintf(("USER32:DrawTextExA (%08xh,%s,%08xh,%08xh,%08xh,%08xh).\n",
-            hdc, lpchText, cchText, lprc, dwDTFormat, lpDTParams));
-
-   if (lpDTParams != NULL) {
-           // 'create' margins
-           lprc->left += lpDTParams->iLeftMargin;
-           lprc->right -= lpDTParams->iRightMargin;
-
-           // just assume all the text has been drawn
-           if (cchText != -1)
-                   lpDTParams->uiLengthDrawn = cchText;
-           else {
-                   // determine string length
-                   int size = 0;
-                   while ((BYTE) *(lpchText + size) != 0)
-                           size ++;
-                   lpDTParams->uiLengthDrawn = size;
-           }
-   }
-
-   oldDTFormat = dwDTFormat & ~(DT_END_ELLIPSIS | DT_PATH_ELLIPSIS | DT_MODIFYSTRING | DT_EXPANDTABS);
-   if (dwDTFormat & DT_END_ELLIPSIS && lpchText && (cchText != 0))
-   {
-     int textWidth,width;
-     RECT rect;
-
-     if (cchText == -1) cchText = lstrlenA(lpchText);
-     SetRectEmpty(&rect);
-     DrawTextA(hdc,lpchText,cchText,&rect,oldDTFormat | DT_CALCRECT);
-     width = lprc->right-lprc->left;
-     textWidth = rect.right-rect.left;
-     if (textWidth > width && width > 0)
-     {
-       char* newText;
-       int endWidth,newTextLen;
-
-       DrawTextA(hdc,"...",3,&rect,DT_CALCRECT | DT_SINGLELINE | DT_LEFT);
-       endWidth = rect.right-rect.left;
-       newText = (char*)malloc(cchText+3);
-       lstrcpyA(newText,lpchText);
-       newTextLen = cchText+1;
-       do
-       {
-         newTextLen--;
-         DrawTextA(hdc,newText,newTextLen,&rect,oldDTFormat | DT_CALCRECT);
-         textWidth = rect.right-rect.left;
-       } while (textWidth+endWidth > width && newTextLen > 1);
-
-       lstrcpyA(&newText[newTextLen],"...");
-       result = DrawTextA(hdc,newText,-1,lprc,oldDTFormat);;
-
-       if (dwDTFormat & DT_MODIFYSTRING) lstrcpynA((LPSTR)lpchText,newText,cchText);
-       free(newText);
-     } else result = DrawTextA(hdc,lpchText,cchText,lprc,oldDTFormat);
-   } else
-     result = DrawTextA (hdc, lpchText, cchText, lprc, oldDTFormat);
-
-   if (lpDTParams != NULL) {
-           // don't forget to restore the margins
-           lprc->left -= lpDTParams->iLeftMargin;
-           lprc->right += lpDTParams->iRightMargin;
-   }
-
-   return result;
-}
-
-
-
-/*****************************************************************************
- * Name      : int WIN32API DrawTextExW
- * Purpose   : The DrawTextEx function draw the text in the rectangle
- * Parameters:
- * Variables :
- * Result    : If the function succeeds, the return value is the height of the
- *             text, otherwise zero.
- * Remark    : TODO: Returned number of characters is always the entire string
- *             since there is no way to know the real answer this way.
- * Status    : PARTIALLY IMPLEMENTED AND TESTED
- *
- * Author    : Rene Pronk [Thu, 1999/07/29 15:03]
- *****************************************************************************/
-
-int WIN32API DrawTextExW (HDC hdc, LPWSTR lpchText, int cchText, LPRECT lprc,
-                          UINT dwDTFormat, LPDRAWTEXTPARAMS lpDTParams) {
-
-   char *astring = UnicodeToAsciiString((LPWSTR)lpchText);
-   int   rc;
-
-   dprintf(("USER32:DrawTextExW (%08xh,%s,%08xh,%08xh,%08xh,%08xh).\n",
-            hdc, astring, cchText, lprc, dwDTFormat, lpDTParams));
-
-   rc = DrawTextExA (hdc, astring, cchText, lprc, dwDTFormat, lpDTParams);
-   if (dwDTFormat & DT_MODIFYSTRING) AsciiToUnicode(astring,lpchText);
-   FreeAsciiString(astring);
-   return(rc);
-}
-
-
 /******************************************************************************
  *
@@ -1900,27 +1779,4 @@
     return O32_DrawMenuBar(window->getOS2FrameWindowHandle());
 }
-//******************************************************************************
-//******************************************************************************
-int WIN32API DrawTextW( HDC hDC, LPCWSTR lpString, int nCount, PRECT lpRect, UINT nFormat)
-{
- char *astring = UnicodeToAsciiString((LPWSTR)lpString);
- int   rc;
-
-#ifdef DEBUG
-    WriteLog("USER32:  DrawTextW %s\n", astring);
-#endif
-    rc = O32_DrawText(hDC,astring,nCount,lpRect,nFormat);
-    FreeAsciiString(astring);
-    return(rc);
-}
-//******************************************************************************
-//******************************************************************************
-int WIN32API DrawTextA(HDC hDC, LPCSTR lpString, int nCount, PRECT lpRect, UINT nFormat)
-{
-#ifdef DEBUG
-    WriteLog("USER32: DrawTextA %s %d", lpString,nCount);
-#endif
-    return O32_DrawText(hDC,lpString,nCount,lpRect,nFormat);
-}
 /*****************************************************************************
  * Name      : BOOL WIN32API DrawAnimatedRects
Index: trunk/src/user32/user32.cpp
===================================================================
--- trunk/src/user32/user32.cpp	(revision 2092)
+++ trunk/src/user32/user32.cpp	(revision 2093)
@@ -1,3 +1,3 @@
-/* $Id: user32.cpp,v 1.59 1999-12-16 00:11:45 sandervl Exp $ */
+/* $Id: user32.cpp,v 1.60 1999-12-16 16:53:58 cbratschi Exp $ */
 
 /*
@@ -1645,67 +1645,4 @@
 }
 //******************************************************************************
-//TODO: Not complete
-//******************************************************************************
-BOOL WIN32API GrayStringA(HDC hdc, HBRUSH hBrush, GRAYSTRINGPROC lpOutputFunc,
-                          LPARAM lpData, int nCount, int X, int Y, int nWidth,
-                          int nHeight)
-{
- BOOL     rc;
- COLORREF curclr;
-
-#ifdef DEBUG
-  WriteLog("USER32:  GrayStringA, not completely implemented\n");
-#endif
-  if(lpOutputFunc == NULL && lpData == NULL) {
-#ifdef DEBUG
-    WriteLog("USER32:  lpOutputFunc == NULL && lpData == NULL\n");
-#endif
-    return(FALSE);
-  }
-  if(lpOutputFunc) {
-        return(lpOutputFunc(hdc, lpData, nCount));
-  }
-  curclr = SetTextColor(hdc, GetSysColor(COLOR_GRAYTEXT));
-  rc = TextOutA(hdc, X, Y, (char *)lpData, nCount);
-  SetTextColor(hdc, curclr);
-
-  return(rc);
-}
-//******************************************************************************
-//******************************************************************************
-BOOL WIN32API GrayStringW(HDC hdc, HBRUSH hBrush, GRAYSTRINGPROC lpOutputFunc,
-                          LPARAM lpData, int nCount, int X, int Y, int nWidth,
-                          int nHeight)
-{
- BOOL     rc;
- char    *astring;
- COLORREF curclr;
-
-#ifdef DEBUG
-  WriteLog("USER32:  GrayStringW, not completely implemented\n");
-#endif
-
-  if(lpOutputFunc == NULL && lpData == NULL) {
-#ifdef DEBUG
-    WriteLog("USER32:  lpOutputFunc == NULL && lpData == NULL\n");
-#endif
-    return(FALSE);
-  }
-  if(nCount == 0)
-    nCount = UniStrlen((UniChar*)lpData);
-
-  if(lpOutputFunc) {
-    return(lpOutputFunc(hdc, lpData, nCount));
-  }
-  astring = UnicodeToAsciiString((LPWSTR)lpData);
-
-  curclr = SetTextColor(hdc, GetSysColor(COLOR_GRAYTEXT));
-  rc = TextOutA(hdc, X, Y, astring, nCount);
-  SetTextColor(hdc, curclr);
-
-  FreeAsciiString(astring);
-  return(rc);
-}
-//******************************************************************************
 //******************************************************************************
 #if 0
@@ -1855,47 +1792,4 @@
 /* Message and Message Queue Functions */
 
-
-/* Font and Text Functions */
-
-DWORD WIN32API GetTabbedTextExtentA( HDC hDC, LPCSTR lpString, int nCount, int nTabPositions, LPINT lpnTabStopPositions)
-{
-    dprintf2(("USER32: GetTabbedTextExtentA %x %s", hDC, lpString));
-    return O32_GetTabbedTextExtent(hDC,lpString,nCount,nTabPositions,lpnTabStopPositions);
-}
-//******************************************************************************
-//******************************************************************************
-DWORD WIN32API GetTabbedTextExtentW( HDC hDC, LPCWSTR lpString, int nCount, int nTabPositions, LPINT lpnTabStopPositions)
-{
- char *astring = UnicodeToAsciiString((LPWSTR)lpString);
- DWORD rc;
-
-    dprintf2(("USER32: GetTabbedTextExtentW %x %s", hDC, astring));
-    rc = O32_GetTabbedTextExtent(hDC,astring,nCount,nTabPositions,lpnTabStopPositions);
-    FreeAsciiString(astring);
-    return rc;
-}
-//******************************************************************************
-//******************************************************************************
-LONG WIN32API TabbedTextOutA( HDC hdc, int x, int y, LPCSTR lpString, int nCount, int nTabPositions, LPINT lpnTabStopPositions, int  nTabOrigin)
-{
-#ifdef DEBUG
-    WriteLog("USER32:  TabbedTextOutA\n");
-#endif
-    return O32_TabbedTextOut(hdc,x,y,lpString,nCount,nTabPositions,lpnTabStopPositions,nTabOrigin);
-}
-//******************************************************************************
-//******************************************************************************
-LONG WIN32API TabbedTextOutW( HDC hdc, int x, int y, LPCWSTR lpString, int nCount, int nTabPositions, LPINT lpnTabStopPositions, int  nTabOrigin)
-{
- char *astring = UnicodeToAsciiString((LPWSTR)lpString);
- LONG rc;
-
-#ifdef DEBUG
-    WriteLog("USER32:  TabbedTextOutW\n");
-#endif
-    rc = O32_TabbedTextOut(hdc,x,y,astring,nCount,nTabPositions,lpnTabStopPositions,nTabOrigin);
-    FreeAsciiString(astring);
-    return rc;
-}
 
 /* Device Context Functions */
Index: trunk/src/user32/win32wdesktop.cpp
===================================================================
--- trunk/src/user32/win32wdesktop.cpp	(revision 2092)
+++ trunk/src/user32/win32wdesktop.cpp	(revision 2093)
@@ -1,3 +1,3 @@
-/* $Id: win32wdesktop.cpp,v 1.7 1999-11-24 20:28:21 sandervl Exp $ */
+/* $Id: win32wdesktop.cpp,v 1.8 1999-12-16 16:53:59 cbratschi Exp $ */
 /*
  * Win32 Desktop Window for OS/2
@@ -25,6 +25,6 @@
   windowDesktop = new Win32Desktop();
   if(windowDesktop == NULL) {
-	dprintf(("Unable to create desktop window!!!"));
-	return FALSE;
+        dprintf(("Unable to create desktop window!!!"));
+        return FALSE;
   }
   return TRUE;
@@ -35,6 +35,6 @@
 {
   if(windowDesktop) {
-	delete windowDesktop;
-	windowDesktop = 0;
+        delete windowDesktop;
+        windowDesktop = 0;
   }
 }
@@ -77,5 +77,13 @@
 LRESULT WIN32API DesktopWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam )
 {
-    return 0;
+  switch (message)
+  {
+    case WM_GETTEXT:
+      if (!lParam || !wParam) return 0;
+      ((LPSTR)lParam)[0] = 0;
+      return 0;
+  }
+
+  return 0;
 }
 //******************************************************************************
