1
///////////////////////////////////////////////////////////////////////////////
2
// Name: wx/msw/datetimectrl.h
3
// Purpose: wxDateTimePickerCtrl for Windows.
4
// Author: Vadim Zeitlin
5
// Created: 2011-09-22 (extracted from wx/msw/datectrl.h).
6
// Copyright: (c) 2005-2011 Vadim Zeitlin <vadim@wxwindows.org>
7
// Licence: wxWindows licence
8
///////////////////////////////////////////////////////////////////////////////
10
#ifndef _WX_MSW_DATETIMECTRL_H_
11
#define _WX_MSW_DATETIMECTRL_H_
15
// Forward declare a struct from Platform SDK.
16
struct tagNMDATETIMECHANGE;
18
// ----------------------------------------------------------------------------
19
// wxDateTimePickerCtrl
20
// ----------------------------------------------------------------------------
22
class WXDLLIMPEXP_ADV wxDateTimePickerCtrl : public wxDateTimePickerCtrlBase
26
virtual void SetValue(const wxDateTime& dt);
27
virtual wxDateTime GetValue() const;
29
// returns true if the platform should explicitly apply a theme border
30
virtual bool CanApplyThemeBorder() const { return false; }
32
virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result);
35
virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
36
virtual wxSize DoGetBestSize() const;
38
// Helper for the derived classes Create(): creates a native control with
39
// the specified attributes.
40
bool MSWCreateDateTimePicker(wxWindow *parent,
46
const wxValidator& validator,
47
const wxString& name);
49
// Notice that the methods below must be overridden in all native MSW
50
// classes inheriting from this one but they can't be pure virtual because
51
// the generic implementations, not needing nor able to implement them, is
52
// also derived from this class currently. The real problem is, of course,
53
// this wrong class structure because the generic classes also inherit the
54
// wrong implementations of Set/GetValue() and DoGetBestSize() but as they
55
// override these methods anyhow, it does work -- but is definitely ugly
56
// and need to be changed (but how?) in the future.
58
// Override to return the date/time format used by this control.
59
virtual wxLocaleInfo MSWGetFormat() const /* = 0 */
61
wxFAIL_MSG( "Unreachable" );
62
return wxLOCALE_TIME_FMT;
65
// Override to indicate whether we can have no date at all.
66
virtual bool MSWAllowsNone() const /* = 0 */
68
wxFAIL_MSG( "Unreachable" );
72
// Override to update m_date and send the event when the control contents
73
// changes, return true if the event was handled.
74
virtual bool MSWOnDateTimeChange(const tagNMDATETIMECHANGE& dtch) /* = 0 */
77
wxFAIL_MSG( "Unreachable" );
82
// the date currently shown by the control, may be invalid
86
#endif // _WX_MSW_DATETIMECTRL_H_