Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
5079d20f
Commit
5079d20f
authored
Sep 11, 2007
by
Lei Zhang
Committed by
Alexandre Julliard
Sep 13, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Edit control should respond to ctrl + z.
parent
c5ba9013
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
0 deletions
+62
-0
edit.c
dlls/user32/edit.c
+4
-0
edit.c
dlls/user32/tests/edit.c
+58
-0
No files found.
dlls/user32/edit.c
View file @
5079d20f
...
...
@@ -4036,6 +4036,10 @@ static void EDIT_WM_Char(EDITSTATE *es, WCHAR c)
if
(
!
((
es
->
style
&
ES_READONLY
)
||
(
es
->
style
&
ES_PASSWORD
)))
SendMessageW
(
es
->
hwndSelf
,
WM_CUT
,
0
,
0
);
break
;
case
0x1A
:
/* ^Z */
if
(
!
(
es
->
style
&
ES_READONLY
))
SendMessageW
(
es
->
hwndSelf
,
WM_UNDO
,
0
,
0
);
break
;
default:
/*If Edit control style is ES_NUMBER allow users to key in only numeric values*/
...
...
dlls/user32/tests/edit.c
View file @
5079d20f
...
...
@@ -1047,6 +1047,63 @@ static void test_espassword(void)
DestroyWindow
(
hwEdit
);
}
static
void
test_undo
(
void
)
{
HWND
hwEdit
;
LONG
r
;
DWORD
cpMin
,
cpMax
;
char
buffer
[
1024
];
const
char
*
text
=
"undo this"
;
hwEdit
=
create_editcontrol
(
0
,
0
);
r
=
get_edit_style
(
hwEdit
);
ok
(
0
==
r
,
"Wrong style expected 0x%x got: 0x%x
\n
"
,
0
,
r
);
/* set text */
r
=
SendMessage
(
hwEdit
,
WM_SETTEXT
,
0
,
(
LPARAM
)
text
);
ok
(
TRUE
==
r
,
"Expected: %d, got: %d
\n
"
,
TRUE
,
r
);
/* select all, */
cpMin
=
cpMax
=
0xdeadbeef
;
SendMessage
(
hwEdit
,
EM_SETSEL
,
0
,
-
1
);
r
=
SendMessage
(
hwEdit
,
EM_GETSEL
,
(
WPARAM
)
&
cpMin
,
(
LPARAM
)
&
cpMax
);
ok
((
strlen
(
text
)
<<
16
)
==
r
,
"Unexpected length %d
\n
"
,
r
);
ok
(
0
==
cpMin
,
"Expected: %d, got %d
\n
"
,
0
,
cpMin
);
ok
(
9
==
cpMax
,
"Expected: %d, got %d
\n
"
,
9
,
cpMax
);
/* cut (ctrl-x) */
r
=
SendMessage
(
hwEdit
,
WM_CHAR
,
24
,
0
);
todo_wine
{
ok
(
1
==
r
,
"Expected: %d, got: %d
\n
"
,
1
,
r
);
}
/* get text */
buffer
[
0
]
=
0
;
r
=
SendMessage
(
hwEdit
,
WM_GETTEXT
,
1024
,
(
LPARAM
)
buffer
);
ok
(
0
==
r
,
"Expected: %d, got len %d
\n
"
,
0
,
r
);
ok
(
0
==
strcmp
(
buffer
,
""
),
"expected %s, got %s
\n
"
,
""
,
buffer
);
/* undo (ctrl-z) */
r
=
SendMessage
(
hwEdit
,
WM_CHAR
,
26
,
0
);
todo_wine
{
ok
(
1
==
r
,
"Expected: %d, got: %d
\n
"
,
1
,
r
);
}
/* get text */
buffer
[
0
]
=
0
;
r
=
SendMessage
(
hwEdit
,
WM_GETTEXT
,
1024
,
(
LPARAM
)
buffer
);
ok
(
strlen
(
text
)
==
r
,
"Unexpected length %d
\n
"
,
r
);
ok
(
0
==
strcmp
(
buffer
,
text
),
"expected %s, got %s
\n
"
,
text
,
buffer
);
/* undo again (ctrl-z) */
r
=
SendMessage
(
hwEdit
,
WM_CHAR
,
26
,
0
);
todo_wine
{
ok
(
1
==
r
,
"Expected: %d, got: %d
\n
"
,
1
,
r
);
}
/* get text */
buffer
[
0
]
=
0
;
r
=
SendMessage
(
hwEdit
,
WM_GETTEXT
,
1024
,
(
LPARAM
)
buffer
);
ok
(
r
==
0
,
"Expected: %d, got len %d
\n
"
,
0
,
r
);
ok
(
0
==
strcmp
(
buffer
,
""
),
"expected %s, got %s
\n
"
,
""
,
buffer
);
DestroyWindow
(
hwEdit
);
}
static
BOOL
RegisterWindowClasses
(
void
)
{
WNDCLASSA
test2
;
...
...
@@ -1113,6 +1170,7 @@ START_TEST(edit)
test_margins_font_change
();
test_text_position
();
test_espassword
();
test_undo
();
UnregisterWindowClasses
();
}
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