Changeset 11732


Ignore:
Timestamp:
Oct 5, 1999, 8:23:49 PM (26 years ago)
Author:
sandervl
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified tags/trunk/src/user32/uitools.cpp

    r11704 r11732  
    1 /* $Id: uitools.cpp,v 1.9 1999-10-03 20:38:54 sandervl Exp $ */
     1/* $Id: uitools.cpp,v 1.10 1999-10-05 18:23:49 sandervl Exp $ */
    22/*
    33 * User Interface Functions
     
    465465        /* Bertho Stultiens states above that this function exactly matches win95
    466466         * In win98 BF_FLAT rectangels have an inner border same color as the
    467         * middle (COLOR_BTNFACE). I believe it's the same for win95 but since
    468         * I don't know I go with Bertho and just sets it for win98 until proven
    469         * otherwise.
    470         *                                          Dennis Björklund, 10 June, 99
    471         */
    472         if(LTInnerI != -1 )     
     467        * middle (COLOR_BTNFACE). I believe it's the same for win95 but since
     468        * I don't know I go with Bertho and just sets it for win98 until proven
     469        * otherwise.
     470        *                                          Dennis Björklund, 10 June, 99
     471        */
     472        if(LTInnerI != -1 )
    473473            LTInnerI = RBInnerI = COLOR_BTNFACE;
    474474    }
     
    560560
    561561        if((uFlags & BF_MIDDLE) && retval)
    562         {
     562        {
    563563            FillRect(hdc, &InnerRect, GetSysColorBrush(uFlags & BF_MONO ?
    564                                                        COLOR_WINDOW : COLOR_BTNFACE));
    565         }
    566 
    567         if(uFlags & BF_ADJUST)
    568             *rc = InnerRect;
     564                                                       COLOR_WINDOW : COLOR_BTNFACE));
     565        }
     566
     567        if(uFlags & BF_ADJUST)
     568            *rc = InnerRect;
    569569    }
    570570
     
    14081408 *
    14091409 * Author    : Rene Pronk [Thu, 1999/07/29 15:03]
     1410 *             Christoph Bratschi: implemented DT_END_ELLIPSIS (Header control)
    14101411 *****************************************************************************/
    14111412
     
    14141415
    14151416   int result;
     1417   UINT oldDTFormat;
    14161418
    14171419   dprintf(("USER32:DrawTextExA (%08xh,%s,%08xh,%08xh,%08xh,%08xh).\n",
     
    14351437   }
    14361438
    1437    result = DrawTextA (hdc, lpchText, cchText, lprc, dwDTFormat);
     1439   oldDTFormat = dwDTFormat & ~(DT_END_ELLIPSIS | DT_PATH_ELLIPSIS | DT_MODIFYSTRING | DT_EXPANDTABS);
     1440   if (dwDTFormat & DT_END_ELLIPSIS && lpchText && (cchText != 0))
     1441   {
     1442     int textWidth,width;
     1443     RECT rect;
     1444
     1445     if (cchText == -1) cchText = lstrlenA(lpchText);
     1446     SetRectEmpty(&rect);
     1447     DrawTextA(hdc,lpchText,cchText,&rect,oldDTFormat | DT_CALCRECT);
     1448     width = lprc->right-lprc->left;
     1449     textWidth = rect.right-rect.left;
     1450     if (textWidth > width && width > 0)
     1451     {
     1452       char* newText;
     1453       int endWidth,newTextLen;
     1454
     1455       DrawTextA(hdc,"...",3,&rect,DT_CALCRECT | DT_SINGLELINE | DT_LEFT);
     1456       endWidth = rect.right-rect.left;
     1457       newText = (char*)malloc(cchText+3);
     1458       lstrcpyA(newText,lpchText);
     1459       newTextLen = cchText+1;
     1460       do
     1461       {
     1462         newTextLen--;
     1463         DrawTextA(hdc,newText,newTextLen,&rect,oldDTFormat | DT_CALCRECT);
     1464         textWidth = rect.right-rect.left;
     1465       } while (textWidth+endWidth > width && newTextLen > 1);
     1466
     1467       lstrcpyA(&newText[newTextLen],"...");
     1468       result = DrawTextA(hdc,newText,-1,lprc,oldDTFormat);;
     1469
     1470       if (dwDTFormat & DT_MODIFYSTRING) lstrcpynA((LPSTR)lpchText,newText,cchText);
     1471       free(newText);
     1472     } else result = DrawTextA(hdc,lpchText,cchText,lprc,oldDTFormat);
     1473   } else
     1474     result = DrawTextA (hdc, lpchText, cchText, lprc, oldDTFormat);
    14381475
    14391476   if (lpDTParams != NULL) {
     
    14721509
    14731510   rc = DrawTextExA (hdc, astring, cchText, lprc, dwDTFormat, lpDTParams);
     1511   if (dwDTFormat & DT_MODIFYSTRING) AsciiToUnicode(astring,lpchText);
    14741512   FreeAsciiString(astring);
    14751513   return(rc);
Note: See TracChangeset for help on using the changeset viewer.