Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
fcabbbf3
Commit
fcabbbf3
authored
Jan 13, 2009
by
Dylan Smith
Committed by
Alexandre Julliard
Jan 14, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
richedit: Zoom in and out with mouse wheel with control held.
parent
b70b3e89
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
12 deletions
+29
-12
editor.c
dlls/riched20/editor.c
+23
-6
editor.c
dlls/riched20/tests/editor.c
+6
-6
No files found.
dlls/riched20/editor.c
View file @
fcabbbf3
...
@@ -4096,18 +4096,35 @@ static LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
...
@@ -4096,18 +4096,35 @@ static LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
{
{
int
gcWheelDelta
;
int
gcWheelDelta
;
UINT
pulScrollLines
;
UINT
pulScrollLines
;
BOOL
ctrl_is_down
;
if
((
editor
->
nEventMask
&
ENM_MOUSEEVENTS
)
&&
if
((
editor
->
nEventMask
&
ENM_MOUSEEVENTS
)
&&
!
ME_FilterEvent
(
editor
,
msg
,
&
wParam
,
&
lParam
))
!
ME_FilterEvent
(
editor
,
msg
,
&
wParam
,
&
lParam
))
return
0
;
return
0
;
SystemParametersInfoW
(
SPI_GETWHEELSCROLLLINES
,
0
,
&
pulScrollLines
,
0
);
ctrl_is_down
=
GetKeyState
(
VK_CONTROL
)
&
0x8000
;
gcWheelDelta
=
-
GET_WHEEL_DELTA_WPARAM
(
wParam
);
gcWheelDelta
=
GET_WHEEL_DELTA_WPARAM
(
wParam
);
if
(
abs
(
gcWheelDelta
)
>=
WHEEL_DELTA
&&
pulScrollLines
)
if
(
abs
(
gcWheelDelta
)
>=
WHEEL_DELTA
)
{
{
/* FIXME follow the original */
if
(
ctrl_is_down
)
{
ME_ScrollDown
(
editor
,
pulScrollLines
*
(
gcWheelDelta
/
WHEEL_DELTA
)
*
8
);
int
numerator
;
if
(
!
editor
->
nZoomNumerator
||
!
editor
->
nZoomDenominator
)
{
numerator
=
100
;
}
else
{
numerator
=
editor
->
nZoomNumerator
*
100
/
editor
->
nZoomDenominator
;
}
numerator
=
numerator
+
(
gcWheelDelta
/
WHEEL_DELTA
)
*
10
;
if
(
numerator
>=
10
&&
numerator
<=
500
)
ME_SetZoom
(
editor
,
numerator
,
100
);
}
else
{
SystemParametersInfoW
(
SPI_GETWHEELSCROLLLINES
,
0
,
&
pulScrollLines
,
0
);
/* FIXME follow the original */
if
(
pulScrollLines
)
ME_ScrollDown
(
editor
,
pulScrollLines
*
(
-
gcWheelDelta
/
WHEEL_DELTA
)
*
8
);
}
}
}
break
;
break
;
}
}
...
...
dlls/riched20/tests/editor.c
View file @
fcabbbf3
...
@@ -6292,8 +6292,8 @@ static void test_zoom(void)
...
@@ -6292,8 +6292,8 @@ static void test_zoom(void)
release_key
(
VK_CONTROL
);
release_key
(
VK_CONTROL
);
ret
=
SendMessage
(
hwnd
,
EM_GETZOOM
,
(
WPARAM
)
&
numerator
,
(
LPARAM
)
&
denominator
);
ret
=
SendMessage
(
hwnd
,
EM_GETZOOM
,
(
WPARAM
)
&
numerator
,
(
LPARAM
)
&
denominator
);
todo_wine
ok
(
numerator
==
110
,
"incorrect numerator is %d
\n
"
,
numerator
);
ok
(
numerator
==
110
,
"incorrect numerator is %d
\n
"
,
numerator
);
todo_wine
ok
(
denominator
==
100
,
"incorrect denominator is %d
\n
"
,
denominator
);
ok
(
denominator
==
100
,
"incorrect denominator is %d
\n
"
,
denominator
);
ok
(
ret
==
TRUE
,
"EM_GETZOOM failed (%d).
\n
"
,
ret
);
ok
(
ret
==
TRUE
,
"EM_GETZOOM failed (%d).
\n
"
,
ret
);
/* Test how much the mouse wheel can zoom in and out. */
/* Test how much the mouse wheel can zoom in and out. */
...
@@ -6307,7 +6307,7 @@ static void test_zoom(void)
...
@@ -6307,7 +6307,7 @@ static void test_zoom(void)
release_key
(
VK_CONTROL
);
release_key
(
VK_CONTROL
);
ret
=
SendMessage
(
hwnd
,
EM_GETZOOM
,
(
WPARAM
)
&
numerator
,
(
LPARAM
)
&
denominator
);
ret
=
SendMessage
(
hwnd
,
EM_GETZOOM
,
(
WPARAM
)
&
numerator
,
(
LPARAM
)
&
denominator
);
todo_wine
ok
(
numerator
==
500
,
"incorrect numerator is %d
\n
"
,
numerator
);
ok
(
numerator
==
500
,
"incorrect numerator is %d
\n
"
,
numerator
);
ok
(
denominator
==
100
,
"incorrect denominator is %d
\n
"
,
denominator
);
ok
(
denominator
==
100
,
"incorrect denominator is %d
\n
"
,
denominator
);
ok
(
ret
==
TRUE
,
"EM_GETZOOM failed (%d).
\n
"
,
ret
);
ok
(
ret
==
TRUE
,
"EM_GETZOOM failed (%d).
\n
"
,
ret
);
...
@@ -6335,7 +6335,7 @@ static void test_zoom(void)
...
@@ -6335,7 +6335,7 @@ static void test_zoom(void)
release_key
(
VK_CONTROL
);
release_key
(
VK_CONTROL
);
ret
=
SendMessage
(
hwnd
,
EM_GETZOOM
,
(
WPARAM
)
&
numerator
,
(
LPARAM
)
&
denominator
);
ret
=
SendMessage
(
hwnd
,
EM_GETZOOM
,
(
WPARAM
)
&
numerator
,
(
LPARAM
)
&
denominator
);
todo_wine
ok
(
numerator
==
10
,
"incorrect numerator is %d
\n
"
,
numerator
);
ok
(
numerator
==
10
,
"incorrect numerator is %d
\n
"
,
numerator
);
ok
(
denominator
==
100
,
"incorrect denominator is %d
\n
"
,
denominator
);
ok
(
denominator
==
100
,
"incorrect denominator is %d
\n
"
,
denominator
);
ok
(
ret
==
TRUE
,
"EM_GETZOOM failed (%d).
\n
"
,
ret
);
ok
(
ret
==
TRUE
,
"EM_GETZOOM failed (%d).
\n
"
,
ret
);
...
@@ -6364,8 +6364,8 @@ static void test_zoom(void)
...
@@ -6364,8 +6364,8 @@ static void test_zoom(void)
release_key
(
VK_CONTROL
);
release_key
(
VK_CONTROL
);
ret
=
SendMessage
(
hwnd
,
EM_GETZOOM
,
(
WPARAM
)
&
numerator
,
(
LPARAM
)
&
denominator
);
ret
=
SendMessage
(
hwnd
,
EM_GETZOOM
,
(
WPARAM
)
&
numerator
,
(
LPARAM
)
&
denominator
);
todo_wine
ok
(
numerator
==
394
,
"incorrect numerator is %d
\n
"
,
numerator
);
ok
(
numerator
==
394
,
"incorrect numerator is %d
\n
"
,
numerator
);
todo_wine
ok
(
denominator
==
100
,
"incorrect denominator is %d
\n
"
,
denominator
);
ok
(
denominator
==
100
,
"incorrect denominator is %d
\n
"
,
denominator
);
ok
(
ret
==
TRUE
,
"EM_GETZOOM failed (%d).
\n
"
,
ret
);
ok
(
ret
==
TRUE
,
"EM_GETZOOM failed (%d).
\n
"
,
ret
);
/* Test bounds checking on EM_SETZOOM */
/* Test bounds checking on EM_SETZOOM */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment