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
6f895715
Commit
6f895715
authored
Oct 08, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 08, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/ipaddress: Select field contents on IPM_SETFOCUS.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f3508490
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
0 deletions
+55
-0
ipaddress.c
dlls/comctl32/ipaddress.c
+1
-0
ipaddress.c
dlls/comctl32/tests/ipaddress.c
+54
-0
No files found.
dlls/comctl32/ipaddress.c
View file @
6f895715
...
...
@@ -393,6 +393,7 @@ static void IPADDRESS_SetFocusToField (const IPADDRESS_INFO *infoPtr, INT index)
if
(
index
>
3
||
index
<
0
)
index
=
0
;
SendMessageW
(
infoPtr
->
Part
[
index
].
EditHwnd
,
EM_SETSEL
,
0
,
-
1
);
SetFocus
(
infoPtr
->
Part
[
index
].
EditHwnd
);
}
...
...
dlls/comctl32/tests/ipaddress.c
View file @
6f895715
...
...
@@ -62,17 +62,71 @@ static void test_get_set_text(void)
DestroyWindow
(
hwnd
);
}
struct
child_enum
{
HWND
fields
[
4
];
unsigned
int
count
;
};
static
BOOL
CALLBACK
test_child_enum_proc
(
HWND
hwnd
,
LPARAM
param
)
{
struct
child_enum
*
child_enum
=
(
struct
child_enum
*
)
param
;
char
buff
[
16
]
=
{
0
};
unsigned
int
index
;
GetWindowTextA
(
hwnd
,
buff
,
ARRAY_SIZE
(
buff
));
index
=
atoi
(
buff
);
ok
(
index
<
4
,
"Unexpected index.
\n
"
);
if
(
index
<
4
)
child_enum
->
fields
[
index
]
=
hwnd
;
return
++
child_enum
->
count
<
4
;
}
static
void
test_IPM_SETFOCUS
(
void
)
{
struct
child_enum
child_enum
=
{{
0
}};
unsigned
int
ret
,
from
,
to
,
i
;
HWND
hwnd
;
hwnd
=
create_ipaddress_control
();
ok
(
!!
hwnd
,
"Failed to create control.
\n
"
);
ret
=
SendMessageA
(
hwnd
,
IPM_SETADDRESS
,
0
,
MAKEIPADDRESS
(
0
,
1
,
2
,
3
));
ok
(
ret
,
"Unexpected return value %u.
\n
"
,
ret
);
EnumChildWindows
(
hwnd
,
test_child_enum_proc
,
(
LPARAM
)
&
child_enum
);
ok
(
child_enum
.
count
==
4
,
"Unexpected child count %u.
\n
"
,
child_enum
.
count
);
for
(
i
=
0
;
i
<
3
;
++
i
)
SendMessageA
(
child_enum
.
fields
[
i
],
EM_SETSEL
,
-
1
,
0
);
SendMessageA
(
child_enum
.
fields
[
0
],
EM_GETSEL
,
(
WPARAM
)
&
from
,
(
LPARAM
)
&
to
);
ok
(
from
==
0
&&
to
==
0
,
"Unexpected selection %u x %u.
\n
"
,
from
,
to
);
ret
=
SendMessageA
(
hwnd
,
IPM_SETFOCUS
,
0
,
0
);
todo_wine
ok
(
ret
,
"Unexpected return value %u.
\n
"
,
ret
);
SendMessageA
(
child_enum
.
fields
[
0
],
EM_GETSEL
,
(
WPARAM
)
&
from
,
(
LPARAM
)
&
to
);
ok
(
from
==
0
&&
to
==
1
,
"Unexpected selection %u x %u.
\n
"
,
from
,
to
);
DestroyWindow
(
hwnd
);
}
START_TEST
(
ipaddress
)
{
ULONG_PTR
cookie
;
HANDLE
ctxt
;
test_get_set_text
();
test_IPM_SETFOCUS
();
if
(
!
load_v6_module
(
&
cookie
,
&
ctxt
))
return
;
test_get_set_text
();
test_IPM_SETFOCUS
();
unload_v6_module
(
cookie
,
ctxt
);
}
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