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
5caa6517
Commit
5caa6517
authored
Jul 16, 2015
by
Alex Henrie
Committed by
Alexandre Julliard
Jul 17, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Scroll listbox item completely into view on LB_SETCURSEL.
parent
f6125536
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
3 deletions
+32
-3
listbox.c
dlls/user32/listbox.c
+1
-1
listbox.c
dlls/user32/tests/listbox.c
+31
-2
No files found.
dlls/user32/listbox.c
View file @
5caa6517
...
...
@@ -2855,7 +2855,7 @@ LRESULT ListBoxWndProc_common( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam
case
LB_SETCURSEL
:
if
(
IS_MULTISELECT
(
descr
))
return
LB_ERR
;
LISTBOX_SetCaretIndex
(
descr
,
wParam
,
FALS
E
);
LISTBOX_SetCaretIndex
(
descr
,
wParam
,
TRU
E
);
ret
=
LISTBOX_SetSelection
(
descr
,
wParam
,
TRUE
,
FALSE
);
if
(
ret
!=
LB_ERR
)
ret
=
descr
->
selected_item
;
return
ret
;
...
...
dlls/user32/tests/listbox.c
View file @
5caa6517
...
...
@@ -349,7 +349,7 @@ static void test_ownerdraw(void)
ok(exp.caret == got.caret, "expected caret %d, got %d\n", exp.caret, got.caret); \
ok(exp.selcount == got.selcount, "expected selcount %d, got %d\n", exp.selcount, got.selcount);
static
void
test_
selection
(
void
)
static
void
test_
LB_SELITEMRANGE
(
void
)
{
static
const
struct
listbox_stat
test_nosel
=
{
0
,
LB_ERR
,
0
,
0
};
static
const
struct
listbox_stat
test_1
=
{
0
,
LB_ERR
,
0
,
2
};
...
...
@@ -429,6 +429,34 @@ static void test_selection(void)
DestroyWindow
(
hLB
);
}
static
void
test_LB_SETCURSEL
(
void
)
{
HWND
parent
,
hLB
;
INT
ret
;
trace
(
"testing LB_SETCURSEL
\n
"
);
parent
=
create_parent
();
assert
(
parent
);
hLB
=
create_listbox
(
LBS_NOINTEGRALHEIGHT
|
WS_CHILD
,
parent
);
assert
(
hLB
);
SendMessageA
(
hLB
,
LB_SETITEMHEIGHT
,
0
,
32
);
ret
=
SendMessageA
(
hLB
,
LB_SETCURSEL
,
2
,
0
);
ok
(
ret
==
2
,
"LB_SETCURSEL returned %d instead of 2
\n
"
,
ret
);
ret
=
GetScrollPos
(
hLB
,
SB_VERT
);
ok
(
ret
==
0
,
"expected vscroll 0, got %d
\n
"
,
ret
);
ret
=
SendMessageA
(
hLB
,
LB_SETCURSEL
,
3
,
0
);
ok
(
ret
==
3
,
"LB_SETCURSEL returned %d instead of 3
\n
"
,
ret
);
ret
=
GetScrollPos
(
hLB
,
SB_VERT
);
ok
(
ret
==
1
,
"expected vscroll 1, got %d
\n
"
,
ret
);
DestroyWindow
(
hLB
);
}
static
void
test_listbox_height
(
void
)
{
HWND
hList
;
...
...
@@ -1766,7 +1794,8 @@ START_TEST(listbox)
check_item_height
();
test_ownerdraw
();
test_selection
();
test_LB_SELITEMRANGE
();
test_LB_SETCURSEL
();
test_listbox_height
();
test_itemfrompoint
();
test_listbox_item_data
();
...
...
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