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
1f7d6ccc
Commit
1f7d6ccc
authored
Apr 16, 2005
by
Duane Clark
Committed by
Alexandre Julliard
Apr 16, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for direct keyboard input to numeric fields.
parent
759e1707
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
79 additions
and
1 deletion
+79
-1
datetime.c
dlls/comctl32/datetime.c
+79
-1
No files found.
dlls/comctl32/datetime.c
View file @
1f7d6ccc
...
...
@@ -266,6 +266,7 @@ DATETIME_SetFormatW (DATETIME_INFO *infoPtr, LPCWSTR lpszFormat)
}
DATETIME_UseFormat
(
infoPtr
,
lpszFormat
);
InvalidateRect
(
infoPtr
->
hwndSelf
,
NULL
,
TRUE
);
return
infoPtr
->
nrFields
;
}
...
...
@@ -865,6 +866,83 @@ DATETIME_KeyDown (DATETIME_INFO *infoPtr, DWORD vkCode, LPARAM flags)
FIXME
(
"Callbacks not implemented yet
\n
"
);
}
if
(
vkCode
>=
'0'
&&
vkCode
<=
'9'
)
{
/* this is a somewhat simplified version of what Windows does */
SYSTEMTIME
*
date
=
&
infoPtr
->
date
;
switch
(
infoPtr
->
fieldspec
[
fieldNum
])
{
case
ONEDIGITYEAR
:
case
TWODIGITYEAR
:
date
->
wYear
=
date
->
wYear
-
(
date
->
wYear
%
100
)
+
(
date
->
wYear
%
10
)
*
10
+
(
vkCode
-
'0'
);
date
->
wDayOfWeek
=
DATETIME_CalculateDayOfWeek
(
date
->
wDay
,
date
->
wMonth
,
date
->
wYear
);
DATETIME_SendDateTimeChangeNotify
(
infoPtr
);
break
;
case
INVALIDFULLYEAR
:
case
FULLYEAR
:
date
->
wYear
=
(
date
->
wYear
%
1000
)
*
10
+
(
vkCode
-
'0'
);
date
->
wDayOfWeek
=
DATETIME_CalculateDayOfWeek
(
date
->
wDay
,
date
->
wMonth
,
date
->
wYear
);
DATETIME_SendDateTimeChangeNotify
(
infoPtr
);
break
;
case
ONEDIGITMONTH
:
case
TWODIGITMONTH
:
if
((
date
->
wMonth
%
10
)
>
1
||
(
vkCode
-
'0'
)
>
2
)
date
->
wMonth
=
vkCode
-
'0'
;
else
date
->
wMonth
=
(
date
->
wMonth
%
10
)
*
10
+
vkCode
-
'0'
;
date
->
wDayOfWeek
=
DATETIME_CalculateDayOfWeek
(
date
->
wDay
,
date
->
wMonth
,
date
->
wYear
);
DATETIME_SendDateTimeChangeNotify
(
infoPtr
);
break
;
case
ONEDIGITDAY
:
case
TWODIGITDAY
:
/* probably better checking here would help */
if
((
date
->
wDay
%
10
)
>=
3
&&
(
vkCode
-
'0'
)
>
1
)
date
->
wDay
=
vkCode
-
'0'
;
else
date
->
wDay
=
(
date
->
wDay
%
10
)
*
10
+
vkCode
-
'0'
;
date
->
wDayOfWeek
=
DATETIME_CalculateDayOfWeek
(
date
->
wDay
,
date
->
wMonth
,
date
->
wYear
);
DATETIME_SendDateTimeChangeNotify
(
infoPtr
);
break
;
case
ONEDIGIT12HOUR
:
case
TWODIGIT12HOUR
:
if
((
date
->
wHour
%
10
)
>
1
||
(
vkCode
-
'0'
)
>
2
)
date
->
wHour
=
vkCode
-
'0'
;
else
date
->
wHour
=
(
date
->
wHour
%
10
)
*
10
+
vkCode
-
'0'
;
DATETIME_SendDateTimeChangeNotify
(
infoPtr
);
break
;
case
ONEDIGIT24HOUR
:
case
TWODIGIT24HOUR
:
if
((
date
->
wHour
%
10
)
>
2
)
date
->
wHour
=
vkCode
-
'0'
;
else
if
((
date
->
wHour
%
10
)
==
2
&&
(
vkCode
-
'0'
)
>
3
)
date
->
wHour
=
vkCode
-
'0'
;
else
date
->
wHour
=
(
date
->
wHour
%
10
)
*
10
+
vkCode
-
'0'
;
DATETIME_SendDateTimeChangeNotify
(
infoPtr
);
break
;
case
ONEDIGITMINUTE
:
case
TWODIGITMINUTE
:
if
((
date
->
wMinute
%
10
)
>
5
)
date
->
wMinute
=
vkCode
-
'0'
;
else
date
->
wMinute
=
(
date
->
wMinute
%
10
)
*
10
+
vkCode
-
'0'
;
DATETIME_SendDateTimeChangeNotify
(
infoPtr
);
break
;
case
ONEDIGITSECOND
:
case
TWODIGITSECOND
:
if
((
date
->
wSecond
%
10
)
>
5
)
date
->
wSecond
=
vkCode
-
'0'
;
else
date
->
wSecond
=
(
date
->
wSecond
%
10
)
*
10
+
vkCode
-
'0'
;
DATETIME_SendDateTimeChangeNotify
(
infoPtr
);
break
;
}
}
switch
(
vkCode
)
{
case
VK_ADD
:
case
VK_UP
:
...
...
@@ -905,7 +983,7 @@ DATETIME_KeyDown (DATETIME_INFO *infoPtr, DWORD vkCode, LPARAM flags)
break
;
}
InvalidateRect
(
infoPtr
->
hwndSelf
,
NULL
,
FALS
E
);
InvalidateRect
(
infoPtr
->
hwndSelf
,
NULL
,
TRU
E
);
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