mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 19:12:57 +00:00
[MSPAINT] Simplify RECT/CRect handling
Refactoring. CORE-19094
This commit is contained in:
parent
f935132fbe
commit
1aeebfdacb
10 changed files with 74 additions and 78 deletions
|
@ -52,7 +52,7 @@ void CTextEditWindow::FixEditPos(LPCWSTR pszOldText)
|
|||
RECT rcParent;
|
||||
::GetWindowRect(m_hwndParent, &rcParent);
|
||||
|
||||
RECT rc, rcWnd, rcText;
|
||||
CRect rc, rcWnd, rcText;
|
||||
GetWindowRect(&rcWnd);
|
||||
rcText = rcWnd;
|
||||
|
||||
|
@ -76,7 +76,7 @@ void CTextEditWindow::FixEditPos(LPCWSTR pszOldText)
|
|||
|
||||
rcWnd = rc;
|
||||
::GetClientRect(m_hwndParent, &rcParent);
|
||||
IntersectRect(&rc, &rcParent, &rcWnd);
|
||||
rc.IntersectRect(&rcParent, &rcWnd);
|
||||
|
||||
MoveWindow(rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, FALSE);
|
||||
|
||||
|
@ -158,13 +158,13 @@ LRESULT CTextEditWindow::OnPaint(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL&
|
|||
|
||||
LRESULT CTextEditWindow::OnNCPaint(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
|
||||
{
|
||||
RECT rc;
|
||||
CRect rc;
|
||||
GetWindowRect(&rc);
|
||||
|
||||
HDC hDC = GetDCEx(NULL, DCX_WINDOW | DCX_PARENTCLIP);
|
||||
if (hDC)
|
||||
{
|
||||
OffsetRect(&rc, -rc.left, -rc.top);
|
||||
rc.OffsetRect(-rc.left, -rc.top);
|
||||
DrawGrip(hDC, rc);
|
||||
ReleaseDC(hDC);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue