[MSPAINT] Polymorphism on tools (#4210)

- Introduce polymorphism on tools and mouse actions.
- Implement double-clicking on TOOL_SHAPE.
- Fix some bugs about mouse handling.
CORE-17931
This commit is contained in:
Katayama Hirofumi MZ 2022-01-01 22:02:36 +09:00 committed by GitHub
parent e0a47b7b5f
commit ee132a05ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 790 additions and 635 deletions

View file

@ -559,11 +559,8 @@ LRESULT CMainWindow::OnCommand(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bH
{
HWND hToolbar = FindWindowEx(toolBoxContainer.m_hWnd, NULL, TOOLBARCLASSNAME, NULL);
SendMessage(hToolbar, TB_CHECKBUTTON, ID_RECTSEL, MAKELPARAM(TRUE, 0));
toolBoxContainer.SendMessage(WM_COMMAND, ID_RECTSEL);
//TODO: do this properly
startPaintingL(imageModel.GetDC(), 0, 0, paletteModel.GetFgColor(), paletteModel.GetBgColor());
whilePaintingL(imageModel.GetDC(), imageModel.GetWidth(), imageModel.GetHeight(), paletteModel.GetFgColor(), paletteModel.GetBgColor());
endPaintingL(imageModel.GetDC(), imageModel.GetWidth(), imageModel.GetHeight(), paletteModel.GetFgColor(), paletteModel.GetBgColor());
toolsModel.selectAll();
imageArea.Invalidate(TRUE);
break;
}
case IDM_EDITCOPYTO: