2005-01-19 08:55:48 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: generic/datectrl.h
|
|
|
|
// Purpose: generic wxDatePickerCtrl implementation
|
|
|
|
// Author: Andreas Pflug
|
|
|
|
// Modified by:
|
|
|
|
// Created: 2005-01-19
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) 2005 Andreas Pflug <pgadmin@pse-consulting.de>
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_GENERIC_DATECTRL_H_
|
|
|
|
#define _WX_GENERIC_DATECTRL_H_
|
|
|
|
|
|
|
|
class WXDLLIMPEXP_ADV wxCalendarDateAttr;
|
|
|
|
class WXDLLIMPEXP_ADV wxCalendarCtrl;
|
|
|
|
class WXDLLIMPEXP_ADV wxCalendarEvent;
|
2006-10-22 10:15:46 -04:00
|
|
|
class WXDLLIMPEXP_ADV wxComboCtrl;
|
|
|
|
class WXDLLIMPEXP_ADV wxCalendarComboPopup;
|
2005-01-20 21:00:07 -05:00
|
|
|
|
2005-01-21 08:44:01 -05:00
|
|
|
class WXDLLIMPEXP_ADV wxDatePickerCtrlGeneric : public 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
|
|
|
|
bool SetFormat(const wxChar *fmt);
|
|
|
|
wxCalendarCtrl *GetCalendar() const { return m_cal; }
|
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();
|
|
|
|
|
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
|
|
|
|
2005-01-21 12:54:08 -05:00
|
|
|
wxCalendarCtrl *m_cal;
|
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()
|
2005-01-21 08:44:01 -05:00
|
|
|
DECLARE_NO_COPY_CLASS(wxDatePickerCtrlGeneric)
|
2005-01-19 08:55:48 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _WX_GENERIC_DATECTRL_H_
|
|
|
|
|