Changeset 1115 for trunk/src


Ignore:
Timestamp:
Oct 3, 1999, 10:38:54 PM (26 years ago)
Author:
sandervl
Message:

compile fixes

File:
1 edited

Legend:

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

    r1110 r1115  
    1 /* $Id: uitools.cpp,v 1.8 1999-10-02 13:57:29 cbratschi Exp $ */
     1/* $Id: uitools.cpp,v 1.9 1999-10-03 20:38:54 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)
    14111410 *****************************************************************************/
    14121411
     
    14151414
    14161415   int result;
    1417    UINT oldDTFormat;
    14181416
    14191417   dprintf(("USER32:DrawTextExA (%08xh,%s,%08xh,%08xh,%08xh,%08xh).\n",
     
    14371435   }
    14381436
    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);
     1437   result = DrawTextA (hdc, lpchText, cchText, lprc, dwDTFormat);
    14751438
    14761439   if (lpDTParams != NULL) {
     
    15091472
    15101473   rc = DrawTextExA (hdc, astring, cchText, lprc, dwDTFormat, lpDTParams);
    1511    if (dwDTFormat & DT_MODIFYSTRING) AsciiToUnicode(astring,lpchText);
    15121474   FreeAsciiString(astring);
    15131475   return(rc);
Note: See TracChangeset for help on using the changeset viewer.