Ignore:
Timestamp:
Nov 26, 1999, 6:06:09 PM (26 years ago)
Author:
cbratschi
Message:

map rect, WM_ERASEBKGND and other fixes

File:
1 edited

Legend:

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

    r1828 r1849  
    1 /* $Id: edit.cpp,v 1.17 1999-11-24 18:21:36 cbratschi Exp $ */
     1/* $Id: edit.cpp,v 1.18 1999-11-26 17:06:06 cbratschi Exp $ */
    22/*
    33 *      Edit control
     
    2020
    2121/* CB: todo
     22  - WM_MOUSEMOVE: vert lines invalidate bug
    2223  - EN_UPDATE: send before update
    2324  - EN_CHANGE: send after update -> WM_PAINT isn't the right place
    2425  - EN_HSCROLL/EN_VSCROLL: send before update
    25   - still problems with caret
    2626  - WS_BORDER -> bug in Win32BaseWindow::SetWindowLong
    27   - clipping bug(s)
    2827  - many messages, styles, notifications
    2928*/
     
    229228static LRESULT  EDIT_WM_LButtonDown(HWND hwnd, EDITSTATE *es, DWORD keys, INT x, INT y);
    230229static LRESULT  EDIT_WM_LButtonUp(HWND hwnd, EDITSTATE *es, DWORD keys, INT x, INT y);
     230static LRESULT  EDIT_WM_CaptureChanged(HWND hwnd,EDITSTATE *es);
    231231static LRESULT  EDIT_WM_MouseMove(HWND hwnd, EDITSTATE *es, DWORD keys, INT x, INT y);
    232232static LRESULT  EDIT_WM_NCCreate(HWND hwnd, LPCREATESTRUCTA cs);
     
    671671                //DPRINTF_EDIT_MSG32("WM_LBUTTONUP");
    672672                result = EDIT_WM_LButtonUp(hwnd, es, (DWORD)wParam, SLOWORD(lParam), SHIWORD(lParam));
     673                break;
     674
     675        case WM_CAPTURECHANGED:
     676                result = EDIT_WM_CaptureChanged(hwnd,es);
    673677                break;
    674678
     
    10141018{
    10151019        INT line_index =  EDIT_EM_LineIndex(hwnd, es, line);
    1016 
     1020//CB: fix
    10171021        if (es->style & ES_MULTILINE)
    10181022                rc->top = es->format_rect.top + (line - es->y_offset) * es->line_height;
     
    10891093        if (IntersectRect(&rc, &line_rect, &es->format_rect))
    10901094        {
    1091           if (es->flags & EF_FOCUSED) HideCaret(hwnd);
     1095          HideCaret(hwnd);
    10921096          InvalidateRect(hwnd, &rc, FALSE);
    1093           if (es->flags & EF_FOCUSED) ShowCaret(hwnd);
     1097          ShowCaret(hwnd);
    10941098        }
    10951099}
     
    11321136        GetClientRect(hwnd, &rc1);
    11331137        IntersectRect(&rcWnd, &rc1, &es->format_rect);
    1134         if (es->flags & EF_FOCUSED) HideCaret(hwnd);
     1138        HideCaret(hwnd);
    11351139        if (sl == el) {
    11361140                EDIT_GetLineRect(hwnd, es, sl, sc, ec, &rcLine);
     
    11561160                        InvalidateRect(hwnd, &rcUpdate, FALSE);
    11571161        }
    1158         if (es->flags & EF_FOCUSED) ShowCaret(hwnd);
     1162        ShowCaret(hwnd);
    11591163}
    11601164
     
    20872091                GetClientRect(hwnd, &rc1);
    20882092                IntersectRect(&rc, &rc1, &es->format_rect);
    2089                 rc.top--; //CB: top line not moved/refreshed
     2093
    20902094                ScrollWindowEx(hwnd, -dx, dy,
    20912095                                NULL, &rc, (HRGN)NULL, NULL, SW_INVALIDATE);
     
    28512855
    28522856        GetClientRect(hwnd, &rc);
    2853         IntersectClipRect(dc, rc.left, rc.top, rc.right, rc.bottom);
     2857        IntersectClipRect(dc, rc.left, rc.top, rc.right, rc.bottom); CB:
    28542858        GetClipBox(dc, &rc);
    28552859        /*
     
    28762880    return 0;
    28772881
    2878   //SvL: Bugfix: +1
    28792882  len = min(count, lstrlenA(es->text)+1); // determine length
    28802883  lstrcpynA(text, es->text, len);       // copy as much as possible
     
    32623265static LRESULT EDIT_WM_LButtonUp(HWND hwnd, EDITSTATE *es, DWORD keys, INT x, INT y)
    32633266{
    3264         if (es->bCaptureState && GetCapture() == hwnd) {
    3265                 KillTimer(hwnd, 0);
    3266                 ReleaseCapture();
    3267         }
    3268         es->bCaptureState = FALSE;
    3269 
    3270         return 0;
    3271 }
    3272 
     3267  if (es->bCaptureState)
     3268  {
     3269    KillTimer(hwnd,0);
     3270    ReleaseCapture();
     3271  }
     3272  es->bCaptureState = FALSE;
     3273
     3274  return 0;
     3275}
     3276
     3277static LRESULT EDIT_WM_CaptureChanged(HWND hwnd,EDITSTATE *es)
     3278{
     3279  if (es->bCaptureState) KillTimer(hwnd,0);
     3280  es->bCaptureState = FALSE;
     3281
     3282  return 0;
     3283}
    32733284
    32743285/*********************************************************************
     
    32833294        INT prex, prey;
    32843295
    3285         if (GetCapture() != hwnd)
    3286                 return 1; //SvL: Bugfix
     3296        if (!es->bCaptureState) return 0;
    32873297
    32883298        /*
     
    34013411  if (es->flags & EF_UPDATE) EDIT_NOTIFY_PARENT(hwnd, EN_UPDATE);
    34023412
    3403   if (es->flags & EF_FOCUSED) HideCaret(hwnd);
     3413  HideCaret(hwnd);
    34043414
    34053415  if (eraseBkGnd)
     
    34733483    EDIT_SetCaretPos(hwnd, es, es->selection_end,es->flags & EF_AFTER_WRAP);
    34743484
    3475   if (es->flags & EF_FOCUSED) ShowCaret(hwnd);
     3485  ShowCaret(hwnd);
    34763486
    34773487  //CB: replace
     
    34903500
    34913501  //CB: original controls redraws many times, cache drawing
    3492   if (es->flags & EF_FOCUSED) HideCaret(hwnd);
     3502  HideCaret(hwnd);
    34933503  GetClientRect(hwnd,&rect);
    34943504  hdc = GetDC(hwnd);
     
    35033513  DeleteDC(hdcCompatible);
    35043514  ReleaseDC(hwnd,hdc);
    3505   if (es->flags & EF_FOCUSED) ShowCaret(hwnd);
     3515  ShowCaret(hwnd);
    35063516}
    35073517
Note: See TracChangeset for help on using the changeset viewer.