Changeset 1110 for trunk/src/user32/uitools.cpp
- Timestamp:
- Oct 2, 1999, 3:57:29 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/uitools.cpp
r949 r1110 1 /* $Id: uitools.cpp,v 1. 7 1999-09-15 23:18:56 sandervlExp $ */1 /* $Id: uitools.cpp,v 1.8 1999-10-02 13:57:29 cbratschi Exp $ */ 2 2 /* 3 3 * User Interface Functions … … 465 465 /* Bertho Stultiens states above that this function exactly matches win95 466 466 * In win98 BF_FLAT rectangels have an inner border same color as the 467 468 469 470 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 ) 473 473 LTInnerI = RBInnerI = COLOR_BTNFACE; 474 474 } … … 560 560 561 561 if((uFlags & BF_MIDDLE) && retval) 562 562 { 563 563 FillRect(hdc, &InnerRect, GetSysColorBrush(uFlags & BF_MONO ? 564 565 566 567 568 564 COLOR_WINDOW : COLOR_BTNFACE)); 565 } 566 567 if(uFlags & BF_ADJUST) 568 *rc = InnerRect; 569 569 } 570 570 … … 1408 1408 * 1409 1409 * Author : Rene Pronk [Thu, 1999/07/29 15:03] 1410 * Christoph Bratschi: implemented DT_END_ELLIPSIS (Header control) 1410 1411 *****************************************************************************/ 1411 1412 1412 int WIN32API DrawTextExA (HDC hdc, LP TSTR lpchText, int cchText, LPRECT lprc,1413 int WIN32API DrawTextExA (HDC hdc, LPCSTR lpchText, int cchText, LPRECT lprc, 1413 1414 UINT dwDTFormat, LPDRAWTEXTPARAMS lpDTParams) { 1414 1415 1415 1416 int result; 1417 UINT oldDTFormat; 1416 1418 1417 1419 dprintf(("USER32:DrawTextExA (%08xh,%s,%08xh,%08xh,%08xh,%08xh).\n", … … 1435 1437 } 1436 1438 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); 1438 1475 1439 1476 if (lpDTParams != NULL) { … … 1462 1499 *****************************************************************************/ 1463 1500 1464 int WIN32API DrawTextExW (HDC hdc, LP TSTR lpchText, int cchText, LPRECT lprc,1501 int WIN32API DrawTextExW (HDC hdc, LPWSTR lpchText, int cchText, LPRECT lprc, 1465 1502 UINT dwDTFormat, LPDRAWTEXTPARAMS lpDTParams) { 1466 1503 … … 1472 1509 1473 1510 rc = DrawTextExA (hdc, astring, cchText, lprc, dwDTFormat, lpDTParams); 1511 if (dwDTFormat & DT_MODIFYSTRING) AsciiToUnicode(astring,lpchText); 1474 1512 FreeAsciiString(astring); 1475 1513 return(rc);
Note:
See TracChangeset
for help on using the changeset viewer.