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
2a348791
Commit
2a348791
authored
Jun 08, 2014
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jun 11, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/progress: Update position by one step on PBM_SETPOS in PBS_MARQUEE style.
parent
c69a7ecf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
38 deletions
+47
-38
progress.c
dlls/comctl32/progress.c
+47
-38
No files found.
dlls/comctl32/progress.c
View file @
2a348791
...
...
@@ -448,38 +448,32 @@ static LRESULT PROGRESS_Paint (PROGRESS_INFO *infoPtr, HDC hdc)
/***********************************************************************
* PROGRESS_Timer
* Handle the marquee timer messages
* Advance marquee progress by one step.
*/
static
LRESULT
PROGRESS_Timer
(
PROGRESS_INFO
*
infoPtr
,
INT
idTime
r
)
static
void
PROGRESS_UpdateMarquee
(
PROGRESS_INFO
*
infoPt
r
)
{
if
(
idTimer
==
ID_MARQUEE_TIMER
)
{
LONG
style
=
GetWindowLongW
(
infoPtr
->
Self
,
GWL_STYLE
);
RECT
rect
;
int
ledWidth
,
leds
;
HTHEME
theme
=
GetWindowTheme
(
infoPtr
->
Self
);
BOOL
barSmooth
=
(
style
&
PBS_SMOOTH
)
&&
!
theme
;
LONG
style
=
GetWindowLongW
(
infoPtr
->
Self
,
GWL_STYLE
);
RECT
rect
;
int
ledWidth
,
leds
;
HTHEME
theme
=
GetWindowTheme
(
infoPtr
->
Self
);
BOOL
smooth
=
(
style
&
PBS_SMOOTH
)
&&
!
theme
;
get_client_rect
(
infoPtr
->
Self
,
&
rect
);
get_client_rect
(
infoPtr
->
Self
,
&
rect
);
if
(
!
barSmooth
)
ledWidth
=
get_led_size
(
infoPtr
,
style
,
&
rect
)
+
get_led_gap
(
infoPtr
);
else
ledWidth
=
1
;
if
(
smooth
)
ledWidth
=
1
;
else
ledWidth
=
get_led_size
(
infoPtr
,
style
,
&
rect
)
+
get_led_gap
(
infoPtr
);
leds
=
(
get_bar_size
(
style
,
&
rect
)
+
ledWidth
-
1
)
/
ledWidth
;
leds
=
(
get_bar_size
(
style
,
&
rect
)
+
ledWidth
-
1
)
/
ledWidth
;
/* increment the marquee progress */
if
(
++
infoPtr
->
MarqueePos
>=
leds
)
infoPtr
->
MarqueePos
=
0
;
/* increment the marquee progress */
if
(
++
infoPtr
->
MarqueePos
>=
leds
)
infoPtr
->
MarqueePos
=
0
;
InvalidateRect
(
infoPtr
->
Self
,
&
rect
,
TRUE
);
UpdateWindow
(
infoPtr
->
Self
);
}
return
0
;
InvalidateRect
(
infoPtr
->
Self
,
&
rect
,
TRUE
);
UpdateWindow
(
infoPtr
->
Self
);
}
...
...
@@ -522,6 +516,30 @@ static DWORD PROGRESS_SetRange (PROGRESS_INFO *infoPtr, int low, int high)
return
res
;
}
static
UINT
PROGRESS_SetPos
(
PROGRESS_INFO
*
infoPtr
,
INT
pos
)
{
DWORD
style
=
GetWindowLongW
(
infoPtr
->
Self
,
GWL_STYLE
);
if
(
style
&
PBS_MARQUEE
)
{
PROGRESS_UpdateMarquee
(
infoPtr
);
return
1
;
}
else
{
UINT
oldVal
;
oldVal
=
infoPtr
->
CurVal
;
if
(
oldVal
!=
pos
)
{
infoPtr
->
CurVal
=
pos
;
PROGRESS_CoercePos
(
infoPtr
);
TRACE
(
"PBM_SETPOS: current pos changed from %d to %d
\n
"
,
oldVal
,
infoPtr
->
CurVal
);
PROGRESS_Invalidate
(
infoPtr
,
oldVal
,
infoPtr
->
CurVal
);
UpdateWindow
(
infoPtr
->
Self
);
}
return
oldVal
;
}
}
/***********************************************************************
* ProgressWindowProc
*/
...
...
@@ -596,7 +614,9 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message,
return
PROGRESS_Paint
(
infoPtr
,
(
HDC
)
wParam
);
case
WM_TIMER
:
return
PROGRESS_Timer
(
infoPtr
,
(
INT
)
wParam
);
if
(
wParam
==
ID_MARQUEE_TIMER
)
PROGRESS_UpdateMarquee
(
infoPtr
);
return
0
;
case
WM_THEMECHANGED
:
{
...
...
@@ -632,18 +652,7 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message,
}
case
PBM_SETPOS
:
{
UINT
oldVal
;
oldVal
=
infoPtr
->
CurVal
;
if
(
oldVal
!=
wParam
)
{
infoPtr
->
CurVal
=
(
INT
)
wParam
;
PROGRESS_CoercePos
(
infoPtr
);
TRACE
(
"PBM_SETPOS: current pos changed from %d to %d
\n
"
,
oldVal
,
infoPtr
->
CurVal
);
PROGRESS_Invalidate
(
infoPtr
,
oldVal
,
infoPtr
->
CurVal
);
UpdateWindow
(
infoPtr
->
Self
);
}
return
oldVal
;
}
return
PROGRESS_SetPos
(
infoPtr
,
wParam
);
case
PBM_SETRANGE
:
return
PROGRESS_SetRange
(
infoPtr
,
(
int
)
LOWORD
(
lParam
),
(
int
)
HIWORD
(
lParam
));
...
...
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