git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31588
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
m_txt = new wxTextCtrl(this, CTRLID_TXT);
m_txt->Connect(wxID_ANY, wxID_ANY, wxEVT_KEY_DOWN,
m_txt = new wxTextCtrl(this, CTRLID_TXT);
m_txt->Connect(wxID_ANY, wxID_ANY, wxEVT_KEY_DOWN,
- (wxObjectEventFunction)&wxDatePickerCtrlGeneric::OnEditKey,
+ (wxObjectEventFunction)
+ (wxEventFunction)
+ (wxCharEventFunction)
+ &wxDatePickerCtrlGeneric::OnEditKey,
0, this);
m_txt->Connect(wxID_ANY, wxID_ANY, wxEVT_KILL_FOCUS,
0, this);
m_txt->Connect(wxID_ANY, wxID_ANY, wxEVT_KILL_FOCUS,
- (wxObjectEventFunction)&wxDatePickerCtrlGeneric::OnKillFocus,
+ (wxObjectEventFunction)
+ (wxEventFunction)
+ (wxFocusEventFunction)
+ &wxDatePickerCtrlGeneric::OnKillFocus,
0, this);
const int height = m_txt->GetBestSize().y - 4; // FIXME: fudge
0, this);
const int height = m_txt->GetBestSize().y - 4; // FIXME: fudge
wxPoint(0,0), wxDefaultSize,
wxCAL_SHOW_HOLIDAYS | wxSUNKEN_BORDER);
m_cal->Connect(CTRLID_CAL, CTRLID_CAL, wxEVT_CALENDAR_SEL_CHANGED,
wxPoint(0,0), wxDefaultSize,
wxCAL_SHOW_HOLIDAYS | wxSUNKEN_BORDER);
m_cal->Connect(CTRLID_CAL, CTRLID_CAL, wxEVT_CALENDAR_SEL_CHANGED,
- (wxObjectEventFunction)&wxDatePickerCtrlGeneric::OnSelChange,
+ (wxObjectEventFunction)
+ (wxEventFunction)
+ (wxCalendarEventFunction)
+ &wxDatePickerCtrlGeneric::OnSelChange,
0, this);
m_cal->Connect(wxID_ANY, wxID_ANY, wxEVT_KEY_DOWN,
0, this);
m_cal->Connect(wxID_ANY, wxID_ANY, wxEVT_KEY_DOWN,
- (wxObjectEventFunction)&wxDatePickerCtrlGeneric::OnCalKey,
+ (wxObjectEventFunction)
+ (wxEventFunction)
+ (wxCharEventFunction)
+ &wxDatePickerCtrlGeneric::OnCalKey,
0, this);
m_cal->Connect(CTRLID_CAL, CTRLID_CAL, wxEVT_CALENDAR_DOUBLECLICKED,
0, this);
m_cal->Connect(CTRLID_CAL, CTRLID_CAL, wxEVT_CALENDAR_DOUBLECLICKED,
- (wxObjectEventFunction)&wxDatePickerCtrlGeneric::OnSelChange,
+ (wxObjectEventFunction)
+ (wxEventFunction)
+ (wxCalendarEventFunction)
+ &wxDatePickerCtrlGeneric::OnSelChange,
0, this);
m_cal->Connect(CTRLID_CAL, CTRLID_CAL, wxEVT_CALENDAR_DAY_CHANGED,
0, this);
m_cal->Connect(CTRLID_CAL, CTRLID_CAL, wxEVT_CALENDAR_DAY_CHANGED,
- (wxObjectEventFunction)&wxDatePickerCtrlGeneric::OnSelChange,
+ (wxObjectEventFunction)
+ (wxEventFunction)
+ (wxCalendarEventFunction)
+ &wxDatePickerCtrlGeneric::OnSelChange,
0, this);
m_cal->Connect(CTRLID_CAL, CTRLID_CAL, wxEVT_CALENDAR_MONTH_CHANGED,
0, this);
m_cal->Connect(CTRLID_CAL, CTRLID_CAL, wxEVT_CALENDAR_MONTH_CHANGED,
- (wxObjectEventFunction)&wxDatePickerCtrlGeneric::OnSelChange,
+ (wxObjectEventFunction)
+ (wxEventFunction)
+ (wxCalendarEventFunction)
+ &wxDatePickerCtrlGeneric::OnSelChange,
0, this);
m_cal->Connect(CTRLID_CAL, CTRLID_CAL, wxEVT_CALENDAR_YEAR_CHANGED,
0, this);
m_cal->Connect(CTRLID_CAL, CTRLID_CAL, wxEVT_CALENDAR_YEAR_CHANGED,
- (wxObjectEventFunction)&wxDatePickerCtrlGeneric::OnSelChange,
+ (wxObjectEventFunction)
+ (wxEventFunction)
+ (wxCalendarEventFunction)
+ &wxDatePickerCtrlGeneric::OnSelChange,
0, this);
wxWindow *yearControl = m_cal->GetYearControl();
Connect(wxID_ANY, wxID_ANY, wxEVT_SET_FOCUS,
0, this);
wxWindow *yearControl = m_cal->GetYearControl();
Connect(wxID_ANY, wxID_ANY, wxEVT_SET_FOCUS,
- (wxObjectEventFunction)&wxDatePickerCtrlGeneric::OnSetFocus);
+ (wxObjectEventFunction)
+ (wxEventFunction)
+ (wxFocusEventFunction)
+ &wxDatePickerCtrlGeneric::OnSetFocus);
wxClientDC dc(yearControl);
dc.SetFont(m_font);
wxClientDC dc(yearControl);
dc.SetFont(m_font);
m_popup->SetClientSize(panel->GetSize());
m_popup->Hide();
m_popup->SetClientSize(panel->GetSize());
m_popup->Hide();
{
if ( !wxControl::Show(show) )
{
{
if ( !wxControl::Show(show) )
{
{
if ( !wxControl::Enable(enable) )
{
{
if ( !wxControl::Enable(enable) )
{
}
if (m_btn)
m_btn->Enable(enable);
}
if (m_btn)
m_btn->Enable(enable);
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
if (m_txt)
{
currentText = m_txt->GetValue();
if (m_txt)
{
currentText = m_txt->GetValue();
- if (!currentText.IsEmpty())
+ if (!currentText.empty())
currentDate.ParseFormat(currentText, m_format);
}
wxDateTime dt;
currentDate.ParseFormat(currentText, m_format);
}
wxDateTime dt;
- if (!currentText.IsEmpty())
+ if (!currentText.empty())
m_txt->SetValue(currentDate.Format(m_format));
}
return true;
m_txt->SetValue(currentDate.Format(m_format));
}
return true;
wxDateTime dt;
wxString txt=m_txt->GetValue();
wxDateTime dt;
wxString txt=m_txt->GetValue();
dt.ParseFormat(txt, m_format);
return dt;
dt.ParseFormat(txt, m_format);
return dt;
if (down)
{
wxDateTime dt;
if (down)
{
wxDateTime dt;
- if (!m_txt->GetValue().IsEmpty())
+ if (!m_txt->GetValue().empty())
dt.ParseFormat(m_txt->GetValue(), m_format);
if (dt.IsValid())
dt.ParseFormat(m_txt->GetValue(), m_format);
if (dt.IsValid())
// If the date isn't valid, the user's probable in the middle of typing
wxString txt=m_txt->GetValue();
wxDateTime dt;
// If the date isn't valid, the user's probable in the middle of typing
wxString txt=m_txt->GetValue();
wxDateTime dt;
{
dt.ParseFormat(txt, m_format);
if (!dt.IsValid())
{
dt.ParseFormat(txt, m_format);
if (!dt.IsValid())
{
const wxDateTime::Tm tm(dt.GetTm());
{
const wxDateTime::Tm tm(dt.GetTm());
- st->wYear = tm.year;
- st->wMonth = tm.mon - wxDateTime::Jan + 1;
+ st->wYear = (WXWORD)tm.year;
+ st->wMonth = (WXWORD)(tm.mon - wxDateTime::Jan + 1);
st->wDay = tm.mday;
st->wDayOfWeek =
st->wDay = tm.mday;
st->wDayOfWeek =