]>
Commit | Line | Data |
---|---|---|
569c7d8c VZ |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: src/msw/timectrl.cpp | |
3 | // Purpose: wxTimePickerCtrl implementation | |
4 | // Author: Vadim Zeitlin | |
5 | // Created: 2005-01-09 | |
569c7d8c VZ |
6 | // Copyright: (c) 2005 Vadim Zeitlin <vadim@wxwindows.org> |
7 | // Licence: wxWindows licence | |
8 | ///////////////////////////////////////////////////////////////////////////// | |
9 | ||
10 | // ============================================================================ | |
11 | // declarations | |
12 | // ============================================================================ | |
13 | ||
14 | // ---------------------------------------------------------------------------- | |
15 | // headers | |
16 | // ---------------------------------------------------------------------------- | |
17 | ||
18 | #include "wx/wxprec.h" | |
19 | ||
20 | #ifdef __BORLANDC__ | |
21 | #pragma hdrstop | |
22 | #endif | |
23 | ||
24 | #if wxUSE_DATEPICKCTRL | |
25 | ||
26 | #ifndef WX_PRECOMP | |
ba7df825 | 27 | #include "wx/msw/wrapcctl.h" |
569c7d8c VZ |
28 | #endif |
29 | ||
30 | #include "wx/timectrl.h" | |
31 | #include "wx/dateevt.h" | |
32 | ||
33 | IMPLEMENT_DYNAMIC_CLASS(wxTimePickerCtrl, wxControl) | |
34 | ||
35 | // ============================================================================ | |
36 | // wxTimePickerCtrl implementation | |
37 | // ============================================================================ | |
38 | ||
39 | WXDWORD wxTimePickerCtrl::MSWGetStyle(long style, WXDWORD *exstyle) const | |
40 | { | |
41 | WXDWORD styleMSW = wxTimePickerCtrlBase::MSWGetStyle(style, exstyle); | |
42 | ||
43 | styleMSW |= DTS_TIMEFORMAT; | |
44 | ||
45 | return styleMSW; | |
46 | } | |
47 | ||
48 | wxLocaleInfo wxTimePickerCtrl::MSWGetFormat() const | |
49 | { | |
50 | return wxLOCALE_TIME_FMT; | |
51 | } | |
52 | ||
53 | bool wxTimePickerCtrl::MSWOnDateTimeChange(const NMDATETIMECHANGE& dtch) | |
54 | { | |
55 | m_date.SetFromMSWSysTime(dtch.st); | |
56 | ||
57 | wxDateEvent event(this, m_date, wxEVT_TIME_CHANGED); | |
58 | return HandleWindowEvent(event); | |
59 | } | |
60 | #endif // wxUSE_DATEPICKCTRL |