[MSPAINT] Establish Undo/Redo management (#5347)

- Painting the canvas is done by overlaying the multiple layers.
- Drawing each overlay is implemented as polymorphism of OOP.
- Refine the Undo/Redo mechanism.
- Some adjustments.
CORE-17969
This commit is contained in:
Katayama Hirofumi MZ 2023-06-17 21:15:35 +09:00 committed by GitHub
parent b7071f67a8
commit e8c7e30030
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 721 additions and 504 deletions

View file

@ -61,7 +61,7 @@ void CTextEditWindow::FixEditPos(LPCTSTR pszOldText)
SelectObject(hDC, m_hFontZoomed);
TEXTMETRIC tm;
GetTextMetrics(hDC, &tm);
szText += TEXT("x"); // This is a trick to enable the last newlines
szText += TEXT("x"); // This is a trick to enable the g_ptEnd newlines
const UINT uFormat = DT_LEFT | DT_TOP | DT_EDITCONTROL | DT_NOPREFIX | DT_NOCLIP |
DT_EXPANDTABS | DT_WORDBREAK;
DrawText(hDC, szText, -1, &rcText, uFormat | DT_CALCRECT);
@ -235,7 +235,7 @@ HWND CTextEditWindow::Create(HWND hwndParent)
const DWORD style = ES_LEFT | ES_MULTILINE | ES_WANTRETURN | ES_AUTOVSCROLL |
WS_CHILD | WS_THICKFRAME;
HWND hwnd = ::CreateWindowEx(0, WC_EDIT, NULL, style, 0, 0, 0, 0,
hwndParent, NULL, hProgInstance, NULL);
hwndParent, NULL, g_hinstExe, NULL);
if (hwnd)
{
#undef SubclassWindow // Don't use this macro