Changeset 1944 for trunk/src/user32/edit.cpp
- Timestamp:
- Dec 2, 1999, 5:34:43 PM (26 years ago)
- File:
-
- 1 edited
-
trunk/src/user32/edit.cpp (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/edit.cpp
r1922 r1944 1 /* $Id: edit.cpp,v 1.2 0 1999-12-01 18:23:27cbratschi Exp $ */1 /* $Id: edit.cpp,v 1.21 1999-12-02 16:34:43 cbratschi Exp $ */ 2 2 /* 3 3 * Edit control … … 21 21 new in Win98, Win2k: for single line too 22 22 - WinNT/Win2k: higher size limits (single: 0x7FFFFFFE, multi: none) 23 - problems with OS/2 PM font kerning:24 T abbedTextOutA25 GetTextExtentPoint32A26 WINE code uses relative positions -> rewrite to absolute!23 - problems with selection update: perhaps an Open32 bug 24 TextOutA: draws at wrong position 25 I've removed the workarounds, it makes no sense to fix GDI32 bugs here 26 -> rewrite TextOut and TabbedTextOut 27 27 */ 28 28 … … 1032 1032 rc->top = es->format_rect.top; 1033 1033 rc->bottom = rc->top + es->line_height; 1034 1034 1035 rc->left = (scol == 0) ? es->format_rect.left : SLOWORD(EDIT_EM_PosFromChar(hwnd, es, line_index + scol, TRUE)); 1035 1036 rc->right = (ecol == -1) ? es->format_rect.right : SLOWORD(EDIT_EM_PosFromChar(hwnd, es, line_index + ecol, TRUE))+1; … … 1099 1100 1100 1101 EDIT_GetLineRect(hwnd, es, 0, start, end, &line_rect); 1101 1102 //CB: fix 1 pixel vertical line bug1103 line_rect.left--;1104 line_rect.right++;1105 1102 1106 1103 if (IntersectRect(&rc, &line_rect, &es->format_rect)) … … 1152 1149 if (sl == el) { 1153 1150 EDIT_GetLineRect(hwnd, es, sl, sc, ec, &rcLine); 1154 1155 //CB: fix 1 pixel vertical line bug1156 rcLine.left--;1157 rcLine.right++;1158 1159 1151 1160 1152 if (IntersectRect(&rcUpdate, &rcWnd, &rcLine)) … … 1582 1574 s = MIN(li + ll, MAX(li, s)); 1583 1575 e = MIN(li + ll, MAX(li, e)); 1576 1584 1577 if (rev && (s != e) && 1585 ((es->flags & EF_FOCUSED) || (es->style & ES_NOHIDESEL))) {1586 x += EDIT_PaintText(hwnd, es, dc, x, y, line, 0, s - li, FALSE);1587 x += EDIT_PaintText(hwnd, es, dc, x, y, line, s - li, e - s, TRUE);1588 x += EDIT_PaintText(hwnd, es, dc, x, y, line, e - li, li + ll - e, FALSE);1589 } else1590 x +=EDIT_PaintText(hwnd, es, dc, x, y, line, 0, ll, FALSE);1578 ((es->flags & EF_FOCUSED) || (es->style & ES_NOHIDESEL))) 1579 { 1580 x += EDIT_PaintText(hwnd, es, dc, x, y, line, 0, s - li, FALSE); 1581 x += EDIT_PaintText(hwnd, es, dc, x, y, line, s - li, e - s, TRUE); 1582 x += EDIT_PaintText(hwnd, es, dc, x, y, line, e - li, li + ll - e, FALSE); 1583 } else EDIT_PaintText(hwnd, es, dc, x, y, line, 0, ll, FALSE); 1591 1584 } 1592 1585 … … 1603 1596 INT ret; 1604 1597 INT li; 1605 SIZE size;1606 1598 1607 1599 if (!count) … … 1617 1609 ret = (INT)LOWORD(TabbedTextOutA(dc, x, y, es->text + li + col, count, 1618 1610 es->tabs_count, es->tabs, es->format_rect.left - es->x_offset)); 1619 } else { 1620 LPSTR text = EDIT_GetPasswordPointer_SL(hwnd, es); 1621 TextOutA(dc, x, y, text + li + col, count); 1622 GetTextExtentPoint32A(dc, text + li + col, count, &size); 1623 ret = size.cx; 1624 if (es->style & ES_PASSWORD) 1625 HeapFree(es->heap, 0, text); 1611 } else 1612 { 1613 LPSTR text = EDIT_GetPasswordPointer_SL(hwnd, es); 1614 POINT pt; 1615 UINT oldAlign = GetTextAlign(dc); 1616 1617 MoveToEx(dc,x,y,NULL); 1618 SetTextAlign(dc,(oldAlign & ~TA_NOUPDATECP) | TA_UPDATECP); 1619 1620 TextOutA(dc,x,y,text+li+col,count); 1621 GetCurrentPositionEx(dc,&pt); 1622 SetTextAlign(dc,oldAlign); 1623 ret = pt.x-x; 1624 if (es->style & ES_PASSWORD) 1625 HeapFree(es->heap, 0, text); 1626 1626 } 1627 1627 if (rev) { … … 2197 2197 x = LOWORD(GetTabbedTextExtentA(dc, es->text + li, index - li, 2198 2198 es->tabs_count, es->tabs)) - es->x_offset; 2199 } else {2200 LPSTR text = EDIT_GetPasswordPointer_SL(hwnd, es);2201 if (index < es->x_offset) {2202 GetTextExtentPoint32A(dc, text + index, 2203 es->x_offset - index,&size);2204 x = -size.cx;2205 } else {2206 GetTextExtentPoint32A(dc, text + es->x_offset,2207 index - es->x_offset,&size);2208 x= size.cx;2209 }2210 y = 0;2211 if (es->style & ES_PASSWORD)2212 HeapFree(es->heap, 0 ,text);2199 } else 2200 { 2201 LPSTR text = EDIT_GetPasswordPointer_SL(hwnd, es); 2202 2203 GetTextExtentPoint32A(dc,text,index,&size); 2204 x = size.cx; 2205 if (es->x_offset) 2206 { 2207 GetTextExtentPoint32A(dc,text,es->x_offset,&size); 2208 x -= size.cx; 2209 } 2210 y = 0; 2211 if (es->style & ES_PASSWORD) 2212 HeapFree(es->heap, 0 ,text); 2213 2213 } 2214 2214 x += es->format_rect.left; … … 3778 3778 if (!GetTextMetricsA(dc, &tm)) 3779 3779 { 3780 SelectObject(dc,old_font);3780 if (font) SelectObject(dc,old_font); 3781 3781 ReleaseDC(hwnd,dc); 3782 3782
Note:
See TracChangeset
for help on using the changeset viewer.
