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
cb1242a8
Commit
cb1242a8
authored
Apr 28, 2014
by
Andrew Eikum
Committed by
Alexandre Julliard
Apr 28, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Only update listbox horizontal scroll info if WS_HSCROLL is set.
parent
41f5b155
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
9 deletions
+53
-9
listbox.c
dlls/user32/listbox.c
+11
-9
listbox.c
dlls/user32/tests/listbox.c
+42
-0
No files found.
dlls/user32/listbox.c
View file @
cb1242a8
...
...
@@ -265,17 +265,14 @@ static void LISTBOX_UpdateScroll( LB_DESCR *descr )
if
(
descr
->
style
&
WS_VSCROLL
)
SetScrollInfo
(
descr
->
self
,
SB_VERT
,
&
info
,
TRUE
);
if
(
descr
->
horz_extent
)
if
(
descr
->
style
&
WS_HSCROLL
)
{
info
.
nMin
=
0
;
info
.
nMax
=
descr
->
horz_extent
-
1
;
info
.
nPos
=
descr
->
horz_pos
;
info
.
nPage
=
descr
->
width
;
info
.
fMask
=
SIF_
RANGE
|
SIF_
POS
|
SIF_PAGE
;
info
.
fMask
=
SIF_POS
|
SIF_PAGE
;
if
(
descr
->
style
&
LBS_DISABLENOSCROLL
)
info
.
fMask
|=
SIF_DISABLENOSCROLL
;
if
(
descr
->
style
&
WS_HSCROLL
)
SetScrollInfo
(
descr
->
self
,
SB_HORZ
,
&
info
,
TRUE
);
SetScrollInfo
(
descr
->
self
,
SB_HORZ
,
&
info
,
TRUE
);
}
}
}
...
...
@@ -1241,14 +1238,19 @@ static LRESULT LISTBOX_SetHorizontalExtent( LB_DESCR *descr, INT extent )
{
if
(
descr
->
style
&
LBS_MULTICOLUMN
)
return
LB_OKAY
;
if
(
extent
<=
0
)
extent
=
1
;
if
(
extent
==
descr
->
horz_extent
)
return
LB_OKAY
;
TRACE
(
"[%p]: new horz extent = %d
\n
"
,
descr
->
self
,
extent
);
descr
->
horz_extent
=
extent
;
if
(
descr
->
style
&
WS_HSCROLL
)
{
SCROLLINFO
info
;
info
.
cbSize
=
sizeof
(
info
);
info
.
nMin
=
0
;
info
.
nMax
=
descr
->
horz_extent
?
descr
->
horz_extent
-
1
:
0
;
info
.
fMask
=
SIF_RANGE
;
SetScrollInfo
(
descr
->
self
,
SB_HORZ
,
&
info
,
TRUE
);
}
if
(
descr
->
horz_pos
>
extent
-
descr
->
width
)
LISTBOX_SetHorizontalPos
(
descr
,
extent
-
descr
->
width
);
else
LISTBOX_UpdateScroll
(
descr
);
return
LB_OKAY
;
}
...
...
dlls/user32/tests/listbox.c
View file @
cb1242a8
...
...
@@ -1621,6 +1621,8 @@ static void test_extents(void)
{
HWND
listbox
,
parent
;
DWORD
res
;
SCROLLINFO
sinfo
;
BOOL
br
;
parent
=
create_parent
();
...
...
@@ -1629,11 +1631,25 @@ static void test_extents(void)
res
=
SendMessageA
(
listbox
,
LB_GETHORIZONTALEXTENT
,
0
,
0
);
ok
(
res
==
0
,
"Got wrong initial horizontal extent: %u
\n
"
,
res
);
sinfo
.
cbSize
=
sizeof
(
sinfo
);
sinfo
.
fMask
=
SIF_RANGE
;
br
=
GetScrollInfo
(
listbox
,
SB_HORZ
,
&
sinfo
);
ok
(
br
==
TRUE
,
"GetScrollInfo failed
\n
"
);
ok
(
sinfo
.
nMin
==
0
,
"got wrong min: %u
\n
"
,
sinfo
.
nMin
);
ok
(
sinfo
.
nMax
==
100
,
"got wrong max: %u
\n
"
,
sinfo
.
nMax
);
SendMessageA
(
listbox
,
LB_SETHORIZONTALEXTENT
,
64
,
0
);
res
=
SendMessageA
(
listbox
,
LB_GETHORIZONTALEXTENT
,
0
,
0
);
ok
(
res
==
64
,
"Got wrong horizontal extent: %u
\n
"
,
res
);
sinfo
.
cbSize
=
sizeof
(
sinfo
);
sinfo
.
fMask
=
SIF_RANGE
;
br
=
GetScrollInfo
(
listbox
,
SB_HORZ
,
&
sinfo
);
ok
(
br
==
TRUE
,
"GetScrollInfo failed
\n
"
);
ok
(
sinfo
.
nMin
==
0
,
"got wrong min: %u
\n
"
,
sinfo
.
nMin
);
ok
(
sinfo
.
nMax
==
100
,
"got wrong max: %u
\n
"
,
sinfo
.
nMax
);
DestroyWindow
(
listbox
);
...
...
@@ -1642,11 +1658,37 @@ static void test_extents(void)
res
=
SendMessageA
(
listbox
,
LB_GETHORIZONTALEXTENT
,
0
,
0
);
ok
(
res
==
0
,
"Got wrong initial horizontal extent: %u
\n
"
,
res
);
sinfo
.
cbSize
=
sizeof
(
sinfo
);
sinfo
.
fMask
=
SIF_RANGE
;
br
=
GetScrollInfo
(
listbox
,
SB_HORZ
,
&
sinfo
);
ok
(
br
==
TRUE
,
"GetScrollInfo failed
\n
"
);
ok
(
sinfo
.
nMin
==
0
,
"got wrong min: %u
\n
"
,
sinfo
.
nMin
);
ok
(
sinfo
.
nMax
==
100
,
"got wrong max: %u
\n
"
,
sinfo
.
nMax
);
SendMessageA
(
listbox
,
LB_SETHORIZONTALEXTENT
,
64
,
0
);
res
=
SendMessageA
(
listbox
,
LB_GETHORIZONTALEXTENT
,
0
,
0
);
ok
(
res
==
64
,
"Got wrong horizontal extent: %u
\n
"
,
res
);
sinfo
.
cbSize
=
sizeof
(
sinfo
);
sinfo
.
fMask
=
SIF_RANGE
;
br
=
GetScrollInfo
(
listbox
,
SB_HORZ
,
&
sinfo
);
ok
(
br
==
TRUE
,
"GetScrollInfo failed
\n
"
);
ok
(
sinfo
.
nMin
==
0
,
"got wrong min: %u
\n
"
,
sinfo
.
nMin
);
ok
(
sinfo
.
nMax
==
63
,
"got wrong max: %u
\n
"
,
sinfo
.
nMax
);
SendMessageA
(
listbox
,
LB_SETHORIZONTALEXTENT
,
0
,
0
);
res
=
SendMessageA
(
listbox
,
LB_GETHORIZONTALEXTENT
,
0
,
0
);
ok
(
res
==
0
,
"Got wrong horizontal extent: %u
\n
"
,
res
);
sinfo
.
cbSize
=
sizeof
(
sinfo
);
sinfo
.
fMask
=
SIF_RANGE
;
br
=
GetScrollInfo
(
listbox
,
SB_HORZ
,
&
sinfo
);
ok
(
br
==
TRUE
,
"GetScrollInfo failed
\n
"
);
ok
(
sinfo
.
nMin
==
0
,
"got wrong min: %u
\n
"
,
sinfo
.
nMin
);
ok
(
sinfo
.
nMax
==
0
,
"got wrong max: %u
\n
"
,
sinfo
.
nMax
);
DestroyWindow
(
listbox
);
DestroyWindow
(
parent
);
...
...
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