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
70eb6c03
Commit
70eb6c03
authored
Oct 06, 2009
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 07, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/monthcal: Use a single timer for auto month scroll with prev/next buttons.
parent
06f26f53
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
29 deletions
+14
-29
monthcal.c
dlls/comctl32/monthcal.c
+14
-29
No files found.
dlls/comctl32/monthcal.c
View file @
70eb6c03
...
...
@@ -66,8 +66,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(monthcal);
#define MC_NEXTMONTHDELAY 350
/* when continuously pressing `next */
/* month', wait 500 ms before going */
/* to the next month */
#define MC_NEXTMONTHTIMER 1
/* Timer ID's */
#define MC_PREVMONTHTIMER 2
#define MC_PREVNEXTMONTHTIMER 1
/* Timer ID's */
#define countof(arr) (sizeof(arr)/sizeof(arr[0]))
...
...
@@ -1679,14 +1678,14 @@ MONTHCAL_LButtonDown(MONTHCAL_INFO *infoPtr, LPARAM lParam)
case
MCHT_TITLEBTNNEXT
:
MONTHCAL_GoToNextMonth
(
infoPtr
);
infoPtr
->
status
=
MC_NEXTPRESSED
;
SetTimer
(
infoPtr
->
hwndSelf
,
MC_NEXTMONTHTIMER
,
MC_NEXTMONTHDELAY
,
0
);
SetTimer
(
infoPtr
->
hwndSelf
,
MC_
PREV
NEXTMONTHTIMER
,
MC_NEXTMONTHDELAY
,
0
);
InvalidateRect
(
infoPtr
->
hwndSelf
,
NULL
,
FALSE
);
return
0
;
case
MCHT_TITLEBTNPREV
:
MONTHCAL_GoToPrevMonth
(
infoPtr
);
infoPtr
->
status
=
MC_PREVPRESSED
;
SetTimer
(
infoPtr
->
hwndSelf
,
MC_PREVMONTHTIMER
,
MC_NEXTMONTHDELAY
,
0
);
SetTimer
(
infoPtr
->
hwndSelf
,
MC_PREV
NEXT
MONTHTIMER
,
MC_NEXTMONTHDELAY
,
0
);
InvalidateRect
(
infoPtr
->
hwndSelf
,
NULL
,
FALSE
);
return
0
;
...
...
@@ -1767,14 +1766,9 @@ MONTHCAL_LButtonUp(MONTHCAL_INFO *infoPtr, LPARAM lParam)
TRACE
(
"
\n
"
);
if
(
infoPtr
->
status
&
MC_NEXTPRESSED
)
{
KillTimer
(
infoPtr
->
hwndSelf
,
MC_NEXTMONTHTIMER
);
infoPtr
->
status
&=
~
MC_NEXTPRESSED
;
redraw
=
TRUE
;
}
if
(
infoPtr
->
status
&
MC_PREVPRESSED
)
{
KillTimer
(
infoPtr
->
hwndSelf
,
MC_PREVMONTHTIMER
);
infoPtr
->
status
&=
~
MC_PREVPRESSED
;
if
(
infoPtr
->
status
&
(
MC_PREVPRESSED
|
MC_NEXTPRESSED
))
{
KillTimer
(
infoPtr
->
hwndSelf
,
MC_PREVNEXTMONTHTIMER
);
infoPtr
->
status
&=
~
(
MC_PREVPRESSED
|
MC_NEXTPRESSED
);
redraw
=
TRUE
;
}
...
...
@@ -1830,30 +1824,21 @@ MONTHCAL_LButtonUp(MONTHCAL_INFO *infoPtr, LPARAM lParam)
static
LRESULT
MONTHCAL_Timer
(
MONTHCAL_INFO
*
infoPtr
,
WPARAM
wParam
)
MONTHCAL_Timer
(
MONTHCAL_INFO
*
infoPtr
,
WPARAM
id
)
{
BOOL
redraw
=
FALSE
;
TRACE
(
"%ld
\n
"
,
wParam
);
TRACE
(
"%ld
\n
"
,
id
);
switch
(
wParam
)
{
case
MC_NEXTMONTHTIMER
:
redraw
=
TRUE
;
MONTHCAL_GoToNextMonth
(
infoPtr
);
break
;
case
MC_PREVMONTHTIMER
:
redraw
=
TRUE
;
MONTHCAL_GoToPrevMonth
(
infoPtr
);
switch
(
id
)
{
case
MC_PREVNEXTMONTHTIMER
:
if
(
infoPtr
->
status
&
MC_NEXTPRESSED
)
MONTHCAL_GoToNextMonth
(
infoPtr
);
if
(
infoPtr
->
status
&
MC_PREVPRESSED
)
MONTHCAL_GoToPrevMonth
(
infoPtr
);
InvalidateRect
(
infoPtr
->
hwndSelf
,
NULL
,
FALSE
);
break
;
default:
ERR
(
"got unknown timer
\n
"
);
ERR
(
"got unknown timer
%ld
\n
"
,
id
);
break
;
}
/* redraw only if necessary */
if
(
redraw
)
InvalidateRect
(
infoPtr
->
hwndSelf
,
NULL
,
FALSE
);
return
0
;
}
...
...
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