textedit.cpp (640d67d1) | textedit.cpp (1aeebfda) |
---|---|
1/* 2 * PROJECT: PAINT for ReactOS 3 * LICENSE: LGPL-2.0-or-later (https://spdx.org/licenses/LGPL-2.0-or-later) 4 * PURPOSE: Text editor and font chooser for the text tool 5 * COPYRIGHT: Copyright 2015 Benedikt Freisen <b.freisen@gmx.net> 6 */ 7 8#include "precomp.h" --- 38 unchanged lines hidden (view full) --- 47void CTextEditWindow::FixEditPos(LPCWSTR pszOldText) 48{ 49 CStringW szText; 50 GetWindowText(szText); 51 52 RECT rcParent; 53 ::GetWindowRect(m_hwndParent, &rcParent); 54 | 1/* 2 * PROJECT: PAINT for ReactOS 3 * LICENSE: LGPL-2.0-or-later (https://spdx.org/licenses/LGPL-2.0-or-later) 4 * PURPOSE: Text editor and font chooser for the text tool 5 * COPYRIGHT: Copyright 2015 Benedikt Freisen <b.freisen@gmx.net> 6 */ 7 8#include "precomp.h" --- 38 unchanged lines hidden (view full) --- 47void CTextEditWindow::FixEditPos(LPCWSTR pszOldText) 48{ 49 CStringW szText; 50 GetWindowText(szText); 51 52 RECT rcParent; 53 ::GetWindowRect(m_hwndParent, &rcParent); 54 |
55 RECT rc, rcWnd, rcText; | 55 CRect rc, rcWnd, rcText; |
56 GetWindowRect(&rcWnd); 57 rcText = rcWnd; 58 59 HDC hDC = GetDC(); 60 if (hDC) 61 { 62 SelectObject(hDC, m_hFontZoomed); 63 TEXTMETRIC tm; --- 7 unchanged lines hidden (view full) --- 71 ReleaseDC(hDC); 72 } 73 74 UnionRect(&rc, &rcText, &rcWnd); 75 ::MapWindowPoints(NULL, m_hwndParent, (LPPOINT)&rc, 2); 76 77 rcWnd = rc; 78 ::GetClientRect(m_hwndParent, &rcParent); | 56 GetWindowRect(&rcWnd); 57 rcText = rcWnd; 58 59 HDC hDC = GetDC(); 60 if (hDC) 61 { 62 SelectObject(hDC, m_hFontZoomed); 63 TEXTMETRIC tm; --- 7 unchanged lines hidden (view full) --- 71 ReleaseDC(hDC); 72 } 73 74 UnionRect(&rc, &rcText, &rcWnd); 75 ::MapWindowPoints(NULL, m_hwndParent, (LPPOINT)&rc, 2); 76 77 rcWnd = rc; 78 ::GetClientRect(m_hwndParent, &rcParent); |
79 IntersectRect(&rc, &rcParent, &rcWnd); | 79 rc.IntersectRect(&rcParent, &rcWnd); |
80 81 MoveWindow(rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, FALSE); 82 83 DefWindowProc(WM_HSCROLL, SB_LEFT, 0); 84 DefWindowProc(WM_VSCROLL, SB_TOP, 0); 85 86 ::InvalidateRect(m_hwndParent, &rc, TRUE); 87} --- 65 unchanged lines hidden (view full) --- 153 ReleaseDC(hDC); 154 } 155 156 return 0; 157} 158 159LRESULT CTextEditWindow::OnNCPaint(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) 160{ | 80 81 MoveWindow(rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, FALSE); 82 83 DefWindowProc(WM_HSCROLL, SB_LEFT, 0); 84 DefWindowProc(WM_VSCROLL, SB_TOP, 0); 85 86 ::InvalidateRect(m_hwndParent, &rc, TRUE); 87} --- 65 unchanged lines hidden (view full) --- 153 ReleaseDC(hDC); 154 } 155 156 return 0; 157} 158 159LRESULT CTextEditWindow::OnNCPaint(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) 160{ |
161 RECT rc; | 161 CRect rc; |
162 GetWindowRect(&rc); 163 164 HDC hDC = GetDCEx(NULL, DCX_WINDOW | DCX_PARENTCLIP); 165 if (hDC) 166 { | 162 GetWindowRect(&rc); 163 164 HDC hDC = GetDCEx(NULL, DCX_WINDOW | DCX_PARENTCLIP); 165 if (hDC) 166 { |
167 OffsetRect(&rc, -rc.left, -rc.top); | 167 rc.OffsetRect(-rc.left, -rc.top); |
168 DrawGrip(hDC, rc); 169 ReleaseDC(hDC); 170 } 171 172 return 0; 173} 174 175LRESULT CTextEditWindow::OnNCCalcSize(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) --- 343 unchanged lines hidden --- | 168 DrawGrip(hDC, rc); 169 ReleaseDC(hDC); 170 } 171 172 return 0; 173} 174 175LRESULT CTextEditWindow::OnNCCalcSize(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) --- 343 unchanged lines hidden --- |