else // invalid date
{
wxASSERT_MSG( HasDPFlag(wxDP_ALLOWNONE),
- _T("this control must have a valid date") );
+ wxT("this control must have a valid date") );
m_combo->SetText(wxEmptyString);
}
}
+ bool IsTextEmpty() const
+ {
+ return m_combo->GetTextCtrl()->IsEmpty();
+ }
+
bool ParseDateTime(const wxString& s, wxDateTime* pDt)
{
wxASSERT(pDt);
if (year_cnt == 1 && month_cnt == 1 && day_cnt == 1)
return fmt;
- else
- return x_format;
+
+ return x_format;
}
bool SetFormat(const wxString& fmt)
if ( m_combo )
{
wxArrayString allowedChars;
- for ( wxChar c = _T('0'); c <= _T('9'); c++ )
+ for ( wxChar c = wxT('0'); c <= wxT('9'); c++ )
allowedChars.Add(wxString(c, 1));
const wxChar *p2 = m_format.c_str();
const wxString& name)
{
wxASSERT_MSG( !(style & wxDP_SPIN),
- _T("wxDP_SPIN style not supported, use wxDP_DEFAULT") );
+ wxT("wxDP_SPIN style not supported, use wxDP_DEFAULT") );
if ( !wxControl::Create(parent, id, pos, size,
style | wxCLIP_CHILDREN | wxWANTS_CHARS | wxBORDER_NONE,
wxDateTime wxDatePickerCtrlGeneric::GetValue() const
{
+ if ( HasFlag(wxDP_ALLOWNONE) && m_popup->IsTextEmpty() )
+ return wxInvalidDateTime;
return m_popup->GetDate();
}