Ignore:
Timestamp:
Dec 16, 1999, 5:53:59 PM (26 years ago)
Author:
cbratschi
Message:

text output changes, desktop WM_GETTEXT fixed, scrollbar DC changes

File:
1 edited

Legend:

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

    r1960 r2093  
    1 /* $Id: edit.cpp,v 1.22 1999-12-03 17:30:15 cbratschi Exp $ */
     1/* $Id: edit.cpp,v 1.23 1999-12-16 16:53:56 cbratschi Exp $ */
    22/*
    33 *      Edit control
     
    1212 *
    1313 * Status:  complete
    14  * Version: 5.00 (without undocumented specs)
     14 * Version: 5.00
    1515 */
    1616
     
    2020    new in Win98, Win2k: for single line too
    2121  - WinNT/Win2k: higher size limits (single: 0x7FFFFFFE, multi: none)
    22   - problems with selection update: perhaps an Open32 bug
    23     TextOutA: draws at wrong position
    24     I've removed the workarounds, it makes no sense to fix GDI32 bugs here
    25     -> rewrite TextOut and TabbedTextOut
    2622*/
    2723
     
    11501146
    11511147                if (IntersectRect(&rcUpdate, &rcWnd, &rcLine))
    1152                         InvalidateRect(hwnd, &rcUpdate, FALSE);
     1148                        InvalidateRect(hwnd, &rcUpdate, TRUE);
    11531149        } else {
    11541150                EDIT_GetLineRect(hwnd, es, sl, sc,
     
    11571153                                &rcLine);
    11581154                if (IntersectRect(&rcUpdate, &rcWnd, &rcLine))
    1159                         InvalidateRect(hwnd, &rcUpdate, FALSE);
     1155                        InvalidateRect(hwnd, &rcUpdate, TRUE);
    11601156                for (l = sl + 1 ; l < el ; l++) {
    11611157                        EDIT_GetLineRect(hwnd, es, l, 0,
     
    11641160                                &rcLine);
    11651161                        if (IntersectRect(&rcUpdate, &rcWnd, &rcLine))
    1166                                 InvalidateRect(hwnd, &rcUpdate, FALSE);
     1162                                InvalidateRect(hwnd, &rcUpdate, TRUE);
    11671163                }
    11681164                EDIT_GetLineRect(hwnd, es, el, 0, ec, &rcLine);
    11691165                if (IntersectRect(&rcUpdate, &rcWnd, &rcLine))
    1170                         InvalidateRect(hwnd, &rcUpdate, FALSE);
     1166                        InvalidateRect(hwnd, &rcUpdate, TRUE);
    11711167        }
    11721168        ShowCaret(hwnd);
     
    15741570        e = MIN(li + ll, MAX(li, e));
    15751571
    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)))
    15781573        {
    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          }
    15821626        } else  EDIT_PaintText(hwnd, es, dc, x, y, line, 0, ll, FALSE);
    15831627}
     
    16001644        BkColor = GetBkColor(dc);
    16011645        TextColor = GetTextColor(dc);
    1602         if (rev) {
     1646        if (rev)
     1647        {
    16031648                SetBkColor(dc, GetSysColor(COLOR_HIGHLIGHT));
    16041649                SetTextColor(dc, GetSysColor(COLOR_HIGHLIGHTTEXT));
    16051650        }
    16061651        li = EDIT_EM_LineIndex(hwnd, es, line);
    1607         if (es->style & ES_MULTILINE) {
     1652        if (es->style & ES_MULTILINE)
     1653        {
    16081654                ret = (INT)LOWORD(TabbedTextOutA(dc, x, y, es->text + li + col, count,
    16091655                                        es->tabs_count, es->tabs, es->format_rect.left - es->x_offset));
     
    16241670            HeapFree(es->heap, 0, text);
    16251671        }
    1626         if (rev) {
     1672        if (rev)
     1673        {
    16271674                SetBkColor(dc, BkColor);
    16281675                SetTextColor(dc, TextColor);
Note: See TracChangeset for help on using the changeset viewer.