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
175e7146
Commit
175e7146
authored
Sep 28, 2015
by
Joachim Priesner
Committed by
Alexandre Julliard
Oct 07, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Hide horizontal Listbox scroll bar if no horizontal extent is set.
Signed-off-by:
Joachim Priesner
<
joachim.priesner@web.de
>
parent
109d4b91
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
120 additions
and
1 deletion
+120
-1
listbox.c
dlls/user32/listbox.c
+17
-1
listbox.c
dlls/user32/tests/listbox.c
+103
-0
No files found.
dlls/user32/listbox.c
View file @
175e7146
...
...
@@ -265,7 +265,7 @@ static void LISTBOX_UpdateScroll( LB_DESCR *descr )
if
(
descr
->
style
&
WS_VSCROLL
)
SetScrollInfo
(
descr
->
self
,
SB_VERT
,
&
info
,
TRUE
);
if
(
descr
->
style
&
WS_HSCROLL
)
if
(
(
descr
->
style
&
WS_HSCROLL
)
&&
descr
->
horz_extent
)
{
info
.
nPos
=
descr
->
horz_pos
;
info
.
nPage
=
descr
->
width
;
...
...
@@ -274,6 +274,20 @@ static void LISTBOX_UpdateScroll( LB_DESCR *descr )
info
.
fMask
|=
SIF_DISABLENOSCROLL
;
SetScrollInfo
(
descr
->
self
,
SB_HORZ
,
&
info
,
TRUE
);
}
else
{
if
(
descr
->
style
&
LBS_DISABLENOSCROLL
)
{
info
.
nMin
=
0
;
info
.
nMax
=
0
;
info
.
fMask
=
SIF_RANGE
|
SIF_DISABLENOSCROLL
;
SetScrollInfo
(
descr
->
self
,
SB_HORZ
,
&
info
,
TRUE
);
}
else
{
ShowScrollBar
(
descr
->
self
,
SB_HORZ
,
FALSE
);
}
}
}
}
...
...
@@ -1248,6 +1262,8 @@ static LRESULT LISTBOX_SetHorizontalExtent( LB_DESCR *descr, INT extent )
info
.
nMin
=
0
;
info
.
nMax
=
descr
->
horz_extent
?
descr
->
horz_extent
-
1
:
0
;
info
.
fMask
=
SIF_RANGE
;
if
(
descr
->
style
&
LBS_DISABLENOSCROLL
)
info
.
fMask
|=
SIF_DISABLENOSCROLL
;
SetScrollInfo
(
descr
->
self
,
SB_HORZ
,
&
info
,
TRUE
);
}
if
(
descr
->
horz_pos
>
extent
-
descr
->
width
)
...
...
dlls/user32/tests/listbox.c
View file @
175e7146
...
...
@@ -1665,7 +1665,10 @@ static void test_extents(void)
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
);
ok
((
GetWindowLongA
(
listbox
,
GWL_STYLE
)
&
WS_HSCROLL
)
==
0
,
"List box should not have a horizontal scroll bar
\n
"
);
/* horizontal extent < width */
SendMessageA
(
listbox
,
LB_SETHORIZONTALEXTENT
,
64
,
0
);
res
=
SendMessageA
(
listbox
,
LB_GETHORIZONTALEXTENT
,
0
,
0
);
...
...
@@ -1677,6 +1680,23 @@ static void test_extents(void)
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
);
ok
((
GetWindowLongA
(
listbox
,
GWL_STYLE
)
&
WS_HSCROLL
)
==
0
,
"List box should not have a horizontal scroll bar
\n
"
);
/* horizontal extent > width */
SendMessageA
(
listbox
,
LB_SETHORIZONTALEXTENT
,
184
,
0
);
res
=
SendMessageA
(
listbox
,
LB_GETHORIZONTALEXTENT
,
0
,
0
);
ok
(
res
==
184
,
"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
);
ok
((
GetWindowLongA
(
listbox
,
GWL_STYLE
)
&
WS_HSCROLL
)
==
0
,
"List box should not have a horizontal scroll bar
\n
"
);
DestroyWindow
(
listbox
);
...
...
@@ -1692,7 +1712,71 @@ static void test_extents(void)
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
);
ok
((
GetWindowLongA
(
listbox
,
GWL_STYLE
)
&
WS_HSCROLL
)
==
0
,
"List box should not have a horizontal scroll bar
\n
"
);
/* horizontal extent < width */
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
);
ok
((
GetWindowLongA
(
listbox
,
GWL_STYLE
)
&
WS_HSCROLL
)
==
0
,
"List box should not have a horizontal scroll bar
\n
"
);
/* horizontal extent > width */
SendMessageA
(
listbox
,
LB_SETHORIZONTALEXTENT
,
184
,
0
);
res
=
SendMessageA
(
listbox
,
LB_GETHORIZONTALEXTENT
,
0
,
0
);
ok
(
res
==
184
,
"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
==
183
,
"got wrong max: %u
\n
"
,
sinfo
.
nMax
);
ok
((
GetWindowLongA
(
listbox
,
GWL_STYLE
)
&
WS_HSCROLL
)
!=
0
,
"List box should have a horizontal scroll bar
\n
"
);
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
);
ok
((
GetWindowLongA
(
listbox
,
GWL_STYLE
)
&
WS_HSCROLL
)
==
0
,
"List box should not have a horizontal scroll bar
\n
"
);
DestroyWindow
(
listbox
);
listbox
=
create_listbox
(
WS_CHILD
|
WS_VISIBLE
|
WS_HSCROLL
|
LBS_DISABLENOSCROLL
,
parent
);
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
==
0
,
"got wrong max: %u
\n
"
,
sinfo
.
nMax
);
ok
((
GetWindowLongA
(
listbox
,
GWL_STYLE
)
&
WS_HSCROLL
)
!=
0
,
"List box should have a horizontal scroll bar
\n
"
);
/* horizontal extent < width */
SendMessageA
(
listbox
,
LB_SETHORIZONTALEXTENT
,
64
,
0
);
res
=
SendMessageA
(
listbox
,
LB_GETHORIZONTALEXTENT
,
0
,
0
);
...
...
@@ -1704,6 +1788,23 @@ static void test_extents(void)
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
);
ok
((
GetWindowLongA
(
listbox
,
GWL_STYLE
)
&
WS_HSCROLL
)
!=
0
,
"List box should have a horizontal scroll bar
\n
"
);
/* horizontal extent > width */
SendMessageA
(
listbox
,
LB_SETHORIZONTALEXTENT
,
184
,
0
);
res
=
SendMessageA
(
listbox
,
LB_GETHORIZONTALEXTENT
,
0
,
0
);
ok
(
res
==
184
,
"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
==
183
,
"got wrong max: %u
\n
"
,
sinfo
.
nMax
);
ok
((
GetWindowLongA
(
listbox
,
GWL_STYLE
)
&
WS_HSCROLL
)
!=
0
,
"List box should have a horizontal scroll bar
\n
"
);
SendMessageA
(
listbox
,
LB_SETHORIZONTALEXTENT
,
0
,
0
);
...
...
@@ -1716,6 +1817,8 @@ static void test_extents(void)
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
);
ok
((
GetWindowLongA
(
listbox
,
GWL_STYLE
)
&
WS_HSCROLL
)
!=
0
,
"List box should have a horizontal scroll bar
\n
"
);
DestroyWindow
(
listbox
);
...
...
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