https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0f519a783cd77ab96ae33…
commit 0f519a783cd77ab96ae33df2a02c3eb204f1571d
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Fri Dec 8 11:44:03 2023 +0900
Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
CommitDate: Fri Dec 8 11:44:03 2023 +0900
[SHIMGVW] Implement IDC_BEST_FIT
- Add two parameters to UpdateZoom.
- Enable/disable IDC_BEST_FIT and IDC_REAL_SIZE
buttons in UpdateZoom.
- Call ResetZoom on IDC_BEST_FIT.
CORE-19358
---
dll/win32/shimgvw/shimgvw.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/dll/win32/shimgvw/shimgvw.c b/dll/win32/shimgvw/shimgvw.c
index 0a84f3e5208..9cbea84cec3 100644
--- a/dll/win32/shimgvw/shimgvw.c
+++ b/dll/win32/shimgvw/shimgvw.c
@@ -242,7 +242,7 @@ BOOL Anime_Step(DWORD *pdwDelay)
return FALSE;
}
-static void UpdateZoom(UINT NewZoom)
+static void UpdateZoom(UINT NewZoom, BOOL bEnableBestFit, BOOL bEnableRealSize)
{
BOOL bEnableZoomIn, bEnableZoomOut;
@@ -270,6 +270,10 @@ static void UpdateZoom(UINT NewZoom)
/* Redraw the display window */
InvalidateRect(hDispWnd, NULL, FALSE);
+
+ /* Update toolbar buttons */
+ SendMessageW(hToolBar, TB_ENABLEBUTTON, IDC_BEST_FIT, bEnableBestFit);
+ SendMessageW(hToolBar, TB_ENABLEBUTTON, IDC_REAL_SIZE, bEnableRealSize);
}
static void ZoomInOrOut(BOOL bZoomIn)
@@ -308,7 +312,7 @@ static void ZoomInOrOut(BOOL bZoomIn)
}
/* Update toolbar and refresh screen */
- UpdateZoom(NewZoom);
+ UpdateZoom(NewZoom, TRUE, TRUE);
}
static void ResetZoom(void)
@@ -353,7 +357,7 @@ static void ResetZoom(void)
}
}
- UpdateZoom(NewZoom);
+ UpdateZoom(NewZoom, FALSE, TRUE);
}
static void pLoadImage(LPCWSTR szOpenFileName)
@@ -1055,11 +1059,11 @@ ImageView_WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM
lParam)
break;
case IDC_BEST_FIT:
- DPRINT1("IDC_BEST_FIT unimplemented\n");
+ ResetZoom();
break;
case IDC_REAL_SIZE:
- UpdateZoom(100);
+ UpdateZoom(100, TRUE, FALSE);
return 0;
case IDC_SLIDE_SHOW: