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
// RCS-ID: $Id: datetimectrl.h 69489 2011-10-20 16:45:48Z VZ $
7
// Copyright: (c) 2005-2011 Vadim Zeitlin <vadim@wxwindows.org>
8
// Licence: wxWindows licence
9
///////////////////////////////////////////////////////////////////////////////
11
#ifndef _WX_MSW_DATETIMECTRL_H_
12
#define _WX_MSW_DATETIMECTRL_H_
16
// Forward declare a struct from Platform SDK.
17
struct tagNMDATETIMECHANGE;
19
// ----------------------------------------------------------------------------
20
// wxDateTimePickerCtrl
21
// ----------------------------------------------------------------------------
23
class WXDLLIMPEXP_ADV wxDateTimePickerCtrl : public wxDateTimePickerCtrlBase
27
virtual void SetValue(const wxDateTime& dt);
28
virtual wxDateTime GetValue() const;
30
// returns true if the platform should explicitly apply a theme border
31
virtual bool CanApplyThemeBorder() const { return false; }
33
virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result);
36
virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
37
virtual wxSize DoGetBestSize() const;
39
// Helper for the derived classes Create(): creates a native control with
40
// the specified attributes.
41
bool MSWCreateDateTimePicker(wxWindow *parent,
47
const wxValidator& validator,
48
const wxString& name);
50
// Notice that the methods below must be overridden in all native MSW
51
// classes inheriting from this one but they can't be pure virtual because
52
// the generic implementations, not needing nor able to implement them, is
53
// also derived from this class currently. The real problem is, of course,
54
// this wrong class structure because the generic classes also inherit the
55
// wrong implementations of Set/GetValue() and DoGetBestSize() but as they
56
// override these methods anyhow, it does work -- but is definitely ugly
57
// and need to be changed (but how?) in the future.
59
// Override to return the date/time format used by this control.
60
virtual wxLocaleInfo MSWGetFormat() const /* = 0 */
62
wxFAIL_MSG( "Unreachable" );
63
return wxLOCALE_TIME_FMT;
66
// Override to indicate whether we can have no date at all.
67
virtual bool MSWAllowsNone() const /* = 0 */
69
wxFAIL_MSG( "Unreachable" );
73
// Override to update m_date and send the event when the control contents
74
// changes, return true if the event was handled.
75
virtual bool MSWOnDateTimeChange(const tagNMDATETIMECHANGE& dtch) /* = 0 */
78
wxFAIL_MSG( "Unreachable" );
83
// the date currently shown by the control, may be invalid
87
#endif // _WX_MSW_DATETIMECTRL_H_