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
698c7f0f
Commit
698c7f0f
authored
Mar 28, 2013
by
Huw Davies
Committed by
Alexandre Julliard
Mar 28, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Invalidate the listbox in LB_SETCOUNT.
parent
5bfc411a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
15 deletions
+65
-15
listbox.c
dlls/user32/listbox.c
+2
-0
listbox.c
dlls/user32/tests/listbox.c
+63
-15
No files found.
dlls/user32/listbox.c
View file @
698c7f0f
...
...
@@ -1767,6 +1767,8 @@ static LRESULT LISTBOX_SetCount( LB_DESCR *descr, INT count )
if
((
ret
=
LISTBOX_RemoveItem
(
descr
,
(
descr
->
nb_items
-
1
)
))
<
0
)
return
ret
;
}
InvalidateRect
(
descr
->
self
,
NULL
,
TRUE
);
return
LB_OKAY
;
}
...
...
dlls/user32/tests/listbox.c
View file @
698c7f0f
...
...
@@ -274,30 +274,42 @@ static LRESULT WINAPI main_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARA
return
DefWindowProc
(
hwnd
,
msg
,
wparam
,
lparam
);
}
static
void
test_ownerdraw
(
void
)
static
HWND
create_parent
(
void
)
{
WNDCLASS
cls
;
HWND
parent
,
hLB
;
INT
ret
;
RECT
rc
;
HWND
parent
;
static
ATOM
class
;
cls
.
style
=
0
;
cls
.
lpfnWndProc
=
main_window_proc
;
cls
.
cbClsExtra
=
0
;
cls
.
cbWndExtra
=
0
;
cls
.
hInstance
=
GetModuleHandle
(
0
);
cls
.
hIcon
=
0
;
cls
.
hCursor
=
LoadCursor
(
0
,
IDC_ARROW
);
cls
.
hbrBackground
=
GetStockObject
(
WHITE_BRUSH
);
cls
.
lpszMenuName
=
NULL
;
cls
.
lpszClassName
=
"main_window_class"
;
ok
(
RegisterClass
(
&
cls
),
"RegisterClass failed
\n
"
);
if
(
!
class
)
{
cls
.
style
=
0
;
cls
.
lpfnWndProc
=
main_window_proc
;
cls
.
cbClsExtra
=
0
;
cls
.
cbWndExtra
=
0
;
cls
.
hInstance
=
GetModuleHandle
(
0
);
cls
.
hIcon
=
0
;
cls
.
hCursor
=
LoadCursor
(
0
,
IDC_ARROW
);
cls
.
hbrBackground
=
GetStockObject
(
WHITE_BRUSH
);
cls
.
lpszMenuName
=
NULL
;
cls
.
lpszClassName
=
"main_window_class"
;
class
=
RegisterClass
(
&
cls
);
}
parent
=
CreateWindowEx
(
0
,
"main_window_class"
,
NULL
,
WS_POPUP
|
WS_VISIBLE
,
100
,
100
,
400
,
400
,
GetDesktopWindow
(),
0
,
GetModuleHandle
(
0
),
NULL
);
return
parent
;
}
static
void
test_ownerdraw
(
void
)
{
HWND
parent
,
hLB
;
INT
ret
;
RECT
rc
;
parent
=
create_parent
();
assert
(
parent
);
hLB
=
create_listbox
(
LBS_OWNERDRAWFIXED
|
WS_CHILD
|
WS_VISIBLE
,
parent
);
...
...
@@ -1498,6 +1510,41 @@ static void test_listbox_dlgdir(void)
DestroyWindow
(
hWnd
);
}
static
void
test_set_count
(
void
)
{
HWND
parent
,
listbox
;
LONG
ret
;
RECT
r
;
parent
=
create_parent
();
listbox
=
create_listbox
(
LBS_OWNERDRAWFIXED
|
LBS_NODATA
|
WS_CHILD
|
WS_VISIBLE
,
parent
);
UpdateWindow
(
listbox
);
GetUpdateRect
(
listbox
,
&
r
,
TRUE
);
ok
(
IsRectEmpty
(
&
r
),
"got non-empty rect
\n
"
);
ret
=
SendMessage
(
listbox
,
LB_SETCOUNT
,
100
,
0
);
ok
(
ret
==
0
,
"got %d
\n
"
,
ret
);
ret
=
SendMessage
(
listbox
,
LB_GETCOUNT
,
0
,
0
);
ok
(
ret
==
100
,
"got %d
\n
"
,
ret
);
GetUpdateRect
(
listbox
,
&
r
,
TRUE
);
ok
(
!
IsRectEmpty
(
&
r
),
"got empty rect
\n
"
);
ValidateRect
(
listbox
,
NULL
);
GetUpdateRect
(
listbox
,
&
r
,
TRUE
);
ok
(
IsRectEmpty
(
&
r
),
"got non-empty rect
\n
"
);
ret
=
SendMessage
(
listbox
,
LB_SETCOUNT
,
99
,
0
);
ok
(
ret
==
0
,
"got %d
\n
"
,
ret
);
GetUpdateRect
(
listbox
,
&
r
,
TRUE
);
ok
(
!
IsRectEmpty
(
&
r
),
"got empty rect
\n
"
);
DestroyWindow
(
listbox
);
DestroyWindow
(
parent
);
}
START_TEST
(
listbox
)
{
const
struct
listbox_test
SS
=
...
...
@@ -1576,4 +1623,5 @@ START_TEST(listbox)
test_listbox_item_data
();
test_listbox_LB_DIR
();
test_listbox_dlgdir
();
test_set_count
();
}
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