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
3fcf37a0
Commit
3fcf37a0
authored
Oct 10, 2002
by
Andrew M. Johnston
Committed by
Alexandre Julliard
Oct 10, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make info structure members lower case as elsewhere.
parent
11af04e3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
52 deletions
+52
-52
scroll.c
controls/scroll.c
+52
-52
No files found.
controls/scroll.c
View file @
3fcf37a0
...
...
@@ -32,10 +32,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(scroll);
typedef
struct
{
INT
C
urVal
;
/* Current scroll-bar value */
INT
M
inVal
;
/* Minimum scroll-bar value */
INT
M
axVal
;
/* Maximum scroll-bar value */
INT
P
age
;
/* Page size of scroll bar (Win32) */
INT
c
urVal
;
/* Current scroll-bar value */
INT
m
inVal
;
/* Minimum scroll-bar value */
INT
m
axVal
;
/* Maximum scroll-bar value */
INT
p
age
;
/* Page size of scroll bar (Win32) */
UINT
flags
;
/* EnableScrollBar flags */
}
SCROLLBAR_INFO
;
...
...
@@ -181,8 +181,8 @@ static SCROLLBAR_INFO *SCROLL_GetScrollInfo( HWND hwnd, INT nBar )
{
if
((
infoPtr
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
SCROLLBAR_INFO
)
)))
{
infoPtr
->
MinVal
=
infoPtr
->
CurVal
=
infoPtr
->
P
age
=
0
;
infoPtr
->
M
axVal
=
100
;
infoPtr
->
minVal
=
infoPtr
->
curVal
=
infoPtr
->
p
age
=
0
;
infoPtr
->
m
axVal
=
100
;
infoPtr
->
flags
=
ESB_ENABLE_BOTH
;
if
(
nBar
==
SB_HORZ
)
wndPtr
->
pHScroll
=
infoPtr
;
else
wndPtr
->
pVScroll
=
infoPtr
;
...
...
@@ -269,9 +269,9 @@ static BOOL SCROLL_GetScrollBarRect( HWND hwnd, INT nBar, RECT *lprect,
*
arrowSize
=
GetSystemMetrics
(
SM_CXVSCROLL
);
pixels
-=
(
2
*
(
GetSystemMetrics
(
SM_CXVSCROLL
)
-
SCROLL_ARROW_THUMB_OVERLAP
));
if
(
info
->
P
age
)
if
(
info
->
p
age
)
{
*
thumbSize
=
MulDiv
(
pixels
,
info
->
Page
,(
info
->
MaxVal
-
info
->
M
inVal
+
1
));
*
thumbSize
=
MulDiv
(
pixels
,
info
->
page
,(
info
->
maxVal
-
info
->
m
inVal
+
1
));
if
(
*
thumbSize
<
SCROLL_MIN_THUMB
)
*
thumbSize
=
SCROLL_MIN_THUMB
;
}
else
*
thumbSize
=
GetSystemMetrics
(
SM_CXVSCROLL
);
...
...
@@ -284,12 +284,12 @@ static BOOL SCROLL_GetScrollBarRect( HWND hwnd, INT nBar, RECT *lprect,
}
else
{
INT
max
=
info
->
MaxVal
-
max
(
info
->
P
age
-
1
,
0
);
if
(
info
->
M
inVal
>=
max
)
INT
max
=
info
->
maxVal
-
max
(
info
->
p
age
-
1
,
0
);
if
(
info
->
m
inVal
>=
max
)
*
thumbPos
=
*
arrowSize
-
SCROLL_ARROW_THUMB_OVERLAP
;
else
*
thumbPos
=
*
arrowSize
-
SCROLL_ARROW_THUMB_OVERLAP
+
MulDiv
(
pixels
,
(
info
->
CurVal
-
info
->
MinVal
),(
max
-
info
->
M
inVal
));
+
MulDiv
(
pixels
,
(
info
->
curVal
-
info
->
minVal
),(
max
-
info
->
m
inVal
));
}
}
WIN_ReleaseWndPtr
(
wndPtr
);
...
...
@@ -310,23 +310,23 @@ static UINT SCROLL_GetThumbVal( SCROLLBAR_INFO *infoPtr, RECT *rect,
INT
pixels
=
vertical
?
rect
->
bottom
-
rect
->
top
:
rect
->
right
-
rect
->
left
;
if
((
pixels
-=
2
*
(
GetSystemMetrics
(
SM_CXVSCROLL
)
-
SCROLL_ARROW_THUMB_OVERLAP
))
<=
0
)
return
infoPtr
->
M
inVal
;
return
infoPtr
->
m
inVal
;
if
(
infoPtr
->
P
age
)
if
(
infoPtr
->
p
age
)
{
thumbSize
=
MulDiv
(
pixels
,
infoPtr
->
Page
,(
infoPtr
->
MaxVal
-
infoPtr
->
M
inVal
+
1
));
thumbSize
=
MulDiv
(
pixels
,
infoPtr
->
page
,(
infoPtr
->
maxVal
-
infoPtr
->
m
inVal
+
1
));
if
(
thumbSize
<
SCROLL_MIN_THUMB
)
thumbSize
=
SCROLL_MIN_THUMB
;
}
else
thumbSize
=
GetSystemMetrics
(
SM_CXVSCROLL
);
if
((
pixels
-=
thumbSize
)
<=
0
)
return
infoPtr
->
M
inVal
;
if
((
pixels
-=
thumbSize
)
<=
0
)
return
infoPtr
->
m
inVal
;
pos
=
max
(
0
,
pos
-
(
GetSystemMetrics
(
SM_CXVSCROLL
)
-
SCROLL_ARROW_THUMB_OVERLAP
)
);
if
(
pos
>
pixels
)
pos
=
pixels
;
if
(
!
infoPtr
->
Page
)
pos
*=
infoPtr
->
MaxVal
-
infoPtr
->
M
inVal
;
else
pos
*=
infoPtr
->
MaxVal
-
infoPtr
->
MinVal
-
infoPtr
->
P
age
+
1
;
return
infoPtr
->
M
inVal
+
((
pos
+
pixels
/
2
)
/
pixels
);
if
(
!
infoPtr
->
page
)
pos
*=
infoPtr
->
maxVal
-
infoPtr
->
m
inVal
;
else
pos
*=
infoPtr
->
maxVal
-
infoPtr
->
minVal
-
infoPtr
->
p
age
+
1
;
return
infoPtr
->
m
inVal
+
((
pos
+
pixels
/
2
)
/
pixels
);
}
/***********************************************************************
...
...
@@ -1475,9 +1475,9 @@ INT SCROLL_SetScrollInfo( HWND hwnd, INT nBar,
if
(
info
->
fMask
&
SIF_PAGE
)
{
if
(
infoPtr
->
P
age
!=
info
->
nPage
)
if
(
infoPtr
->
p
age
!=
info
->
nPage
)
{
infoPtr
->
P
age
=
info
->
nPage
;
infoPtr
->
p
age
=
info
->
nPage
;
*
action
|=
SA_SSI_REFRESH
;
bChangeParams
=
TRUE
;
}
...
...
@@ -1487,9 +1487,9 @@ INT SCROLL_SetScrollInfo( HWND hwnd, INT nBar,
if
(
info
->
fMask
&
SIF_POS
)
{
if
(
infoPtr
->
C
urVal
!=
info
->
nPos
)
if
(
infoPtr
->
c
urVal
!=
info
->
nPos
)
{
infoPtr
->
C
urVal
=
info
->
nPos
;
infoPtr
->
c
urVal
=
info
->
nPos
;
*
action
|=
SA_SSI_REFRESH
;
}
}
...
...
@@ -1502,18 +1502,18 @@ INT SCROLL_SetScrollInfo( HWND hwnd, INT nBar,
if
((
info
->
nMin
>
info
->
nMax
)
||
((
UINT
)(
info
->
nMax
-
info
->
nMin
)
>=
0x80000000
))
{
infoPtr
->
M
inVal
=
0
;
infoPtr
->
M
axVal
=
0
;
infoPtr
->
m
inVal
=
0
;
infoPtr
->
m
axVal
=
0
;
bChangeParams
=
TRUE
;
}
else
{
if
(
infoPtr
->
M
inVal
!=
info
->
nMin
||
infoPtr
->
M
axVal
!=
info
->
nMax
)
if
(
infoPtr
->
m
inVal
!=
info
->
nMin
||
infoPtr
->
m
axVal
!=
info
->
nMax
)
{
*
action
|=
SA_SSI_REFRESH
;
infoPtr
->
M
inVal
=
info
->
nMin
;
infoPtr
->
M
axVal
=
info
->
nMax
;
infoPtr
->
m
inVal
=
info
->
nMin
;
infoPtr
->
m
axVal
=
info
->
nMax
;
bChangeParams
=
TRUE
;
}
}
...
...
@@ -1521,20 +1521,20 @@ INT SCROLL_SetScrollInfo( HWND hwnd, INT nBar,
/* Make sure the page size is valid */
if
(
infoPtr
->
Page
<
0
)
infoPtr
->
P
age
=
0
;
else
if
(
infoPtr
->
Page
>
infoPtr
->
MaxVal
-
infoPtr
->
M
inVal
+
1
)
infoPtr
->
Page
=
infoPtr
->
MaxVal
-
infoPtr
->
M
inVal
+
1
;
if
(
infoPtr
->
page
<
0
)
infoPtr
->
p
age
=
0
;
else
if
(
infoPtr
->
page
>
infoPtr
->
maxVal
-
infoPtr
->
m
inVal
+
1
)
infoPtr
->
page
=
infoPtr
->
maxVal
-
infoPtr
->
m
inVal
+
1
;
/* Make sure the pos is inside the range */
if
(
infoPtr
->
CurVal
<
infoPtr
->
M
inVal
)
infoPtr
->
CurVal
=
infoPtr
->
M
inVal
;
else
if
(
infoPtr
->
CurVal
>
infoPtr
->
MaxVal
-
max
(
infoPtr
->
P
age
-
1
,
0
))
infoPtr
->
CurVal
=
infoPtr
->
MaxVal
-
max
(
infoPtr
->
P
age
-
1
,
0
);
if
(
infoPtr
->
curVal
<
infoPtr
->
m
inVal
)
infoPtr
->
curVal
=
infoPtr
->
m
inVal
;
else
if
(
infoPtr
->
curVal
>
infoPtr
->
maxVal
-
max
(
infoPtr
->
p
age
-
1
,
0
))
infoPtr
->
curVal
=
infoPtr
->
maxVal
-
max
(
infoPtr
->
p
age
-
1
,
0
);
TRACE
(
" new values: page=%d pos=%d min=%d max=%d
\n
"
,
infoPtr
->
Page
,
infoPtr
->
C
urVal
,
infoPtr
->
MinVal
,
infoPtr
->
M
axVal
);
infoPtr
->
page
,
infoPtr
->
c
urVal
,
infoPtr
->
minVal
,
infoPtr
->
m
axVal
);
/* don't change the scrollbar state if SetScrollInfo
* is just called with SIF_DISABLENOSCROLL
...
...
@@ -1546,7 +1546,7 @@ INT SCROLL_SetScrollInfo( HWND hwnd, INT nBar,
if
(
info
->
fMask
&
(
SIF_RANGE
|
SIF_PAGE
|
SIF_DISABLENOSCROLL
))
{
new_flags
=
infoPtr
->
flags
;
if
(
infoPtr
->
MinVal
>=
infoPtr
->
MaxVal
-
max
(
infoPtr
->
P
age
-
1
,
0
))
if
(
infoPtr
->
minVal
>=
infoPtr
->
maxVal
-
max
(
infoPtr
->
p
age
-
1
,
0
))
{
/* Hide or disable scroll-bar */
if
(
info
->
fMask
&
SIF_DISABLENOSCROLL
)
...
...
@@ -1577,7 +1577,7 @@ INT SCROLL_SetScrollInfo( HWND hwnd, INT nBar,
done:
/* Return current position */
return
infoPtr
->
C
urVal
;
return
infoPtr
->
c
urVal
;
}
...
...
@@ -1600,14 +1600,14 @@ BOOL WINAPI GetScrollInfo(
if
((
info
->
cbSize
!=
sizeof
(
*
info
))
&&
(
info
->
cbSize
!=
sizeof
(
*
info
)
-
sizeof
(
info
->
nTrackPos
)))
return
FALSE
;
if
(
info
->
fMask
&
SIF_PAGE
)
info
->
nPage
=
infoPtr
->
P
age
;
if
(
info
->
fMask
&
SIF_POS
)
info
->
nPos
=
infoPtr
->
C
urVal
;
if
(
info
->
fMask
&
SIF_PAGE
)
info
->
nPage
=
infoPtr
->
p
age
;
if
(
info
->
fMask
&
SIF_POS
)
info
->
nPos
=
infoPtr
->
c
urVal
;
if
((
info
->
fMask
&
SIF_TRACKPOS
)
&&
(
info
->
cbSize
==
sizeof
(
*
info
)))
info
->
nTrackPos
=
(
SCROLL_TrackingWin
==
WIN_GetFullHandle
(
hwnd
))
?
SCROLL_TrackingVal
:
infoPtr
->
C
urVal
;
info
->
nTrackPos
=
(
SCROLL_TrackingWin
==
WIN_GetFullHandle
(
hwnd
))
?
SCROLL_TrackingVal
:
infoPtr
->
c
urVal
;
if
(
info
->
fMask
&
SIF_RANGE
)
{
info
->
nMin
=
infoPtr
->
M
inVal
;
info
->
nMax
=
infoPtr
->
M
axVal
;
info
->
nMin
=
infoPtr
->
m
inVal
;
info
->
nMax
=
infoPtr
->
m
axVal
;
}
return
(
info
->
fMask
&
SIF_ALL
)
!=
0
;
}
...
...
@@ -1635,7 +1635,7 @@ BOOL bRedraw /* [in] Should scrollbar be redrawn afterwards ? */ )
INT
oldPos
;
if
(
!
(
infoPtr
=
SCROLL_GetScrollInfo
(
hwnd
,
nBar
)))
return
0
;
oldPos
=
infoPtr
->
C
urVal
;
oldPos
=
infoPtr
->
c
urVal
;
info
.
cbSize
=
sizeof
(
info
);
info
.
nPos
=
nPos
;
info
.
fMask
=
SIF_POS
;
...
...
@@ -1662,7 +1662,7 @@ INT nBar /* [in] One of SB_HORZ, SB_VERT, or SB_CTL */)
SCROLLBAR_INFO
*
infoPtr
;
if
(
!
(
infoPtr
=
SCROLL_GetScrollInfo
(
hwnd
,
nBar
)))
return
0
;
return
infoPtr
->
C
urVal
;
return
infoPtr
->
c
urVal
;
}
...
...
@@ -1674,15 +1674,15 @@ INT nBar /* [in] One of SB_HORZ, SB_VERT, or SB_CTL */)
BOOL
WINAPI
SetScrollRange
(
HWND
hwnd
,
/* [in] Handle of window whose scrollbar will be affected */
INT
nBar
,
/* [in] One of SB_HORZ, SB_VERT, or SB_CTL */
INT
M
inVal
,
/* [in] New minimum value */
INT
M
axVal
,
/* [in] New maximum value */
INT
m
inVal
,
/* [in] New minimum value */
INT
m
axVal
,
/* [in] New maximum value */
BOOL
bRedraw
/* [in] Should scrollbar be redrawn afterwards ? */
)
{
SCROLLINFO
info
;
info
.
cbSize
=
sizeof
(
info
);
info
.
nMin
=
M
inVal
;
info
.
nMax
=
M
axVal
;
info
.
nMin
=
m
inVal
;
info
.
nMax
=
m
axVal
;
info
.
fMask
=
SIF_RANGE
;
SetScrollInfo
(
hwnd
,
nBar
,
&
info
,
bRedraw
);
return
TRUE
;
...
...
@@ -1745,8 +1745,8 @@ LPINT lpMax /* [out] Where to store maximum value */)
if
(
lpMax
)
lpMax
=
0
;
return
FALSE
;
}
if
(
lpMin
)
*
lpMin
=
infoPtr
->
M
inVal
;
if
(
lpMax
)
*
lpMax
=
infoPtr
->
M
axVal
;
if
(
lpMin
)
*
lpMin
=
infoPtr
->
m
inVal
;
if
(
lpMax
)
*
lpMax
=
infoPtr
->
m
axVal
;
return
TRUE
;
}
...
...
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