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
c8cc3258
Commit
c8cc3258
authored
Jul 31, 1999
by
Alex Priem
Committed by
Alexandre Julliard
Jul 31, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Started implementing date/time common control.
parent
79e94a74
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
587 additions
and
34 deletions
+587
-34
datetime.c
dlls/comctl32/datetime.c
+403
-24
commctrl.h
include/commctrl.h
+160
-6
datetime.h
include/datetime.h
+24
-4
No files found.
dlls/comctl32/datetime.c
View file @
c8cc3258
...
...
@@ -2,11 +2,8 @@
* Date and time picker control
*
* Copyright 1998, 1999 Eric Kohl
* Copyright 1999 Alex Priem <alexp@sci.kun.nl>
*
* NOTES
* This is just a dummy control. An author is needed! Any volunteers?
* I will only improve this control once in a while.
* Eric <ekohl@abo.rhein-zeitung.de>
*
* TODO:
* - All messages.
...
...
@@ -17,12 +14,364 @@
#include "winbase.h"
#include "commctrl.h"
#include "datetime.h"
#include "monthcal.h"
#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL
(
datetime
)
#define DATETIME_GetInfoPtr(hwnd) ((DATETIME_INFO *)GetWindowLongA (hwnd, 0))
static
BOOL
DATETIME_SendSimpleNotify
(
HWND
hwnd
,
UINT
code
);
extern
char
*
days
[];
/* from ole/parsedt.c */
static
LRESULT
DATETIME_GetSystemTime
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
DATETIME_INFO
*
infoPtr
=
DATETIME_GetInfoPtr
(
hwnd
);
DWORD
dwStyle
=
GetWindowLongA
(
hwnd
,
GWL_STYLE
);
SYSTEMTIME
*
lprgSysTimeArray
=
(
SYSTEMTIME
*
)
lParam
;
if
(
!
lParam
)
return
GDT_NONE
;
if
((
dwStyle
&
DTS_SHOWNONE
)
&&
(
SendMessageA
(
infoPtr
->
hwndCheckbut
,
BM_GETCHECK
,
0
,
0
)))
return
GDT_NONE
;
MONTHCAL_CopyTime
(
&
infoPtr
->
date
,
lprgSysTimeArray
);
return
GDT_VALID
;
}
static
LRESULT
DATETIME_SetSystemTime
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
DATETIME_INFO
*
infoPtr
=
DATETIME_GetInfoPtr
(
hwnd
);
SYSTEMTIME
*
lprgSysTimeArray
=
(
SYSTEMTIME
*
)
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
);
}
return
1
;
}
static
LRESULT
DATETIME_GetMonthCalColor
(
HWND
hwnd
,
WPARAM
wParam
)
{
DATETIME_INFO
*
infoPtr
=
DATETIME_GetInfoPtr
(
hwnd
);
return
SendMessageA
(
infoPtr
->
hMonthCal
,
MCM_GETCOLOR
,
wParam
,
0
);
}
static
LRESULT
DATETIME_SetMonthCalColor
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
DATETIME_INFO
*
infoPtr
=
DATETIME_GetInfoPtr
(
hwnd
);
return
SendMessageA
(
infoPtr
->
hMonthCal
,
MCM_SETCOLOR
,
wParam
,
lParam
);
}
/* FIXME: need to get way to force font into monthcal structure */
static
LRESULT
DATETIME_GetMonthCal
(
HWND
hwnd
)
{
DATETIME_INFO
*
infoPtr
=
DATETIME_GetInfoPtr
(
hwnd
);
return
infoPtr
->
hMonthCal
;
}
/* FIXME: need to get way to force font into monthcal structure */
static
LRESULT
DATETIME_GetMonthCalFont
(
HWND
hwnd
)
{
return
0
;
}
static
LRESULT
DATETIME_SetMonthCalFont
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
return
0
;
}
static
void
DATETIME_Refresh
(
HWND
hwnd
,
HDC
hdc
)
{
DATETIME_INFO
*
infoPtr
=
DATETIME_GetInfoPtr
(
hwnd
);
RECT
*
daytxt
=
&
infoPtr
->
daytxt
;
RECT
*
daynumtxt
=
&
infoPtr
->
daynumtxt
;
RECT
*
rmonthtxt
=
&
infoPtr
->
rmonthtxt
;
RECT
*
yeartxt
=
&
infoPtr
->
yeartxt
;
RECT
*
calbutton
=
&
infoPtr
->
calbutton
;
RECT
*
checkbox
=
&
infoPtr
->
checkbox
;
RECT
*
rect
=
&
infoPtr
->
rect
;
DWORD
dwStyle
=
GetWindowLongA
(
hwnd
,
GWL_STYLE
);
SYSTEMTIME
date
=
infoPtr
->
date
;
SIZE
size
;
BOOL
prssed
=
FALSE
;
COLORREF
oldBk
;
if
(
infoPtr
->
dateValid
)
{
char
txt
[
80
];
HFONT
oldFont
;
oldFont
=
SelectObject
(
hdc
,
infoPtr
->
hFont
);
GetClientRect
(
hwnd
,
rect
);
sprintf
(
txt
,
"%s,"
,
days
[
date
.
wDayOfWeek
]);
GetTextExtentPoint32A
(
hdc
,
txt
,
strlen
(
txt
),
&
size
);
rect
->
bottom
=
size
.
cy
+
2
;
checkbox
->
left
=
0
;
checkbox
->
right
=
0
;
checkbox
->
top
=
rect
->
top
;
checkbox
->
bottom
=
rect
->
bottom
;
if
(
dwStyle
&
DTS_SHOWNONE
)
{
/* FIXME: draw checkbox */
checkbox
->
right
=
18
;
}
if
(
infoPtr
->
select
==
(
DTHT_DAY
|
DTHT_GOTFOCUS
))
oldBk
=
SetBkColor
(
hdc
,
COLOR_GRAYTEXT
);
daytxt
->
left
=
checkbox
->
right
;
daytxt
->
right
=
checkbox
->
right
+
size
.
cx
;
daytxt
->
top
=
rect
->
top
;
daytxt
->
bottom
=
rect
->
bottom
;
DrawTextA
(
hdc
,
txt
,
strlen
(
txt
),
daytxt
,
DT_LEFT
|
DT_VCENTER
|
DT_SINGLELINE
);
if
(
infoPtr
->
select
==
(
DTHT_DAY
|
DTHT_GOTFOCUS
))
SetBkColor
(
hdc
,
oldBk
);
if
(
infoPtr
->
select
==
(
DTHT_MONTH
|
DTHT_GOTFOCUS
))
oldBk
=
SetBkColor
(
hdc
,
COLOR_GRAYTEXT
);
strcpy
(
txt
,
monthtxt
[
date
.
wMonth
]);
GetTextExtentPoint32A
(
hdc
,
"September"
,
9
,
&
size
);
rmonthtxt
->
left
=
daytxt
->
right
;
rmonthtxt
->
right
=
daytxt
->
right
+
size
.
cx
;
rmonthtxt
->
top
=
rect
->
top
;
rmonthtxt
->
bottom
=
rect
->
bottom
;
DrawTextA
(
hdc
,
txt
,
strlen
(
txt
),
rmonthtxt
,
DT_CENTER
|
DT_VCENTER
|
DT_SINGLELINE
);
if
(
infoPtr
->
select
==
(
DTHT_MONTH
|
DTHT_GOTFOCUS
))
SetBkColor
(
hdc
,
oldBk
);
if
(
infoPtr
->
select
==
(
DTHT_DAYNUM
|
DTHT_GOTFOCUS
))
oldBk
=
SetBkColor
(
hdc
,
COLOR_GRAYTEXT
);
sprintf
(
txt
,
"%d,"
,
date
.
wDay
);
GetTextExtentPoint32A
(
hdc
,
"31,"
,
3
,
&
size
);
daynumtxt
->
left
=
rmonthtxt
->
right
;
daynumtxt
->
right
=
rmonthtxt
->
right
+
size
.
cx
;
daynumtxt
->
top
=
rect
->
top
;
daynumtxt
->
bottom
=
rect
->
bottom
;
DrawTextA
(
hdc
,
txt
,
strlen
(
txt
),
daynumtxt
,
DT_RIGHT
|
DT_VCENTER
|
DT_SINGLELINE
);
if
(
infoPtr
->
select
==
(
DTHT_DAYNUM
|
DTHT_GOTFOCUS
))
SetBkColor
(
hdc
,
oldBk
);
if
(
infoPtr
->
select
==
(
DTHT_YEAR
|
DTHT_GOTFOCUS
))
oldBk
=
SetBkColor
(
hdc
,
COLOR_GRAYTEXT
);
sprintf
(
txt
,
"%d"
,
date
.
wYear
);
GetTextExtentPoint32A
(
hdc
,
"2000"
,
5
,
&
size
);
yeartxt
->
left
=
daynumtxt
->
right
;
yeartxt
->
right
=
daynumtxt
->
right
+
size
.
cx
;
yeartxt
->
top
=
rect
->
top
;
yeartxt
->
bottom
=
rect
->
bottom
;
DrawTextA
(
hdc
,
txt
,
strlen
(
txt
),
yeartxt
,
DT_RIGHT
|
DT_VCENTER
|
DT_SINGLELINE
);
if
(
infoPtr
->
select
==
(
DTHT_YEAR
|
DTHT_GOTFOCUS
))
SetBkColor
(
hdc
,
oldBk
);
SelectObject
(
hdc
,
oldFont
);
}
if
(
!
(
dwStyle
&
DTS_UPDOWN
))
{
calbutton
->
right
=
rect
->
right
;
calbutton
->
left
=
rect
->
right
-
15
;
calbutton
->
top
=
rect
->
top
;
calbutton
->
bottom
=
rect
->
bottom
;
DrawFrameControl
(
hdc
,
calbutton
,
DFC_SCROLL
,
DFCS_SCROLLDOWN
|
(
prssed
?
DFCS_PUSHED
:
0
)
|
(
dwStyle
&
WS_DISABLED
?
DFCS_INACTIVE
:
0
)
);
}
}
static
LRESULT
DATETIME_HitTest
(
HWND
hwnd
,
DATETIME_INFO
*
infoPtr
,
POINT
pt
)
{
TRACE
(
"%ld, %ld
\n
"
,
pt
.
x
,
pt
.
y
);
if
(
PtInRect
(
&
infoPtr
->
calbutton
,
pt
))
return
DTHT_MCPOPUP
;
if
(
PtInRect
(
&
infoPtr
->
yeartxt
,
pt
))
return
DTHT_YEAR
;
if
(
PtInRect
(
&
infoPtr
->
daynumtxt
,
pt
))
return
DTHT_DAYNUM
;
if
(
PtInRect
(
&
infoPtr
->
rmonthtxt
,
pt
))
return
DTHT_MONTH
;
if
(
PtInRect
(
&
infoPtr
->
daytxt
,
pt
))
return
DTHT_DAY
;
if
(
PtInRect
(
&
infoPtr
->
checkbox
,
pt
))
return
DTHT_CHECKBOX
;
return
0
;
}
static
LRESULT
DATETIME_LButtonDown
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
DATETIME_INFO
*
infoPtr
=
DATETIME_GetInfoPtr
(
hwnd
);
POINT
pt
;
int
old
;
TRACE
(
"
\n
"
);
old
=
infoPtr
->
select
;
pt
.
x
=
(
INT
)
LOWORD
(
lParam
);
pt
.
y
=
(
INT
)
HIWORD
(
lParam
);
infoPtr
->
select
=
DATETIME_HitTest
(
hwnd
,
infoPtr
,
pt
);
if
(
infoPtr
->
select
!=
old
)
{
HDC
hdc
;
SetFocus
(
hwnd
);
hdc
=
GetDC
(
hwnd
);
DATETIME_Refresh
(
hwnd
,
hdc
);
ReleaseDC
(
hwnd
,
hdc
);
}
if
(
infoPtr
->
select
==
DTHT_MCPOPUP
)
{
POINT
pt
;
pt
.
x
=
8
;
pt
.
y
=
infoPtr
->
rect
.
bottom
+
5
;
ClientToScreen
(
hwnd
,
&
pt
);
infoPtr
->
hMonthCal
=
CreateWindowExA
(
0
,
"SysMonthCal32"
,
0
,
WS_POPUP
|
WS_BORDER
,
pt
.
x
,
pt
.
y
,
145
,
150
,
GetParent
(
hwnd
),
0
,
0
,
0
);
TRACE
(
"dt:%x mc:%x mc parent:%x, desktop:%x, mcpp:%x
\n
"
,
hwnd
,
infoPtr
->
hMonthCal
,
GetParent
(
infoPtr
->
hMonthCal
),
GetDesktopWindow
(),
GetParent
(
GetParent
(
infoPtr
->
hMonthCal
)));
SetFocus
(
hwnd
);
DATETIME_SendSimpleNotify
(
hwnd
,
DTN_DROPDOWN
);
}
return
0
;
}
static
LRESULT
DATETIME_Paint
(
HWND
hwnd
,
WPARAM
wParam
)
{
HDC
hdc
;
PAINTSTRUCT
ps
;
hdc
=
wParam
==
0
?
BeginPaint
(
hwnd
,
&
ps
)
:
(
HDC
)
wParam
;
DATETIME_Refresh
(
hwnd
,
hdc
);
if
(
!
wParam
)
EndPaint
(
hwnd
,
&
ps
);
return
0
;
}
static
LRESULT
DATETIME_ParentNotify
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
DATETIME_INFO
*
infoPtr
=
DATETIME_GetInfoPtr
(
hwnd
);
LPNMHDR
lpnmh
=
(
LPNMHDR
)
lParam
;
TRACE
(
"%x,%lx
\n
"
,
wParam
,
lParam
);
TRACE
(
"Got notification %x from %x
\n
"
,
lpnmh
->
code
,
lpnmh
->
hwndFrom
);
TRACE
(
"info: %x %x %x
\n
"
,
hwnd
,
infoPtr
->
hMonthCal
,
infoPtr
->
hUpdown
);
return
0
;
}
static
LRESULT
DATETIME_Notify
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
DATETIME_INFO
*
infoPtr
=
DATETIME_GetInfoPtr
(
hwnd
);
LPNMHDR
lpnmh
=
(
LPNMHDR
)
lParam
;
TRACE
(
"%x,%lx
\n
"
,
wParam
,
lParam
);
TRACE
(
"Got notification %x from %x
\n
"
,
lpnmh
->
code
,
lpnmh
->
hwndFrom
);
TRACE
(
"info: %x %x %x
\n
"
,
hwnd
,
infoPtr
->
hMonthCal
,
infoPtr
->
hUpdown
);
return
0
;
}
static
LRESULT
DATETIME_KillFocus
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
DATETIME_INFO
*
infoPtr
=
DATETIME_GetInfoPtr
(
hwnd
);
HDC
hdc
;
TRACE
(
"
\n
"
);
if
(
infoPtr
->
select
)
{
DATETIME_SendSimpleNotify
(
hwnd
,
NM_KILLFOCUS
);
infoPtr
->
select
&=
~
DTHT_GOTFOCUS
;
}
hdc
=
GetDC
(
hwnd
);
DATETIME_Refresh
(
hwnd
,
hdc
);
ReleaseDC
(
hwnd
,
hdc
);
InvalidateRect
(
hwnd
,
NULL
,
TRUE
);
return
0
;
}
static
LRESULT
DATETIME_SetFocus
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
HDC
hdc
;
DATETIME_INFO
*
infoPtr
=
DATETIME_GetInfoPtr
(
hwnd
);
TRACE
(
"
\n
"
);
if
(
infoPtr
->
select
)
{
DATETIME_SendSimpleNotify
(
hwnd
,
NM_SETFOCUS
);
infoPtr
->
select
|=
DTHT_GOTFOCUS
;
}
hdc
=
GetDC
(
hwnd
);
DATETIME_Refresh
(
hwnd
,
hdc
);
ReleaseDC
(
hwnd
,
hdc
);
return
0
;
}
static
BOOL
DATETIME_SendSimpleNotify
(
HWND
hwnd
,
UINT
code
)
{
NMHDR
nmhdr
;
TRACE
(
"%x
\n
"
,
code
);
nmhdr
.
hwndFrom
=
hwnd
;
nmhdr
.
idFrom
=
GetWindowLongA
(
hwnd
,
GWL_ID
);
nmhdr
.
code
=
code
;
return
(
BOOL
)
SendMessageA
(
GetParent
(
hwnd
),
WM_NOTIFY
,
(
WPARAM
)
nmhdr
.
idFrom
,
(
LPARAM
)
&
nmhdr
);
}
...
...
@@ -32,7 +381,8 @@ DEFAULT_DEBUG_CHANNEL(datetime)
static
LRESULT
DATETIME_Create
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
DATETIME_INFO
*
infoPtr
;
DATETIME_INFO
*
infoPtr
;
DWORD
dwStyle
=
GetWindowLongA
(
hwnd
,
GWL_STYLE
);
/* allocate memory for info structure */
infoPtr
=
(
DATETIME_INFO
*
)
COMCTL32_Alloc
(
sizeof
(
DATETIME_INFO
));
...
...
@@ -43,11 +393,29 @@ DATETIME_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
SetWindowLongA
(
hwnd
,
0
,
(
DWORD
)
infoPtr
);
if
(
dwStyle
&
DTS_SHOWNONE
)
{
infoPtr
->
hwndCheckbut
=
CreateWindowExA
(
0
,
"button"
,
0
,
WS_CHILD
|
WS_VISIBLE
|
BS_AUTOCHECKBOX
,
2
,
2
,
13
,
13
,
hwnd
,
0
,
GetWindowLongA
(
hwnd
,
GWL_HINSTANCE
),
0
);
SendMessageA
(
infoPtr
->
hwndCheckbut
,
BM_SETCHECK
,
1
,
0
);
}
/* initialize info structure */
if
(
dwStyle
&
DTS_UPDOWN
)
{
infoPtr
->
hUpdown
=
CreateUpDownControl
(
WS_CHILD
|
WS_BORDER
|
WS_VISIBLE
,
120
,
1
,
20
,
20
,
hwnd
,
1
,
0
,
0
,
UD_MAXVAL
,
UD_MINVAL
,
0
);
}
/* initialize info structure */
infoPtr
->
hMonthCal
=
0
;
GetSystemTime
(
&
infoPtr
->
date
);
infoPtr
->
dateValid
=
TRUE
;
infoPtr
->
hFont
=
GetStockObject
(
DEFAULT_GUI_FONT
);
return
0
;
}
...
...
@@ -56,29 +424,27 @@ static LRESULT
DATETIME_Destroy
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
DATETIME_INFO
*
infoPtr
=
DATETIME_GetInfoPtr
(
hwnd
);
/* free datetime info data */
COMCTL32_Free
(
infoPtr
);
return
0
;
}
LRESULT
WINAPI
DATETIME_WindowProc
(
HWND
hwnd
,
UINT
uMsg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
switch
(
uMsg
)
{
case
DTM_GETSYSTEMTIME
:
FIXME
(
"Unimplemented msg DTM_GETSYSTEMTIME
\n
"
);
return
GDT_VALID
;
DATETIME_GetSystemTime
(
hwnd
,
wParam
,
lParam
);
case
DTM_SETSYSTEMTIME
:
FIXME
(
"Unimplemented msg DTM_SETSYSTEMTIME
\n
"
);
return
1
;
DATETIME_SetSystemTime
(
hwnd
,
wParam
,
lParam
);
case
DTM_GETRANGE
:
FIXME
(
"Unimplemented msg DTM_GETRANGE
\n
"
);
...
...
@@ -97,24 +463,37 @@ DATETIME_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return
1
;
case
DTM_SETMCCOLOR
:
FIXME
(
"Unimplemented msg DTM_SETMCCOLOR
\n
"
);
return
0
;
return
DATETIME_SetMonthCalColor
(
hwnd
,
wParam
,
lParam
);
case
DTM_GETMCCOLOR
:
FIXME
(
"Unimplemented msg DTM_GETMCCOLOR
\n
"
);
return
0
;
return
DATETIME_GetMonthCalColor
(
hwnd
,
wParam
);
case
DTM_GETMONTHCAL
:
FIXME
(
"Unimplemented msg DTM_GETMONTHCAL
\n
"
);
return
0
;
return
DATETIME_GetMonthCal
(
hwnd
);
case
DTM_SETMCFONT
:
FIXME
(
"Unimplemented msg DTM_SETMCFONT
\n
"
);
return
0
;
return
DATETIME_SetMonthCalFont
(
hwnd
,
wParam
,
lParam
);
case
DTM_GETMCFONT
:
FIXME
(
"Unimplemented msg DTM_GETMCFONT
\n
"
);
return
0
;
return
DATETIME_GetMonthCalFont
(
hwnd
);
case
WM_PARENTNOTIFY
:
return
DATETIME_ParentNotify
(
hwnd
,
wParam
,
lParam
);
case
WM_NOTIFY
:
return
DATETIME_Notify
(
hwnd
,
wParam
,
lParam
);
case
WM_PAINT
:
return
DATETIME_Paint
(
hwnd
,
wParam
);
case
WM_KILLFOCUS
:
return
DATETIME_KillFocus
(
hwnd
,
wParam
,
lParam
);
case
WM_SETFOCUS
:
return
DATETIME_SetFocus
(
hwnd
,
wParam
,
lParam
);
case
WM_LBUTTONDOWN
:
return
DATETIME_LButtonDown
(
hwnd
,
wParam
,
lParam
);
case
WM_CREATE
:
return
DATETIME_Create
(
hwnd
,
wParam
,
lParam
);
...
...
include/commctrl.h
View file @
c8cc3258
...
...
@@ -151,7 +151,7 @@ typedef struct tagNMTOOLTIPSCREATED
#define CDRF_NOTIFYITEMDRAW 0x00000020
#define CDRF_NOTIFYSUBITEMDRAW 0x00000020
#define CDRF_NOTIFYPOSTERASE 0x00000040
/* #define CDRF_NOTIFYITEMERASE 0x00000080 obsolete
? */
#define CDRF_NOTIFYITEMERASE 0x00000080
/* obsolete ??
? */
/* drawstage flags */
...
...
@@ -496,6 +496,25 @@ BOOL WINAPI ImageList_Write(HIMAGELIST, LPSTREAM);
#define FLATSB_CLASSW L"flatsb_class32"
#define FLATSB_CLASS WINELIB_NAME_AW(FLATSB_CLASS)
#define WSB_PROP_CYVSCROLL 0x00000001L
#define WSB_PROP_CXHSCROLL 0x00000002L
#define WSB_PROP_CYHSCROLL 0x00000004L
#define WSB_PROP_CXVSCROLL 0x00000008L
#define WSB_PROP_CXHTHUMB 0x00000010L
#define WSB_PROP_CYVTHUMB 0x00000020L
#define WSB_PROP_VBKGCOLOR 0x00000040L
#define WSB_PROP_HBKGCOLOR 0x00000080L
#define WSB_PROP_VSTYLE 0x00000100L
#define WSB_PROP_HSTYLE 0x00000200L
#define WSB_PROP_WINSTYLE 0x00000400L
#define WSB_PROP_PALETTE 0x00000800L
#define WSB_PROP_MASK 0x00000FFFL
#define FSB_REGULAR_MODE 0
#define FSB_ENCARTA_MODE 1
#define FSB_FLAT_MODE 2
BOOL
WINAPI
FlatSB_EnableScrollBar
(
HWND
,
INT
,
UINT
);
BOOL
WINAPI
FlatSB_ShowScrollBar
(
HWND
,
INT
,
BOOL
);
BOOL
WINAPI
FlatSB_GetScrollRange
(
HWND
,
INT
,
LPINT
,
LPINT
);
...
...
@@ -1479,7 +1498,7 @@ typedef struct _RB_HITTESTINFO
#define TBS_FIXEDLENGTH 0x0040
#define TBS_NOTHUMB 0x0080
#define TBS_TOOLTIPS 0x0100
#define TBS_REVERSED
0x0200
#define TBS_REVERSED
0x0200
#define TBTS_TOP 0
#define TBTS_LEFT 1
...
...
@@ -3105,23 +3124,132 @@ typedef struct tagNMDAYSTATE
#define DATETIMEPICK_CLASS WINELIB_NAME_AW(DATETIMEPICK_CLASS)
#define DTM_FIRST 0x1000
#define DTN_FIRST (0U-760U)
#define DTN_LAST (0U-799U)
#define DTM_GETSYSTEMTIME (DTM_FIRST+1)
#define DTM_SETSYSTEMTIME (DTM_FIRST+2)
#define DTM_GETRANGE (DTM_FIRST+3)
#define DTM_SETRANGE (DTM_FIRST+4)
#define DTM_SETFORMATA (DTM_FIRST+5)
#define DTM_SETFORMATW (DTM_FIRST + 50)
#define DTM_SETFORMATA
(DTM_FIRST+5)
#define DTM_SETFORMATW
(DTM_FIRST + 50)
#define DTM_SETFORMAT WINELIB_NAME_AW(DTM_SETFORMAT)
#define DTM_SETMCCOLOR (DTM_FIRST+6)
#define DTM_GETMCCOLOR (DTM_FIRST+7)
#define DTM_GETMONTHCAL (DTM_FIRST+8)
#define DTM_SETMCFONT (DTM_FIRST+9)
#define DTM_GETMCFONT (DTM_FIRST+10)
/* Datetime Notifications */
#define DTN_DATETIMECHANGE (DTN_FIRST + 1)
#define DTN_USERSTRINGA (DTN_FIRST + 2)
#define DTN_WMKEYDOWNA (DTN_FIRST + 3)
#define DTN_FORMATA (DTN_FIRST + 4)
#define DTN_FORMATQUERYA (DTN_FIRST + 5)
#define DTN_DROPDOWN (DTN_FIRST + 6)
#define DTN_CLOSEUP (DTN_FIRST + 7)
#define DTN_USERSTRINGW (DTN_FIRST + 15)
#define DTN_WMKEYDOWNW (DTN_FIRST + 16)
#define DTN_FORMATW (DTN_FIRST + 17)
#define DTN_FORMATQUERYW (DTN_FIRST + 18)
#define DTS_SHORTDATEFORMAT 0x0000
#define DTS_UPDOWN 0x0001
#define DTS_SHOWNONE 0x0002
#define DTS_LONGDATEFORMAT 0x0004
#define DTS_TIMEFORMAT 0x0009
#define DTS_APPCANPARSE 0x0010
#define DTS_RIGHTALIGN 0x0020
typedef
struct
tagNMDATETIMECHANGE
{
NMHDR
nmhdr
;
DWORD
dwFlags
;
SYSTEMTIME
st
;
}
NMDATETIMECHANGE
,
*
LPNMDATETIMECHANGE
;
typedef
struct
tagNMDATETIMESTRINGA
{
NMHDR
nmhdr
;
LPCSTR
pszUserString
;
SYSTEMTIME
st
;
DWORD
dwFlags
;
}
NMDATETIMESTRINGA
,
*
LPNMDATETIMESTRINGA
;
typedef
struct
tagNMDATETIMESTRINGW
{
NMHDR
nmhdr
;
LPCWSTR
pszUserString
;
SYSTEMTIME
st
;
DWORD
dwFlags
;
}
NMDATETIMESTRINGW
,
*
LPNMDATETIMESTRINGW
;
typedef
struct
tagNMDATETIMEWMKEYDOWNA
{
NMHDR
nmhdr
;
int
nVirtKey
;
LPCSTR
pszFormat
;
SYSTEMTIME
st
;
}
NMDATETIMEWMKEYDOWNA
,
*
LPNMDATETIMEWMKEYDOWNA
;
typedef
struct
tagNMDATETIMEWMKEYDOWNW
{
NMHDR
nmhdr
;
int
nVirtKey
;
LPCWSTR
pszFormat
;
SYSTEMTIME
st
;
}
NMDATETIMEWMKEYDOWNW
,
*
LPNMDATETIMEWMKEYDOWNW
;
typedef
struct
tagNMDATETIMEFORMATA
{
NMHDR
nmhdr
;
LPCSTR
pszFormat
;
SYSTEMTIME
st
;
LPCSTR
pszDisplay
;
CHAR
szDisplay
[
64
];
}
NMDATETIMEFORMATA
,
*
LPNMDATETIMEFORMATA
;
typedef
struct
tagNMDATETIMEFORMATW
{
NMHDR
nmhdr
;
LPCWSTR
pszFormat
;
SYSTEMTIME
st
;
LPCWSTR
pszDisplay
;
WCHAR
szDisplay
[
64
];
}
NMDATETIMEFORMATW
,
*
LPNMDATETIMEFORMATW
;
typedef
struct
tagNMDATETIMEFORMATQUERYA
{
NMHDR
nmhdr
;
LPCSTR
pszFormat
;
SIZE
szMax
;
}
NMDATETIMEFORMATQUERYA
,
*
LPNMDATETIMEFORMATQUERYA
;
typedef
struct
tagNMDATETIMEFORMATQUERYW
{
NMHDR
nmhdr
;
LPCWSTR
pszFormat
;
SIZE
szMax
;
}
NMDATETIMEFORMATQUERYW
,
*
LPNMDATETIMEFORMATQUERYW
;
#define NMDATETIMESTRING WINELIB_NAME_AW(NMDATETIMESTRING)
#define NMDATETIMEWMKEYDOWN WINELIB_NAME_AW(NMDATETIMEWMKEYDOWN)
#define NMDATETIMEFORMAT WINELIB_NAME_AW(NMDATETIMEFORMAT)
#define NMDATETIMEFORMATQUERY WINELIB_NAME_AW(NMDATETIMEFORMATQUERY)
#define GDT_ERROR -1
...
...
@@ -3132,6 +3260,32 @@ typedef struct tagNMDAYSTATE
#define GDTR_MAX 0x0002
#define DateTime_GetSystemtime(hdp, pst) \\
(
DWORD
)
SendMessageA
(
hdp
,
DTM_GETSYSTEMTIME
,
0
,
(
LPARAM
)(
pst
))
#define DateTime_SetSystemtime(hdp, gd, pst) \\
(
BOOL
)
SendMessageA
(
hdp
,
DTM_SETSYSTEMTIME
,
(
LPARAM
)(
gd
),
(
LPARAM
)(
pst
))
#define DateTime_GetRange(hdp, rgst) \\
(
DWORD
)
SendMessageA
(
hdp
,
DTM_GETRANGE
,
0
,
(
LPARAM
)(
rgst
))
#define DateTime_SetRange(hdp, gd, rgst) \\
(
BOOL
)
SendMessageA
(
hdp
,
DTM_SETRANGE
,
(
WPARAM
)(
gd
),
(
LPARAM
)(
rgst
))
#define DateTime_SetFormat WINELIB_NAME_AW(DateTime_SetFormat)
#define DateTime_SetFormatA(hdp, sz) \\
(
BOOL
)
SendMessageA
(
hdp
,
DTM_SETFORMAT
,
0
,
(
LPARAM
)(
sz
))
#define DateTime_SetFormatW(hdp, sz) \\
(
BOOL
)
SendMessageW
(
hdp
,
DTM_SETFORMAT
,
0
,
(
LPARAM
)(
sz
))
#define DateTime_GetMonthCalColor(hdp, iColor) \\
SendMessageA
(
hdp
,
DTM_GETMCCOLOR
,
iColor
,
0
)
#define DateTime_GetMonthCal(hdp) \\
(
HWND
)
SendMessageA
(
hdp
,
DTM_GETMONTHCAL
,
0
,
0
)
#define DateTime_SetMonthCalFont(hdp, hfont, fRedraw) \\
SendMessageA
(
hdp
,
DTM_SETMCFONT
,
(
WPARAM
)
hfont
,
(
LPARAM
)
fRedraw
)
#define DateTime_GetMonthCalFont(hdp) \\
SendMessageA
(
hdp
,
DTM_GETMCFONT
,
0
,
0
)
/**************************************************************************
* UNDOCUMENTED functions
...
...
include/datetime.h
View file @
c8cc3258
...
...
@@ -2,6 +2,7 @@
* Date and time picker class extra info
*
* Copyright 1998 Eric Kohl
* Copyright 1999 Alex Priem
*/
#ifndef __WINE_DATETIME_H
...
...
@@ -11,13 +12,32 @@
typedef
struct
tagDATETIME_INFO
{
DWORD
dwDummy
;
/* just to keep the compiler happy ;-) */
HWND
hMonthCal
;
HWND
hUpdown
;
SYSTEMTIME
date
;
BOOL
dateValid
;
HWND
hwndCheckbut
;
RECT
rect
;
RECT
checkbox
;
RECT
daytxt
;
RECT
daynumtxt
;
RECT
rmonthtxt
;
RECT
yeartxt
;
RECT
calbutton
;
int
select
;
HFONT
hFont
;
}
DATETIME_INFO
,
*
LPDATETIME_INFO
;
extern
VOID
DATETIME_Register
(
VOID
);
extern
VOID
DATETIME_Unregister
(
VOID
);
#define DTHT_NONE 0
#define DTHT_MCPOPUP 1
#define DTHT_YEAR 2
#define DTHT_DAYNUM 3
#define DTHT_MONTH 4
#define DTHT_DAY 5
#define DTHT_CHECKBOX 6
#define DTHT_GOTFOCUS 128
#endif
/* __WINE_DATETIME_H */
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