regedit: Enable WM_RBUTTONDOWN to set the splitbar
Detlef Riekenberg
wine.dev at web.de
Sun Feb 18 10:14:39 CST 2007
To reproduce the bug:
Use the menu to activate the splitbar (View->Split)
Move the splitbar around with the mouse and press the RMB.
Changelog:
- regedit: Enable WM_RBUTTONDOWN to set the splitbar
I moved some code to a helper-function, because in native regedit
"ESC" and "Return" also set the splitbar
Similar things are required for moving the splitbar
(in native regedit, cursor-left/-right also move the splitbar)
--
By by ... Detlef
-------------- next part --------------
>From 6b32946852940a29d78691517fb94fe491358230 Mon Sep 17 00:00:00 2001
From: Detlef Riekenberg <wine.dev at web.de>
Date: Sun, 18 Feb 2007 16:59:07 +0100
Subject: [PATCH] regedit: Enable WM_RBUTTONDOWN to set the splitbar
---
programs/regedit/childwnd.c | 32 ++++++++++++++++++++++----------
1 files changed, 22 insertions(+), 10 deletions(-)
diff --git a/programs/regedit/childwnd.c b/programs/regedit/childwnd.c
index 6a56e82..5a2ef01 100644
--- a/programs/regedit/childwnd.c
+++ b/programs/regedit/childwnd.c
@@ -32,6 +32,7 @@ #include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL(regedit);
ChildWnd* g_pChildWnd;
+static int last_split;
/*******************************************************************************
* Local module support methods
@@ -162,6 +163,24 @@ static void OnTreeSelectionChanged(HWND
}
/*******************************************************************************
+ * finish_splitbar [internal]
+ *
+ * make the splitbar invisible and resize the windows
+ * (helper for ChildWndProc)
+ */
+static void finish_splitbar(HWND hWnd, int x)
+{
+ RECT rt;
+
+ draw_splitbar(hWnd, last_split);
+ last_split = -1;
+ GetClientRect(hWnd, &rt);
+ g_pChildWnd->nSplitPos = x;
+ ResizeWnd(rt.right, rt.bottom);
+ ReleaseCapture();
+}
+
+/*******************************************************************************
*
* FUNCTION: _CmdWndProc(HWND, unsigned, WORD, LONG)
*
@@ -203,8 +222,6 @@ static BOOL _CmdWndProc(HWND hWnd, UINT
*/
LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
- static int last_split;
-
switch (message) {
case WM_CREATE:
g_pChildWnd = HeapAlloc(GetProcessHeap(), 0, sizeof(ChildWnd));
@@ -253,16 +270,11 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd,
break;
}
+ /* WM_RBUTTONDOWN sets the splitbar the same way as WM_LBUTTONUP */
case WM_LBUTTONUP:
+ case WM_RBUTTONDOWN:
if (GetCapture() == hWnd) {
- RECT rt;
- int x = LOWORD(lParam);
- draw_splitbar(hWnd, last_split);
- last_split = -1;
- GetClientRect(hWnd, &rt);
- g_pChildWnd->nSplitPos = x;
- ResizeWnd(rt.right, rt.bottom);
- ReleaseCapture();
+ finish_splitbar(hWnd, LOWORD(lParam));
}
break;
--
1.4.1
More information about the wine-patches
mailing list