2005-01-15 17:08:07 +00:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/msw/datectrl.h
|
|
|
|
// Purpose: wxDatePickerCtrl for Windows
|
|
|
|
// Author: Vadim Zeitlin
|
|
|
|
// Modified by:
|
|
|
|
// Created: 2005-01-09
|
|
|
|
// Copyright: (c) 2005 Vadim Zeitlin <vadim@wxwindows.org>
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_MSW_DATECTRL_H_
|
|
|
|
#define _WX_MSW_DATECTRL_H_
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxDatePickerCtrl
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class WXDLLIMPEXP_ADV wxDatePickerCtrl : public wxDatePickerCtrlBase
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
// ctors
|
|
|
|
wxDatePickerCtrl() { }
|
|
|
|
|
|
|
|
wxDatePickerCtrl(wxWindow *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxDateTime& dt = wxDefaultDateTime,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
2005-01-20 16:22:48 +00:00
|
|
|
long style = wxDP_DEFAULT | wxDP_SHOWCENTURY,
|
2005-01-15 17:08:07 +00:00
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxDatePickerCtrlNameStr)
|
|
|
|
{
|
|
|
|
Create(parent, id, dt, pos, size, style, validator, name);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Create(wxWindow *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxDateTime& dt = wxDefaultDateTime,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
2005-01-20 16:22:48 +00:00
|
|
|
long style = wxDP_DEFAULT | wxDP_SHOWCENTURY,
|
2005-01-15 17:08:07 +00:00
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxDatePickerCtrlNameStr);
|
|
|
|
|
2011-09-29 13:43:02 +00:00
|
|
|
// Override this one to add date-specific (and time-ignoring) checks.
|
2016-09-23 14:59:11 +00:00
|
|
|
virtual void SetValue(const wxDateTime& dt) wxOVERRIDE;
|
|
|
|
virtual wxDateTime GetValue() const wxOVERRIDE;
|
2005-01-15 17:08:07 +00:00
|
|
|
|
2011-09-29 13:43:02 +00:00
|
|
|
// Implement the base class pure virtuals.
|
2016-09-23 14:59:11 +00:00
|
|
|
virtual void SetRange(const wxDateTime& dt1, const wxDateTime& dt2) wxOVERRIDE;
|
|
|
|
virtual bool GetRange(wxDateTime *dt1, wxDateTime *dt2) const wxOVERRIDE;
|
2005-01-15 17:08:07 +00:00
|
|
|
|
2011-09-29 13:43:02 +00:00
|
|
|
// Override MSW-specific functions used during control creation.
|
2016-09-23 14:59:11 +00:00
|
|
|
virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const wxOVERRIDE;
|
2005-01-15 17:08:07 +00:00
|
|
|
|
2006-02-08 21:47:09 +00:00
|
|
|
protected:
|
2013-10-25 12:17:28 +00:00
|
|
|
#if wxUSE_INTL
|
2016-09-23 14:59:11 +00:00
|
|
|
virtual wxLocaleInfo MSWGetFormat() const wxOVERRIDE;
|
2013-10-25 12:17:28 +00:00
|
|
|
#endif // wxUSE_INTL
|
2016-09-23 14:59:11 +00:00
|
|
|
virtual bool MSWAllowsNone() const wxOVERRIDE { return HasFlag(wxDP_ALLOWNONE); }
|
|
|
|
virtual bool MSWOnDateTimeChange(const tagNMDATETIMECHANGE& dtch) wxOVERRIDE;
|
2005-01-15 17:08:07 +00:00
|
|
|
|
2015-07-17 13:11:01 +00:00
|
|
|
private:
|
|
|
|
wxDateTime MSWGetControlValue() const;
|
|
|
|
|
2015-04-23 11:49:01 +00:00
|
|
|
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxDatePickerCtrl);
|
2005-01-15 17:08:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _WX_MSW_DATECTRL_H_
|