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"
|
|
|
|
|
2011-01-02 17:03:56 -05:00
|
|
|
class WXDLLIMPEXP_FWD_CORE wxComboCtrl;
|
2008-06-11 07:45:57 -04:00
|
|
|
|
2011-01-02 17:03:56 -05:00
|
|
|
class WXDLLIMPEXP_FWD_ADV wxCalendarCtrl;
|
2007-07-09 06:09:52 -04:00
|
|
|
class WXDLLIMPEXP_FWD_ADV wxCalendarComboPopup;
|
2005-01-20 21:00:07 -05:00
|
|
|
|
2011-01-03 06:24:13 -05:00
|
|
|
class WXDLLIMPEXP_ADV wxDatePickerCtrlGeneric
|
|
|
|
: public wxCompositeWindow<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
|
2005-01-19 08:55:48 -05:00
|
|
|
void SetValue(const wxDateTime& date);
|
|
|
|
wxDateTime GetValue() const;
|
2005-01-19 10:57:30 -05:00
|
|
|
|
2005-01-19 08:55:48 -05:00
|
|
|
bool GetRange(wxDateTime *dt1, wxDateTime *dt2) const;
|
|
|
|
void SetRange(const wxDateTime &dt1, const wxDateTime &dt2);
|
|
|
|
|
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
|
|
|
|
virtual bool Destroy();
|
2005-01-19 08:55:48 -05:00
|
|
|
|
2005-01-19 10:57:30 -05:00
|
|
|
protected:
|
2005-01-19 08:55:48 -05:00
|
|
|
virtual wxSize DoGetBestSize() const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
void Init();
|
|
|
|
|
2011-01-03 06:24:13 -05:00
|
|
|
// return the list of the windows composing this one
|
|
|
|
virtual wxWindowList GetCompositeWindowParts() const;
|
|
|
|
|
2005-02-13 07:44:14 -05:00
|
|
|
void OnText(wxCommandEvent &event);
|
2005-04-16 06:32:36 -04:00
|
|
|
void OnSize(wxSizeEvent& event);
|
2006-10-27 14:02:21 -04:00
|
|
|
void OnFocus(wxFocusEvent& event);
|
2005-01-19 08:55:48 -05:00
|
|
|
|
2012-02-07 19:16:59 -05:00
|
|
|
#ifdef __WXOSX_COCOA__
|
2012-02-28 09:41:30 -05:00
|
|
|
virtual void OSXGenerateEvent(const wxDateTime& WXUNUSED(dt)) { }
|
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
|
|
|
|
2005-01-19 08:55:48 -05:00
|
|
|
DECLARE_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_
|
|
|
|
|