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