https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ed9973f87621489568314…
commit ed9973f876214895683144fa85a61d4695191b60
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Sat Sep 23 09:26:11 2023 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Sat Sep 23 09:26:11 2023 +0900
[MSPAINT] Introduce Ctrl+Plus / Ctrl+Minus (#5717)
- Add Ctrl+Plus and Ctrl+Minus accelerators.
- Add IDM_CTRL_PLUS and IDM_CTRL_MINUS
commands.
- Stretch the selection area on IDM_CTRL_PLUS
and IDM_CTRL_MINUS actions.
CORE-19094
---
base/applications/mspaint/canvas.cpp | 4 +--
base/applications/mspaint/lang/bg-BG.rc | 4 +++
base/applications/mspaint/lang/cs-CZ.rc | 4 +++
base/applications/mspaint/lang/de-DE.rc | 4 +++
base/applications/mspaint/lang/en-GB.rc | 4 +++
base/applications/mspaint/lang/en-US.rc | 4 +++
base/applications/mspaint/lang/es-ES.rc | 4 +++
base/applications/mspaint/lang/et-EE.rc | 4 +++
base/applications/mspaint/lang/eu-ES.rc | 4 +++
base/applications/mspaint/lang/fr-FR.rc | 4 +++
base/applications/mspaint/lang/he-IL.rc | 4 +++
base/applications/mspaint/lang/hu-HU.rc | 4 +++
base/applications/mspaint/lang/id-ID.rc | 4 +++
base/applications/mspaint/lang/it-IT.rc | 4 +++
base/applications/mspaint/lang/ja-JP.rc | 4 +++
base/applications/mspaint/lang/nl-NL.rc | 4 +++
base/applications/mspaint/lang/no-NO.rc | 4 +++
base/applications/mspaint/lang/pl-PL.rc | 4 +++
base/applications/mspaint/lang/pt-BR.rc | 4 +++
base/applications/mspaint/lang/pt-PT.rc | 4 +++
base/applications/mspaint/lang/ro-RO.rc | 4 +++
base/applications/mspaint/lang/ru-RU.rc | 4 +++
base/applications/mspaint/lang/sk-SK.rc | 4 +++
base/applications/mspaint/lang/sq-AL.rc | 4 +++
base/applications/mspaint/lang/sv-SE.rc | 4 +++
base/applications/mspaint/lang/tr-TR.rc | 4 +++
base/applications/mspaint/lang/uk-UA.rc | 4 +++
base/applications/mspaint/lang/vi-VN.rc | 4 +++
base/applications/mspaint/lang/zh-CN.rc | 4 +++
base/applications/mspaint/lang/zh-HK.rc | 4 +++
base/applications/mspaint/lang/zh-TW.rc | 4 +++
base/applications/mspaint/mouse.cpp | 10 ++++++
base/applications/mspaint/resource.h | 3 ++
base/applications/mspaint/selectionmodel.cpp | 48 ++++++++++++++++++++++------
base/applications/mspaint/selectionmodel.h | 6 ++--
base/applications/mspaint/toolsmodel.cpp | 5 +++
base/applications/mspaint/toolsmodel.h | 4 +++
base/applications/mspaint/winproc.cpp | 7 ++++
38 files changed, 193 insertions(+), 14 deletions(-)
diff --git a/base/applications/mspaint/canvas.cpp b/base/applications/mspaint/canvas.cpp
index 186b88dc044..a403c8bd456 100644
--- a/base/applications/mspaint/canvas.cpp
+++ b/base/applications/mspaint/canvas.cpp
@@ -750,8 +750,8 @@ LRESULT CCanvasWindow::OnPaint(UINT nMsg, WPARAM wParam, LPARAM
lParam, BOOL& bH
VOID CCanvasWindow::cancelDrawing()
{
- selectionModel.ClearColor();
- selectionModel.ClearMask();
+ selectionModel.ClearColorImage();
+ selectionModel.ClearMaskImage();
m_hitSelection = HIT_NONE;
m_drawing = FALSE;
toolsModel.OnCancelDraw();
diff --git a/base/applications/mspaint/lang/bg-BG.rc
b/base/applications/mspaint/lang/bg-BG.rc
index cf525cd4514..e880803577d 100644
--- a/base/applications/mspaint/lang/bg-BG.rc
+++ b/base/applications/mspaint/lang/bg-BG.rc
@@ -140,6 +140,10 @@ BEGIN
"^I", IDM_IMAGEINVERTCOLORS
"^E", IDM_IMAGEATTRIBUTES
"N", IDM_IMAGEDELETEIMAGE, CONTROL, SHIFT, VIRTKEY
+ VK_ADD, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_SUBTRACT, IDM_CTRL_MINUS, CONTROL, VIRTKEY
+ VK_OEM_PLUS, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_OEM_MINUS, IDM_CTRL_MINUS, CONTROL, VIRTKEY
END
IDD_MIRRORROTATE DIALOGEX 100, 100, 180, 100
diff --git a/base/applications/mspaint/lang/cs-CZ.rc
b/base/applications/mspaint/lang/cs-CZ.rc
index c6a8c018a83..22f2387752a 100644
--- a/base/applications/mspaint/lang/cs-CZ.rc
+++ b/base/applications/mspaint/lang/cs-CZ.rc
@@ -140,6 +140,10 @@ BEGIN
"^I", IDM_IMAGEINVERTCOLORS
"^E", IDM_IMAGEATTRIBUTES
"N", IDM_IMAGEDELETEIMAGE, CONTROL, SHIFT, VIRTKEY
+ VK_ADD, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_SUBTRACT, IDM_CTRL_MINUS, CONTROL, VIRTKEY
+ VK_OEM_PLUS, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_OEM_MINUS, IDM_CTRL_MINUS, CONTROL, VIRTKEY
END
IDD_MIRRORROTATE DIALOGEX 100, 100, 180, 100
diff --git a/base/applications/mspaint/lang/de-DE.rc
b/base/applications/mspaint/lang/de-DE.rc
index 97466efcbb1..07511f578ed 100644
--- a/base/applications/mspaint/lang/de-DE.rc
+++ b/base/applications/mspaint/lang/de-DE.rc
@@ -139,6 +139,10 @@ BEGIN
"^U", IDM_IMAGEINVERTCOLORS
"^E", IDM_IMAGEATTRIBUTES
"N", IDM_IMAGEDELETEIMAGE, CONTROL, SHIFT, VIRTKEY
+ VK_ADD, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_SUBTRACT, IDM_CTRL_MINUS, CONTROL, VIRTKEY
+ VK_OEM_PLUS, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_OEM_MINUS, IDM_CTRL_MINUS, CONTROL, VIRTKEY
END
IDD_MIRRORROTATE DIALOGEX 100, 100, 180, 100
diff --git a/base/applications/mspaint/lang/en-GB.rc
b/base/applications/mspaint/lang/en-GB.rc
index 6a714ff0998..29b47c1b7de 100644
--- a/base/applications/mspaint/lang/en-GB.rc
+++ b/base/applications/mspaint/lang/en-GB.rc
@@ -139,6 +139,10 @@ BEGIN
"^I", IDM_IMAGEINVERTCOLORS
"^E", IDM_IMAGEATTRIBUTES
"N", IDM_IMAGEDELETEIMAGE, CONTROL, SHIFT, VIRTKEY
+ VK_ADD, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_SUBTRACT, IDM_CTRL_MINUS, CONTROL, VIRTKEY
+ VK_OEM_PLUS, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_OEM_MINUS, IDM_CTRL_MINUS, CONTROL, VIRTKEY
END
IDD_MIRRORROTATE DIALOGEX 100, 100, 180, 100
diff --git a/base/applications/mspaint/lang/en-US.rc
b/base/applications/mspaint/lang/en-US.rc
index 029eaa11384..9119010ce53 100644
--- a/base/applications/mspaint/lang/en-US.rc
+++ b/base/applications/mspaint/lang/en-US.rc
@@ -140,6 +140,10 @@ BEGIN
"^I", IDM_IMAGEINVERTCOLORS
"^E", IDM_IMAGEATTRIBUTES
"N", IDM_IMAGEDELETEIMAGE, CONTROL, SHIFT, VIRTKEY
+ VK_ADD, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_SUBTRACT, IDM_CTRL_MINUS, CONTROL, VIRTKEY
+ VK_OEM_PLUS, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_OEM_MINUS, IDM_CTRL_MINUS, CONTROL, VIRTKEY
END
IDD_MIRRORROTATE DIALOGEX 100, 100, 180, 100
diff --git a/base/applications/mspaint/lang/es-ES.rc
b/base/applications/mspaint/lang/es-ES.rc
index 5ad11ac1f2c..6af66999fea 100644
--- a/base/applications/mspaint/lang/es-ES.rc
+++ b/base/applications/mspaint/lang/es-ES.rc
@@ -142,6 +142,10 @@ BEGIN
"^I", IDM_IMAGEINVERTCOLORS
"^E", IDM_IMAGEATTRIBUTES
"N", IDM_IMAGEDELETEIMAGE, CONTROL, SHIFT, VIRTKEY
+ VK_ADD, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_SUBTRACT, IDM_CTRL_MINUS, CONTROL, VIRTKEY
+ VK_OEM_PLUS, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_OEM_MINUS, IDM_CTRL_MINUS, CONTROL, VIRTKEY
END
IDD_MIRRORROTATE DIALOGEX 100, 100, 180, 100
diff --git a/base/applications/mspaint/lang/et-EE.rc
b/base/applications/mspaint/lang/et-EE.rc
index 6103e1608cb..c6fef7bb171 100644
--- a/base/applications/mspaint/lang/et-EE.rc
+++ b/base/applications/mspaint/lang/et-EE.rc
@@ -139,6 +139,10 @@ BEGIN
"^I", IDM_IMAGEINVERTCOLORS
"^E", IDM_IMAGEATTRIBUTES
"N", IDM_IMAGEDELETEIMAGE, CONTROL, SHIFT, VIRTKEY
+ VK_ADD, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_SUBTRACT, IDM_CTRL_MINUS, CONTROL, VIRTKEY
+ VK_OEM_PLUS, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_OEM_MINUS, IDM_CTRL_MINUS, CONTROL, VIRTKEY
END
IDD_MIRRORROTATE DIALOGEX 100, 100, 180, 100
diff --git a/base/applications/mspaint/lang/eu-ES.rc
b/base/applications/mspaint/lang/eu-ES.rc
index 3340d338c46..fdda0e8edbd 100644
--- a/base/applications/mspaint/lang/eu-ES.rc
+++ b/base/applications/mspaint/lang/eu-ES.rc
@@ -140,6 +140,10 @@ BEGIN
"^I", IDM_IMAGEINVERTCOLORS
"^E", IDM_IMAGEATTRIBUTES
"N", IDM_IMAGEDELETEIMAGE, CONTROL, SHIFT, VIRTKEY
+ VK_ADD, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_SUBTRACT, IDM_CTRL_MINUS, CONTROL, VIRTKEY
+ VK_OEM_PLUS, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_OEM_MINUS, IDM_CTRL_MINUS, CONTROL, VIRTKEY
END
IDD_MIRRORROTATE DIALOGEX 100, 100, 180, 100
diff --git a/base/applications/mspaint/lang/fr-FR.rc
b/base/applications/mspaint/lang/fr-FR.rc
index 6fb2dc383be..056a79f6f8e 100644
--- a/base/applications/mspaint/lang/fr-FR.rc
+++ b/base/applications/mspaint/lang/fr-FR.rc
@@ -140,6 +140,10 @@ BEGIN
"^I", IDM_IMAGEINVERTCOLORS
"^E", IDM_IMAGEATTRIBUTES
"N", IDM_IMAGEDELETEIMAGE, CONTROL, SHIFT, VIRTKEY
+ VK_ADD, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_SUBTRACT, IDM_CTRL_MINUS, CONTROL, VIRTKEY
+ VK_OEM_PLUS, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_OEM_MINUS, IDM_CTRL_MINUS, CONTROL, VIRTKEY
END
IDD_MIRRORROTATE DIALOGEX 100, 100, 180, 100
diff --git a/base/applications/mspaint/lang/he-IL.rc
b/base/applications/mspaint/lang/he-IL.rc
index 1dff4387dc0..853dfb9852f 100644
--- a/base/applications/mspaint/lang/he-IL.rc
+++ b/base/applications/mspaint/lang/he-IL.rc
@@ -139,6 +139,10 @@ BEGIN
"^I", IDM_IMAGEINVERTCOLORS
"^E", IDM_IMAGEATTRIBUTES
"N", IDM_IMAGEDELETEIMAGE, CONTROL, SHIFT, VIRTKEY
+ VK_ADD, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_SUBTRACT, IDM_CTRL_MINUS, CONTROL, VIRTKEY
+ VK_OEM_PLUS, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_OEM_MINUS, IDM_CTRL_MINUS, CONTROL, VIRTKEY
END
IDD_MIRRORROTATE DIALOGEX 100, 100, 180, 100
diff --git a/base/applications/mspaint/lang/hu-HU.rc
b/base/applications/mspaint/lang/hu-HU.rc
index ded0865a4d2..266ab21eeb2 100644
--- a/base/applications/mspaint/lang/hu-HU.rc
+++ b/base/applications/mspaint/lang/hu-HU.rc
@@ -140,6 +140,10 @@ BEGIN
"^I", IDM_IMAGEINVERTCOLORS
"^E", IDM_IMAGEATTRIBUTES
"N", IDM_IMAGEDELETEIMAGE, CONTROL, SHIFT, VIRTKEY
+ VK_ADD, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_SUBTRACT, IDM_CTRL_MINUS, CONTROL, VIRTKEY
+ VK_OEM_PLUS, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_OEM_MINUS, IDM_CTRL_MINUS, CONTROL, VIRTKEY
END
IDD_MIRRORROTATE DIALOGEX 100, 100, 180, 100
diff --git a/base/applications/mspaint/lang/id-ID.rc
b/base/applications/mspaint/lang/id-ID.rc
index 3ae30e7f170..b03210330f4 100644
--- a/base/applications/mspaint/lang/id-ID.rc
+++ b/base/applications/mspaint/lang/id-ID.rc
@@ -139,6 +139,10 @@ BEGIN
"^I", IDM_IMAGEINVERTCOLORS
"^E", IDM_IMAGEATTRIBUTES
"N", IDM_IMAGEDELETEIMAGE, CONTROL, SHIFT, VIRTKEY
+ VK_ADD, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_SUBTRACT, IDM_CTRL_MINUS, CONTROL, VIRTKEY
+ VK_OEM_PLUS, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_OEM_MINUS, IDM_CTRL_MINUS, CONTROL, VIRTKEY
END
IDD_MIRRORROTATE DIALOGEX 100, 100, 180, 100
diff --git a/base/applications/mspaint/lang/it-IT.rc
b/base/applications/mspaint/lang/it-IT.rc
index 9327ca498e5..6ef469f5923 100644
--- a/base/applications/mspaint/lang/it-IT.rc
+++ b/base/applications/mspaint/lang/it-IT.rc
@@ -140,6 +140,10 @@ BEGIN
"^I", IDM_IMAGEINVERTCOLORS
"^E", IDM_IMAGEATTRIBUTES
"N", IDM_IMAGEDELETEIMAGE, CONTROL, SHIFT, VIRTKEY
+ VK_ADD, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_SUBTRACT, IDM_CTRL_MINUS, CONTROL, VIRTKEY
+ VK_OEM_PLUS, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_OEM_MINUS, IDM_CTRL_MINUS, CONTROL, VIRTKEY
END
IDD_MIRRORROTATE DIALOGEX 100, 100, 180, 100
diff --git a/base/applications/mspaint/lang/ja-JP.rc
b/base/applications/mspaint/lang/ja-JP.rc
index 5969044d5b4..5c41f90053b 100644
--- a/base/applications/mspaint/lang/ja-JP.rc
+++ b/base/applications/mspaint/lang/ja-JP.rc
@@ -141,6 +141,10 @@ BEGIN
"^I", IDM_IMAGEINVERTCOLORS
"^E", IDM_IMAGEATTRIBUTES
"N", IDM_IMAGEDELETEIMAGE, CONTROL, SHIFT, VIRTKEY
+ VK_ADD, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_SUBTRACT, IDM_CTRL_MINUS, CONTROL, VIRTKEY
+ VK_OEM_PLUS, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_OEM_MINUS, IDM_CTRL_MINUS, CONTROL, VIRTKEY
END
IDD_MIRRORROTATE DIALOGEX 100, 100, 180, 100
diff --git a/base/applications/mspaint/lang/nl-NL.rc
b/base/applications/mspaint/lang/nl-NL.rc
index a6c32b7e7ab..de8539ebfc3 100644
--- a/base/applications/mspaint/lang/nl-NL.rc
+++ b/base/applications/mspaint/lang/nl-NL.rc
@@ -139,6 +139,10 @@ BEGIN
"^I", IDM_IMAGEINVERTCOLORS
"^E", IDM_IMAGEATTRIBUTES
"N", IDM_IMAGEDELETEIMAGE, CONTROL, SHIFT, VIRTKEY
+ VK_ADD, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_SUBTRACT, IDM_CTRL_MINUS, CONTROL, VIRTKEY
+ VK_OEM_PLUS, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_OEM_MINUS, IDM_CTRL_MINUS, CONTROL, VIRTKEY
END
IDD_MIRRORROTATE DIALOGEX 100, 100, 180, 100
diff --git a/base/applications/mspaint/lang/no-NO.rc
b/base/applications/mspaint/lang/no-NO.rc
index 4c4f0398db5..001ca09b9f2 100644
--- a/base/applications/mspaint/lang/no-NO.rc
+++ b/base/applications/mspaint/lang/no-NO.rc
@@ -139,6 +139,10 @@ BEGIN
"^I", IDM_IMAGEINVERTCOLORS
"^E", IDM_IMAGEATTRIBUTES
"N", IDM_IMAGEDELETEIMAGE, CONTROL, SHIFT, VIRTKEY
+ VK_ADD, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_SUBTRACT, IDM_CTRL_MINUS, CONTROL, VIRTKEY
+ VK_OEM_PLUS, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_OEM_MINUS, IDM_CTRL_MINUS, CONTROL, VIRTKEY
END
IDD_MIRRORROTATE DIALOGEX 100, 100, 180, 100
diff --git a/base/applications/mspaint/lang/pl-PL.rc
b/base/applications/mspaint/lang/pl-PL.rc
index d29933dd321..0f9b0076a7a 100644
--- a/base/applications/mspaint/lang/pl-PL.rc
+++ b/base/applications/mspaint/lang/pl-PL.rc
@@ -142,6 +142,10 @@ BEGIN
"^I", IDM_IMAGEINVERTCOLORS
"^E", IDM_IMAGEATTRIBUTES
"N", IDM_IMAGEDELETEIMAGE, CONTROL, SHIFT, VIRTKEY
+ VK_ADD, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_SUBTRACT, IDM_CTRL_MINUS, CONTROL, VIRTKEY
+ VK_OEM_PLUS, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_OEM_MINUS, IDM_CTRL_MINUS, CONTROL, VIRTKEY
END
IDD_MIRRORROTATE DIALOGEX 100, 100, 180, 100
diff --git a/base/applications/mspaint/lang/pt-BR.rc
b/base/applications/mspaint/lang/pt-BR.rc
index c178150a2a5..be53b2cc1b4 100644
--- a/base/applications/mspaint/lang/pt-BR.rc
+++ b/base/applications/mspaint/lang/pt-BR.rc
@@ -140,6 +140,10 @@ BEGIN
"^I", IDM_IMAGEINVERTCOLORS
"^E", IDM_IMAGEATTRIBUTES
"N", IDM_IMAGEDELETEIMAGE, CONTROL, SHIFT, VIRTKEY
+ VK_ADD, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_SUBTRACT, IDM_CTRL_MINUS, CONTROL, VIRTKEY
+ VK_OEM_PLUS, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_OEM_MINUS, IDM_CTRL_MINUS, CONTROL, VIRTKEY
END
IDD_MIRRORROTATE DIALOGEX 100, 100, 180, 100
diff --git a/base/applications/mspaint/lang/pt-PT.rc
b/base/applications/mspaint/lang/pt-PT.rc
index 155c6b3e9a2..f4b9638e03e 100644
--- a/base/applications/mspaint/lang/pt-PT.rc
+++ b/base/applications/mspaint/lang/pt-PT.rc
@@ -140,6 +140,10 @@ BEGIN
"^I", IDM_IMAGEINVERTCOLORS
"^E", IDM_IMAGEATTRIBUTES
"N", IDM_IMAGEDELETEIMAGE, CONTROL, SHIFT, VIRTKEY
+ VK_ADD, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_SUBTRACT, IDM_CTRL_MINUS, CONTROL, VIRTKEY
+ VK_OEM_PLUS, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_OEM_MINUS, IDM_CTRL_MINUS, CONTROL, VIRTKEY
END
IDD_MIRRORROTATE DIALOGEX 100, 100, 180, 100
diff --git a/base/applications/mspaint/lang/ro-RO.rc
b/base/applications/mspaint/lang/ro-RO.rc
index b74925b6523..274c14a28ea 100644
--- a/base/applications/mspaint/lang/ro-RO.rc
+++ b/base/applications/mspaint/lang/ro-RO.rc
@@ -141,6 +141,10 @@ BEGIN
"^I", IDM_IMAGEINVERTCOLORS
"^E", IDM_IMAGEATTRIBUTES
"N", IDM_IMAGEDELETEIMAGE, CONTROL, SHIFT, VIRTKEY
+ VK_ADD, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_SUBTRACT, IDM_CTRL_MINUS, CONTROL, VIRTKEY
+ VK_OEM_PLUS, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_OEM_MINUS, IDM_CTRL_MINUS, CONTROL, VIRTKEY
END
IDD_MIRRORROTATE DIALOGEX 100, 100, 180, 100
diff --git a/base/applications/mspaint/lang/ru-RU.rc
b/base/applications/mspaint/lang/ru-RU.rc
index 05bfa15efc9..964453968e6 100644
--- a/base/applications/mspaint/lang/ru-RU.rc
+++ b/base/applications/mspaint/lang/ru-RU.rc
@@ -143,6 +143,10 @@ BEGIN
"^I", IDM_IMAGEINVERTCOLORS
"^E", IDM_IMAGEATTRIBUTES
"N", IDM_IMAGEDELETEIMAGE, CONTROL, SHIFT, VIRTKEY
+ VK_ADD, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_SUBTRACT, IDM_CTRL_MINUS, CONTROL, VIRTKEY
+ VK_OEM_PLUS, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_OEM_MINUS, IDM_CTRL_MINUS, CONTROL, VIRTKEY
END
IDD_MIRRORROTATE DIALOGEX 100, 100, 180, 100
diff --git a/base/applications/mspaint/lang/sk-SK.rc
b/base/applications/mspaint/lang/sk-SK.rc
index ab02f98cf27..5fa46a01124 100644
--- a/base/applications/mspaint/lang/sk-SK.rc
+++ b/base/applications/mspaint/lang/sk-SK.rc
@@ -139,6 +139,10 @@ BEGIN
"^I", IDM_IMAGEINVERTCOLORS
"^E", IDM_IMAGEATTRIBUTES
"N", IDM_IMAGEDELETEIMAGE, CONTROL, SHIFT, VIRTKEY
+ VK_ADD, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_SUBTRACT, IDM_CTRL_MINUS, CONTROL, VIRTKEY
+ VK_OEM_PLUS, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_OEM_MINUS, IDM_CTRL_MINUS, CONTROL, VIRTKEY
END
IDD_MIRRORROTATE DIALOGEX 100, 100, 180, 100
diff --git a/base/applications/mspaint/lang/sq-AL.rc
b/base/applications/mspaint/lang/sq-AL.rc
index e19521d570e..5da01332cd3 100644
--- a/base/applications/mspaint/lang/sq-AL.rc
+++ b/base/applications/mspaint/lang/sq-AL.rc
@@ -139,6 +139,10 @@ BEGIN
"^I", IDM_IMAGEINVERTCOLORS
"^E", IDM_IMAGEATTRIBUTES
"N", IDM_IMAGEDELETEIMAGE, CONTROL, SHIFT, VIRTKEY
+ VK_ADD, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_SUBTRACT, IDM_CTRL_MINUS, CONTROL, VIRTKEY
+ VK_OEM_PLUS, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_OEM_MINUS, IDM_CTRL_MINUS, CONTROL, VIRTKEY
END
IDD_MIRRORROTATE DIALOGEX 100, 100, 180, 100
diff --git a/base/applications/mspaint/lang/sv-SE.rc
b/base/applications/mspaint/lang/sv-SE.rc
index cdfc04e71a3..ec2f3205a74 100644
--- a/base/applications/mspaint/lang/sv-SE.rc
+++ b/base/applications/mspaint/lang/sv-SE.rc
@@ -140,6 +140,10 @@ BEGIN
"^I", IDM_IMAGEINVERTCOLORS
"^E", IDM_IMAGEATTRIBUTES
"N", IDM_IMAGEDELETEIMAGE, CONTROL, SHIFT, VIRTKEY
+ VK_ADD, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_SUBTRACT, IDM_CTRL_MINUS, CONTROL, VIRTKEY
+ VK_OEM_PLUS, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_OEM_MINUS, IDM_CTRL_MINUS, CONTROL, VIRTKEY
END
IDD_MIRRORROTATE DIALOGEX 100, 100, 180, 100
diff --git a/base/applications/mspaint/lang/tr-TR.rc
b/base/applications/mspaint/lang/tr-TR.rc
index de836e273e4..b7768297a36 100644
--- a/base/applications/mspaint/lang/tr-TR.rc
+++ b/base/applications/mspaint/lang/tr-TR.rc
@@ -140,6 +140,10 @@ BEGIN
"^I", IDM_IMAGEINVERTCOLORS
"^E", IDM_IMAGEATTRIBUTES
"N", IDM_IMAGEDELETEIMAGE, CONTROL, SHIFT, VIRTKEY
+ VK_ADD, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_SUBTRACT, IDM_CTRL_MINUS, CONTROL, VIRTKEY
+ VK_OEM_PLUS, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_OEM_MINUS, IDM_CTRL_MINUS, CONTROL, VIRTKEY
END
IDD_MIRRORROTATE DIALOGEX 100, 100, 180, 100
diff --git a/base/applications/mspaint/lang/uk-UA.rc
b/base/applications/mspaint/lang/uk-UA.rc
index e50eb7b1877..e54a662e1fe 100644
--- a/base/applications/mspaint/lang/uk-UA.rc
+++ b/base/applications/mspaint/lang/uk-UA.rc
@@ -141,6 +141,10 @@ BEGIN
"^I", IDM_IMAGEINVERTCOLORS
"^E", IDM_IMAGEATTRIBUTES
"N", IDM_IMAGEDELETEIMAGE, CONTROL, SHIFT, VIRTKEY
+ VK_ADD, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_SUBTRACT, IDM_CTRL_MINUS, CONTROL, VIRTKEY
+ VK_OEM_PLUS, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_OEM_MINUS, IDM_CTRL_MINUS, CONTROL, VIRTKEY
END
IDD_MIRRORROTATE DIALOGEX 100, 100, 180, 100
diff --git a/base/applications/mspaint/lang/vi-VN.rc
b/base/applications/mspaint/lang/vi-VN.rc
index 07cc7fa0ae0..cebeb1d53cc 100644
--- a/base/applications/mspaint/lang/vi-VN.rc
+++ b/base/applications/mspaint/lang/vi-VN.rc
@@ -139,6 +139,10 @@ BEGIN
"^I", IDM_IMAGEINVERTCOLORS
"^E", IDM_IMAGEATTRIBUTES
"N", IDM_IMAGEDELETEIMAGE, CONTROL, SHIFT, VIRTKEY
+ VK_ADD, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_SUBTRACT, IDM_CTRL_MINUS, CONTROL, VIRTKEY
+ VK_OEM_PLUS, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_OEM_MINUS, IDM_CTRL_MINUS, CONTROL, VIRTKEY
END
IDD_MIRRORROTATE DIALOGEX 100, 100, 180, 100
diff --git a/base/applications/mspaint/lang/zh-CN.rc
b/base/applications/mspaint/lang/zh-CN.rc
index 6a5e2d6349e..962479ab51f 100644
--- a/base/applications/mspaint/lang/zh-CN.rc
+++ b/base/applications/mspaint/lang/zh-CN.rc
@@ -142,6 +142,10 @@ BEGIN
"^I", IDM_IMAGEINVERTCOLORS
"^E", IDM_IMAGEATTRIBUTES
"N", IDM_IMAGEDELETEIMAGE, CONTROL, SHIFT, VIRTKEY
+ VK_ADD, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_SUBTRACT, IDM_CTRL_MINUS, CONTROL, VIRTKEY
+ VK_OEM_PLUS, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_OEM_MINUS, IDM_CTRL_MINUS, CONTROL, VIRTKEY
END
IDD_MIRRORROTATE DIALOGEX 100, 100, 180, 100
diff --git a/base/applications/mspaint/lang/zh-HK.rc
b/base/applications/mspaint/lang/zh-HK.rc
index f3429ab9c1f..65dd0e96eb3 100644
--- a/base/applications/mspaint/lang/zh-HK.rc
+++ b/base/applications/mspaint/lang/zh-HK.rc
@@ -140,6 +140,10 @@ BEGIN
"^I", IDM_IMAGEINVERTCOLORS
"^E", IDM_IMAGEATTRIBUTES
"N", IDM_IMAGEDELETEIMAGE, CONTROL, SHIFT, VIRTKEY
+ VK_ADD, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_SUBTRACT, IDM_CTRL_MINUS, CONTROL, VIRTKEY
+ VK_OEM_PLUS, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_OEM_MINUS, IDM_CTRL_MINUS, CONTROL, VIRTKEY
END
IDD_MIRRORROTATE DIALOGEX 100, 100, 180, 100
diff --git a/base/applications/mspaint/lang/zh-TW.rc
b/base/applications/mspaint/lang/zh-TW.rc
index 953bf47b481..f08299a24f1 100644
--- a/base/applications/mspaint/lang/zh-TW.rc
+++ b/base/applications/mspaint/lang/zh-TW.rc
@@ -140,6 +140,10 @@ BEGIN
"^I", IDM_IMAGEINVERTCOLORS
"^E", IDM_IMAGEATTRIBUTES
"N", IDM_IMAGEDELETEIMAGE, CONTROL, SHIFT, VIRTKEY
+ VK_ADD, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_SUBTRACT, IDM_CTRL_MINUS, CONTROL, VIRTKEY
+ VK_OEM_PLUS, IDM_CTRL_PLUS, CONTROL, VIRTKEY
+ VK_OEM_MINUS, IDM_CTRL_MINUS, CONTROL, VIRTKEY
END
IDD_MIRRORROTATE DIALOGEX 100, 100, 180, 100
diff --git a/base/applications/mspaint/mouse.cpp b/base/applications/mspaint/mouse.cpp
index f6cb9e2ac22..f896ccd84f3 100644
--- a/base/applications/mspaint/mouse.cpp
+++ b/base/applications/mspaint/mouse.cpp
@@ -199,6 +199,11 @@ struct FreeSelTool : ToolBase
selectionModel.HideSelection();
ToolBase::OnCancelDraw();
}
+
+ void OnSpecialTweak(BOOL bMinus) override
+ {
+ selectionModel.StretchSelection(bMinus);
+ }
};
// TOOL_RECTSEL
@@ -280,6 +285,11 @@ struct RectSelTool : ToolBase
selectionModel.HideSelection();
ToolBase::OnCancelDraw();
}
+
+ void OnSpecialTweak(BOOL bMinus) override
+ {
+ selectionModel.StretchSelection(bMinus);
+ }
};
struct TwoPointDrawTool : ToolBase
diff --git a/base/applications/mspaint/resource.h b/base/applications/mspaint/resource.h
index 310554de200..b41486cee4d 100644
--- a/base/applications/mspaint/resource.h
+++ b/base/applications/mspaint/resource.h
@@ -102,6 +102,9 @@
#define IDM_UNDERLINE 282
#define IDM_VERTICAL 283
+#define IDM_CTRL_PLUS 290
+#define IDM_CTRL_MINUS 291
+
/* the following 16 numbers need to be in order, increasing by 1 */
#define ID_FREESEL 600
#define ID_RECTSEL 601
diff --git a/base/applications/mspaint/selectionmodel.cpp
b/base/applications/mspaint/selectionmodel.cpp
index b46a72263b9..c768c360744 100644
--- a/base/applications/mspaint/selectionmodel.cpp
+++ b/base/applications/mspaint/selectionmodel.cpp
@@ -28,8 +28,8 @@ SelectionModel::SelectionModel()
SelectionModel::~SelectionModel()
{
- ClearColor();
- ClearMask();
+ ClearColorImage();
+ ClearMaskImage();
ResetPtStack();
}
@@ -85,7 +85,7 @@ void SelectionModel::BuildMaskFromPtStack()
m_rc = m_rcOld = rc;
- ClearMask();
+ ClearMaskImage();
ShiftPtStack(-m_rcOld.left, -m_rcOld.top);
@@ -154,7 +154,7 @@ void SelectionModel::DrawSelection(HDC hDCImage, COLORREF crBg, BOOL
bBgTranspar
void SelectionModel::GetSelectionContents(HDC hDCImage)
{
- ClearColor();
+ ClearColorImage();
HDC hMemDC = ::CreateCompatibleDC(NULL);
m_hbmColor = CreateColorDIB(m_rc.Width(), m_rc.Height(), RGB(255, 255, 255));
@@ -174,12 +174,17 @@ BOOL SelectionModel::TakeOff()
if (!IsLanded() || ::IsRectEmpty(&m_rc))
return FALSE;
+ // The background color is needed for transparency of selection
m_rgbBack = paletteModel.GetBgColor();
+
+ // Get the contents of the selection area
GetSelectionContents(imageModel.GetDC());
+ // RectSel doesn't need the mask image
if (toolsModel.GetActiveTool() == TOOL_RECTSEL)
- ClearMask();
+ ClearMaskImage();
+ // Save the selection area
m_rcOld = m_rc;
imageModel.NotifyImageChanged();
@@ -225,7 +230,7 @@ void SelectionModel::InsertFromHBITMAP(HBITMAP hbmColor, INT x, INT y,
HBITMAP h
}
else
{
- ClearMask();
+ ClearMaskImage();
}
NotifyContentChanged();
@@ -458,7 +463,7 @@ void SelectionModel::Dragging(HITTEST hit, POINT pt)
m_ptHit = pt;
}
-void SelectionModel::ClearMask()
+void SelectionModel::ClearMaskImage()
{
if (m_hbmMask)
{
@@ -467,7 +472,7 @@ void SelectionModel::ClearMask()
}
}
-void SelectionModel::ClearColor()
+void SelectionModel::ClearColorImage()
{
if (m_hbmColor)
{
@@ -479,8 +484,8 @@ void SelectionModel::ClearColor()
void SelectionModel::HideSelection()
{
m_bShow = m_bContentChanged = FALSE;
- ClearColor();
- ClearMask();
+ ClearColorImage();
+ ClearMaskImage();
::SetRectEmpty(&m_rc);
::SetRectEmpty(&m_rcOld);
imageModel.NotifyImageChanged();
@@ -540,3 +545,26 @@ void SelectionModel::UnlockBitmap(HBITMAP hbmLocked)
{
m_hbmColor = hbmLocked;
}
+
+void SelectionModel::StretchSelection(BOOL bShrink)
+{
+ if (!m_bShow)
+ return;
+
+ TakeOff();
+
+ INT cx = m_rc.Width(), cy = m_rc.Height();
+
+ if (bShrink)
+ m_rc.InflateRect(-cx / 4, -cy / 4);
+ else
+ m_rc.InflateRect(+cx / 2, +cy / 2);
+
+ // The selection area must exist there
+ if (m_rc.Width() <= 0)
+ m_rc.right = m_rc.left + 1;
+ if (m_rc.Height() <= 0)
+ m_rc.bottom = m_rc.top + 1;
+
+ imageModel.NotifyImageChanged();
+}
diff --git a/base/applications/mspaint/selectionmodel.h
b/base/applications/mspaint/selectionmodel.h
index febc6072263..1d0c1b28614 100644
--- a/base/applications/mspaint/selectionmodel.h
+++ b/base/applications/mspaint/selectionmodel.h
@@ -58,10 +58,12 @@ public:
void InvertSelection();
void Dragging(HITTEST hit, POINT pt);
- void ClearMask();
- void ClearColor();
+ void ClearMaskImage();
+ void ClearColorImage();
void NotifyContentChanged();
+ void StretchSelection(BOOL bShrink);
+
private:
SelectionModel(const SelectionModel&);
SelectionModel& operator=(const SelectionModel&);
diff --git a/base/applications/mspaint/toolsmodel.cpp
b/base/applications/mspaint/toolsmodel.cpp
index 604d4bead54..b9a5ac2e4b6 100644
--- a/base/applications/mspaint/toolsmodel.cpp
+++ b/base/applications/mspaint/toolsmodel.cpp
@@ -248,3 +248,8 @@ void ToolsModel::selectAll()
OnMouseMove(TRUE, imageModel.GetWidth(), imageModel.GetHeight());
OnButtonUp(TRUE, imageModel.GetWidth(), imageModel.GetHeight());
}
+
+void ToolsModel::SpecialTweak(BOOL bMinus)
+{
+ m_pToolObject->OnSpecialTweak(bMinus);
+}
diff --git a/base/applications/mspaint/toolsmodel.h
b/base/applications/mspaint/toolsmodel.h
index a00e8682a5f..33335c07ffd 100644
--- a/base/applications/mspaint/toolsmodel.h
+++ b/base/applications/mspaint/toolsmodel.h
@@ -51,6 +51,8 @@ struct ToolBase
virtual void OnDrawOverlayOnImage(HDC hdc) { }
virtual void OnDrawOverlayOnCanvas(HDC hdc) { }
+ virtual void OnSpecialTweak(BOOL bMinus) { }
+
void beginEvent();
void endEvent();
void reset();
@@ -115,6 +117,8 @@ public:
void NotifyToolChanged();
void NotifyToolSettingsChanged();
void NotifyZoomChanged();
+
+ void SpecialTweak(BOOL bMinus);
};
extern ToolsModel toolsModel;
diff --git a/base/applications/mspaint/winproc.cpp
b/base/applications/mspaint/winproc.cpp
index 130c81ebbd9..99658fccd52 100644
--- a/base/applications/mspaint/winproc.cpp
+++ b/base/applications/mspaint/winproc.cpp
@@ -1069,6 +1069,13 @@ LRESULT CMainWindow::OnCommand(UINT nMsg, WPARAM wParam, LPARAM
lParam, BOOL& bH
fullscreenWindow.DoCreate();
fullscreenWindow.ShowWindow(SW_SHOWMAXIMIZED);
break;
+
+ case IDM_CTRL_PLUS:
+ toolsModel.SpecialTweak(FALSE);
+ break;
+ case IDM_CTRL_MINUS:
+ toolsModel.SpecialTweak(TRUE);
+ break;
}
return 0;
}