2005-01-19 08:55:48 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2011-03-19 20:14:35 -04:00
|
|
|
// Name: wx/generic/datectrl.h
|
2005-01-19 08:55:48 -05:00
|
|
|
// Purpose: generic wxDatePickerCtrl implementation
|
|
|
|
// Author: Andreas Pflug
|
|
|
|
// Modified by:
|
|
|
|
// Created: 2005-01-19
|
|
|
|
// Copyright: (c) 2005 Andreas Pflug <pgadmin@pse-consulting.de>
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_GENERIC_DATECTRL_H_
|
|
|
|
#define _WX_GENERIC_DATECTRL_H_
|
|
|
|
|
2011-01-03 06:24:13 -05:00
|
|
|
#include "wx/compositewin.h"
|
2018-01-30 15:35:20 -05:00
|
|
|
#include "wx/containr.h"
|
2011-01-03 06:24:13 -05:00
|
|
|
|
2011-01-02 17:03:56 -05:00
|
|
|
class WXDLLIMPEXP_FWD_CORE wxComboCtrl;
|
2008-06-11 07:45:57 -04:00
|
|
|
|
2018-08-27 10:34:34 -04:00
|
|
|
class WXDLLIMPEXP_FWD_CORE wxCalendarCtrl;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxCalendarComboPopup;
|
2005-01-20 21:00:07 -05:00
|
|
|
|
2018-08-27 10:34:34 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxDatePickerCtrlGeneric
|
2018-07-22 13:12:17 -04:00
|
|
|
: public wxCompositeWindow< wxNavigationEnabled<wxDatePickerCtrlBase> >
|
2005-01-19 08:55:48 -05:00
|
|
|
{
|
|
|
|
public:
|
2005-01-19 10:57:30 -05:00
|
|
|
// creating the control
|
2005-01-21 08:44:01 -05:00
|
|
|
wxDatePickerCtrlGeneric() { Init(); }
|
2006-10-22 10:15:46 -04:00
|
|
|
virtual ~wxDatePickerCtrlGeneric();
|
2005-01-21 08:44:01 -05:00
|
|
|
wxDatePickerCtrlGeneric(wxWindow *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxDateTime& date = wxDefaultDateTime,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxDP_DEFAULT | wxDP_SHOWCENTURY,
|
2005-02-07 13:37:43 -05:00
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
2005-01-21 08:44:01 -05:00
|
|
|
const wxString& name = wxDatePickerCtrlNameStr)
|
|
|
|
{
|
|
|
|
Init();
|
|
|
|
|
2005-02-07 13:37:43 -05:00
|
|
|
(void)Create(parent, id, date, pos, size, style, validator, name);
|
2005-01-21 08:44:01 -05:00
|
|
|
}
|
2005-01-19 08:55:48 -05:00
|
|
|
|
|
|
|
bool Create(wxWindow *parent,
|
2005-01-20 11:22:48 -05:00
|
|
|
wxWindowID id,
|
|
|
|
const wxDateTime& date = wxDefaultDateTime,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxDP_DEFAULT | wxDP_SHOWCENTURY,
|
2005-02-07 13:37:43 -05:00
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
2005-01-20 11:22:48 -05:00
|
|
|
const wxString& name = wxDatePickerCtrlNameStr);
|
2005-01-19 08:55:48 -05:00
|
|
|
|
2005-01-19 10:57:30 -05:00
|
|
|
// wxDatePickerCtrl methods
|
2015-09-06 20:20:42 -04:00
|
|
|
void SetValue(const wxDateTime& date) wxOVERRIDE;
|
|
|
|
wxDateTime GetValue() const wxOVERRIDE;
|
2005-01-19 10:57:30 -05:00
|
|
|
|
2015-09-06 20:20:42 -04:00
|
|
|
bool GetRange(wxDateTime *dt1, wxDateTime *dt2) const wxOVERRIDE;
|
|
|
|
void SetRange(const wxDateTime &dt1, const wxDateTime &dt2) wxOVERRIDE;
|
2005-01-19 08:55:48 -05:00
|
|
|
|
2005-01-19 10:57:30 -05:00
|
|
|
bool SetDateRange(const wxDateTime& lowerdate = wxDefaultDateTime,
|
|
|
|
const wxDateTime& upperdate = wxDefaultDateTime);
|
|
|
|
|
|
|
|
// extra methods available only in this (generic) implementation
|
2008-06-11 07:45:57 -04:00
|
|
|
wxCalendarCtrl *GetCalendar() const;
|
2005-01-19 08:55:48 -05:00
|
|
|
|
|
|
|
|
2005-01-19 10:57:30 -05:00
|
|
|
// implementation only from now on
|
|
|
|
// -------------------------------
|
2005-01-19 08:55:48 -05:00
|
|
|
|
2005-01-19 10:57:30 -05:00
|
|
|
// overridden base class methods
|
2015-09-06 20:20:42 -04:00
|
|
|
virtual bool Destroy() wxOVERRIDE;
|
2005-01-19 08:55:48 -05:00
|
|
|
|
2005-01-19 10:57:30 -05:00
|
|
|
protected:
|
2015-09-06 20:20:42 -04:00
|
|
|
virtual wxSize DoGetBestSize() const wxOVERRIDE;
|
2005-01-19 08:55:48 -05:00
|
|
|
|
|
|
|
private:
|
|
|
|
void Init();
|
|
|
|
|
2011-01-03 06:24:13 -05:00
|
|
|
// return the list of the windows composing this one
|
2015-09-06 20:20:42 -04:00
|
|
|
virtual wxWindowList GetCompositeWindowParts() const wxOVERRIDE;
|
2011-01-03 06:24:13 -05:00
|
|
|
|
2005-02-13 07:44:14 -05:00
|
|
|
void OnText(wxCommandEvent &event);
|
2005-04-16 06:32:36 -04:00
|
|
|
void OnSize(wxSizeEvent& event);
|
2005-01-19 08:55:48 -05:00
|
|
|
|
2012-02-07 19:16:59 -05:00
|
|
|
#ifdef __WXOSX_COCOA__
|
2015-11-22 03:38:20 -05:00
|
|
|
virtual void OSXGenerateEvent(const wxDateTime& WXUNUSED(dt)) wxOVERRIDE { }
|
2012-02-07 19:16:59 -05:00
|
|
|
#endif
|
|
|
|
|
2006-10-22 10:15:46 -04:00
|
|
|
wxComboCtrl* m_combo;
|
|
|
|
wxCalendarComboPopup* m_popup;
|
2005-01-21 12:54:08 -05:00
|
|
|
|
2015-04-23 07:49:01 -04:00
|
|
|
wxDECLARE_EVENT_TABLE();
|
2009-02-08 06:45:59 -05:00
|
|
|
wxDECLARE_NO_COPY_CLASS(wxDatePickerCtrlGeneric);
|
2005-01-19 08:55:48 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _WX_GENERIC_DATECTRL_H_
|
|
|
|
|