Changeset 2093 for trunk/src/user32/edit.cpp
- Timestamp:
- Dec 16, 1999, 5:53:59 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/edit.cpp
r1960 r2093 1 /* $Id: edit.cpp,v 1.2 2 1999-12-03 17:30:15cbratschi Exp $ */1 /* $Id: edit.cpp,v 1.23 1999-12-16 16:53:56 cbratschi Exp $ */ 2 2 /* 3 3 * Edit control … … 12 12 * 13 13 * Status: complete 14 * Version: 5.00 (without undocumented specs)14 * Version: 5.00 15 15 */ 16 16 … … 20 20 new in Win98, Win2k: for single line too 21 21 - WinNT/Win2k: higher size limits (single: 0x7FFFFFFE, multi: none) 22 - problems with selection update: perhaps an Open32 bug23 TextOutA: draws at wrong position24 I've removed the workarounds, it makes no sense to fix GDI32 bugs here25 -> rewrite TextOut and TabbedTextOut26 22 */ 27 23 … … 1150 1146 1151 1147 if (IntersectRect(&rcUpdate, &rcWnd, &rcLine)) 1152 InvalidateRect(hwnd, &rcUpdate, FALSE);1148 InvalidateRect(hwnd, &rcUpdate, TRUE); 1153 1149 } else { 1154 1150 EDIT_GetLineRect(hwnd, es, sl, sc, … … 1157 1153 &rcLine); 1158 1154 if (IntersectRect(&rcUpdate, &rcWnd, &rcLine)) 1159 InvalidateRect(hwnd, &rcUpdate, FALSE);1155 InvalidateRect(hwnd, &rcUpdate, TRUE); 1160 1156 for (l = sl + 1 ; l < el ; l++) { 1161 1157 EDIT_GetLineRect(hwnd, es, l, 0, … … 1164 1160 &rcLine); 1165 1161 if (IntersectRect(&rcUpdate, &rcWnd, &rcLine)) 1166 InvalidateRect(hwnd, &rcUpdate, FALSE);1162 InvalidateRect(hwnd, &rcUpdate, TRUE); 1167 1163 } 1168 1164 EDIT_GetLineRect(hwnd, es, el, 0, ec, &rcLine); 1169 1165 if (IntersectRect(&rcUpdate, &rcWnd, &rcLine)) 1170 InvalidateRect(hwnd, &rcUpdate, FALSE);1166 InvalidateRect(hwnd, &rcUpdate, TRUE); 1171 1167 } 1172 1168 ShowCaret(hwnd); … … 1574 1570 e = MIN(li + ll, MAX(li, e)); 1575 1571 1576 if (rev && (s != e) && 1577 ((es->flags & EF_FOCUSED) || (es->style & ES_NOHIDESEL))) 1572 if (rev && (s != e) && ((es->flags & EF_FOCUSED) || (es->style & ES_NOHIDESEL))) 1578 1573 { 1579 x += EDIT_PaintText(hwnd, es, dc, x, y, line, 0, s - li, FALSE); 1580 x += EDIT_PaintText(hwnd, es, dc, x, y, line, s - li, e - s, TRUE); 1581 x += EDIT_PaintText(hwnd, es, dc, x, y, line, e - li, li + ll - e, FALSE); 1574 HRGN oldRgn,newRgn,combRgn; 1575 RECT rect; 1576 //CB: OS/2 has problems with relative string positions (i.e. Communicator) 1577 // fix: always calculate string from starting point, tab bugs fixed too 1578 // otherwise we have 'dancing characters' 1579 1580 if (!(es->style & ES_MULTILINE)) 1581 { 1582 SIZE size; 1583 1584 rect.top = y; 1585 rect.bottom = y+es->line_height; 1586 GetTextExtentPoint32A(dc,es->text+li,s-li,&size); 1587 rect.left = x+size.cx; 1588 GetTextExtentPoint32A(dc,es->text+li,e-li,&size); 1589 rect.right = x+size.cx; 1590 1591 oldRgn = CreateRectRgnIndirect(&rect); //dummy parameter 1592 GetClipRgn(dc,oldRgn); 1593 newRgn = CreateRectRgnIndirect(&rect); 1594 combRgn = CreateRectRgnIndirect(&rect); //dummy parameter 1595 CombineRgn(combRgn,oldRgn,newRgn,RGN_XOR); 1596 SelectClipRgn(dc,combRgn); 1597 EDIT_PaintText(hwnd,es,dc,x,y,line,0,ll,FALSE); 1598 CombineRgn(combRgn,oldRgn,newRgn,RGN_AND); 1599 SelectClipRgn(dc,combRgn); 1600 EDIT_PaintText(hwnd,es,dc,x,y,line,0,e-li,TRUE); 1601 DeleteObject(oldRgn); 1602 DeleteObject(newRgn); 1603 DeleteObject(combRgn); 1604 } else 1605 { 1606 rect.top = y; 1607 rect.bottom = y+es->line_height; 1608 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)); 1609 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)); 1610 1611 oldRgn = CreateRectRgnIndirect(&rect); //dummy parameter 1612 GetClipRgn(dc,oldRgn); 1613 newRgn = CreateRectRgnIndirect(&rect); 1614 combRgn = CreateRectRgnIndirect(&rect); //dummy parameter 1615 CombineRgn(combRgn,oldRgn,newRgn,RGN_XOR); 1616 SelectClipRgn(dc,combRgn); 1617 EDIT_PaintText(hwnd,es,dc,x,y,line,0,ll,FALSE); 1618 CombineRgn(combRgn,oldRgn,newRgn,RGN_AND); 1619 SelectClipRgn(dc,combRgn); 1620 EDIT_PaintText(hwnd,es,dc,x,y,line,0,e-li,TRUE); 1621 SelectClipRgn(dc,oldRgn); 1622 DeleteObject(oldRgn); 1623 DeleteObject(newRgn); 1624 DeleteObject(combRgn); 1625 } 1582 1626 } else EDIT_PaintText(hwnd, es, dc, x, y, line, 0, ll, FALSE); 1583 1627 } … … 1600 1644 BkColor = GetBkColor(dc); 1601 1645 TextColor = GetTextColor(dc); 1602 if (rev) { 1646 if (rev) 1647 { 1603 1648 SetBkColor(dc, GetSysColor(COLOR_HIGHLIGHT)); 1604 1649 SetTextColor(dc, GetSysColor(COLOR_HIGHLIGHTTEXT)); 1605 1650 } 1606 1651 li = EDIT_EM_LineIndex(hwnd, es, line); 1607 if (es->style & ES_MULTILINE) { 1652 if (es->style & ES_MULTILINE) 1653 { 1608 1654 ret = (INT)LOWORD(TabbedTextOutA(dc, x, y, es->text + li + col, count, 1609 1655 es->tabs_count, es->tabs, es->format_rect.left - es->x_offset)); … … 1624 1670 HeapFree(es->heap, 0, text); 1625 1671 } 1626 if (rev) { 1672 if (rev) 1673 { 1627 1674 SetBkColor(dc, BkColor); 1628 1675 SetTextColor(dc, TextColor);
Note:
See TracChangeset
for help on using the changeset viewer.