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
89e2766f
Commit
89e2766f
authored
May 13, 2003
by
Huw Davies
Committed by
Alexandre Julliard
May 13, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix DTM_SETSYSTEMTIME.
Make the show/hide button actually do something. Add support for the 'yyyy' format.
parent
18ae9b3d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
10 deletions
+57
-10
datetime.c
dlls/comctl32/datetime.c
+57
-10
No files found.
dlls/comctl32/datetime.c
View file @
89e2766f
...
...
@@ -91,7 +91,8 @@ extern int MONTHCAL_MonthLength(int month, int year);
#define TWOLETTERAMPM 0x62
#define ONEDIGITYEAR 0x71
#define TWODIGITYEAR 0x72
#define FULLYEAR 0x73
#define INVALIDFULLYEAR 0x73
/* FIXME - yyy is not valid - we'll treat it as yyyy */
#define FULLYEAR 0x74
#define FORMATCALLBACK 0x81
/* -> maximum of 0x80 callbacks possible */
#define FORMATCALLMASK 0x80
#define DT_STRING 0x0100
...
...
@@ -109,7 +110,7 @@ static BOOL DATETIME_SendSimpleNotify (HWND hwnd, UINT code);
static
BOOL
DATETIME_SendDateTimeChangeNotify
(
HWND
hwnd
);
extern
void
MONTHCAL_CopyTime
(
const
SYSTEMTIME
*
from
,
SYSTEMTIME
*
to
);
static
const
char
*
allowedformatchars
=
{
"dhHmMstyX'"
};
static
const
int
maxrepetition
[]
=
{
4
,
2
,
2
,
2
,
4
,
2
,
2
,
3
,
-
1
,
-
1
};
static
const
int
maxrepetition
[]
=
{
4
,
2
,
2
,
2
,
4
,
2
,
2
,
4
,
-
1
,
-
1
};
static
LRESULT
...
...
@@ -123,7 +124,7 @@ DATETIME_GetSystemTime (HWND hwnd, WPARAM wParam, LPARAM lParam )
if
(
!
lParam
)
return
GDT_NONE
;
if
((
dwStyle
&
DTS_SHOWNONE
)
&&
(
SendMessageA
(
infoPtr
->
hwndCheckbut
,
BM_GETCHECK
,
0
,
0
)))
(
SendMessageA
(
infoPtr
->
hwndCheckbut
,
BM_GETCHECK
,
0
,
0
)
==
BST_UNCHECKED
))
return
GDT_NONE
;
MONTHCAL_CopyTime
(
&
infoPtr
->
date
,
lprgSysTimeArray
);
...
...
@@ -138,15 +139,22 @@ DATETIME_SetSystemTime (HWND hwnd, WPARAM wParam, LPARAM lParam )
DATETIME_INFO
*
infoPtr
=
DATETIME_GetInfoPtr
(
hwnd
);
SYSTEMTIME
*
lprgSysTimeArray
=
(
SYSTEMTIME
*
)
lParam
;
TRACE
(
"%
04x %08lx
\n
"
,
wParam
,
lParam
);
TRACE
(
"%
p %04x %08lx
\n
"
,
hwnd
,
wParam
,
lParam
);
if
(
!
lParam
)
return
0
;
if
(
lParam
==
GDT_VALID
)
MONTHCAL_CopyTime
(
lprgSysTimeArray
,
&
infoPtr
->
date
);
if
(
lParam
==
GDT_NONE
)
{
infoPtr
->
dateValid
=
FALSE
;
SendMessageA
(
infoPtr
->
hwndCheckbut
,
BM_SETCHECK
,
0
,
0
);
}
TRACE
(
"%04d/%02d/%02d %02d:%02d:%02d)
\n
"
,
lprgSysTimeArray
->
wYear
,
lprgSysTimeArray
->
wMonth
,
lprgSysTimeArray
->
wDay
,
lprgSysTimeArray
->
wHour
,
lprgSysTimeArray
->
wMinute
,
lprgSysTimeArray
->
wSecond
);
if
(
wParam
==
GDT_VALID
)
{
infoPtr
->
dateValid
=
TRUE
;
MONTHCAL_CopyTime
(
lprgSysTimeArray
,
&
infoPtr
->
date
);
SendMessageA
(
infoPtr
->
hwndCheckbut
,
BM_SETCHECK
,
BST_CHECKED
,
0
);
}
else
if
(
wParam
==
GDT_NONE
)
{
infoPtr
->
dateValid
=
FALSE
;
SendMessageA
(
infoPtr
->
hwndCheckbut
,
BM_SETCHECK
,
BST_UNCHECKED
,
0
);
}
InvalidateRect
(
hwnd
,
NULL
,
TRUE
);
return
1
;
}
...
...
@@ -470,6 +478,7 @@ DATETIME_ReturnTxt (DATETIME_INFO *infoPtr, int count, char *result, int resultS
case
TWODIGITYEAR
:
sprintf
(
result
,
"%.2d"
,
date
.
wYear
-
100
*
(
int
)
floor
(
date
.
wYear
/
100
));
break
;
case
INVALIDFULLYEAR
:
case
FULLYEAR
:
sprintf
(
result
,
"%d"
,
date
.
wYear
);
break
;
...
...
@@ -926,6 +935,41 @@ DATETIME_Paint (HWND hwnd, WPARAM wParam)
static
LRESULT
DATETIME_Button_Command
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
DATETIME_INFO
*
infoPtr
=
DATETIME_GetInfoPtr
(
hwnd
);
switch
(
HIWORD
(
wParam
))
{
case
BN_CLICKED
:
{
DWORD
state
=
SendMessageA
((
HWND
)
lParam
,
BM_GETCHECK
,
0
,
0
);
if
(
state
==
BST_CHECKED
)
infoPtr
->
dateValid
=
TRUE
;
else
infoPtr
->
dateValid
=
FALSE
;
InvalidateRect
(
hwnd
,
NULL
,
TRUE
);
return
0
;
}
default:
return
0
;
}
}
static
LRESULT
DATETIME_Command
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
DATETIME_INFO
*
infoPtr
=
DATETIME_GetInfoPtr
(
hwnd
);
TRACE
(
"%08x %08lx
\n
"
,
wParam
,
lParam
);
TRACE
(
"hwndbutton = %p
\n
"
,
infoPtr
->
hwndCheckbut
);
if
(
infoPtr
->
hwndCheckbut
==
(
HWND
)
lParam
)
return
DATETIME_Button_Command
(
hwnd
,
wParam
,
lParam
);
return
0
;
}
static
LRESULT
DATETIME_ParentNotify
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
DATETIME_INFO
*
infoPtr
=
DATETIME_GetInfoPtr
(
hwnd
);
...
...
@@ -1284,6 +1328,9 @@ DATETIME_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case
WM_DESTROY
:
return
DATETIME_Destroy
(
hwnd
,
wParam
,
lParam
);
case
WM_COMMAND
:
return
DATETIME_Command
(
hwnd
,
wParam
,
lParam
);
default:
if
((
uMsg
>=
WM_USER
)
&&
(
uMsg
<
WM_APP
))
ERR
(
"unknown msg %04x wp=%08x lp=%08lx
\n
"
,
...
...
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