[MSPAINT] Allow paletteWindow to be bottom-aligned (#5216)

The user will be able to move the palette window to bottom by dragging.
- Add Bar1ID registry setting.
- Move paletteWindow to top or bottom in mainWindow's WM_SIZE handling.
- Track the mouse dragging on paletteWindow.
- If the dragging is beyond the center point, then move paletteWindow.
CORE-18867
This commit is contained in:
Katayama Hirofumi MZ 2023-04-04 19:06:06 +09:00 committed by GitHub
parent ccef43f3b0
commit d0c657074d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 74 additions and 6 deletions

View file

@ -75,6 +75,7 @@ void RegistrySettings::LoadPresets(INT nCmdShow)
ShowStatusBar = TRUE;
ShowPalette = TRUE;
ShowToolBox = TRUE;
Bar1ID = BAR1ID_TOP;
Bar2ID = BAR2ID_LEFT;
LOGFONT lf;
@ -142,6 +143,12 @@ void RegistrySettings::Load(INT nCmdShow)
ReadString(text, _T("TypeFaceName"), strFontName, strFontName);
}
CRegKey bar1;
if (bar1.Open(paint, _T("General-Bar1"), KEY_READ) == ERROR_SUCCESS)
{
ReadDWORD(bar1, _T("BarID"), Bar1ID);
}
CRegKey bar2;
if (bar2.Open(paint, _T("General-Bar2"), KEY_READ) == ERROR_SUCCESS)
{
@ -220,6 +227,12 @@ void RegistrySettings::Store()
text.SetStringValue(_T("TypeFaceName"), strFontName);
}
CRegKey bar1;
if (bar1.Create(paint, _T("General-Bar1")) == ERROR_SUCCESS)
{
bar1.SetDWORDValue(_T("BarID"), Bar1ID);
}
CRegKey bar2;
if (bar2.Create(paint, _T("General-Bar2")) == ERROR_SUCCESS)
{