void COXCalendarEdit::SetText(LPCTSTR lpszDate) { if (IsValidDate(lpszDate)) COXMaskedEdit::SetText(lpszDate); else COXMaskedEdit::SetText(_T("")); }
uint_t GetScore() const { return Song.size() + Game.size() + Dumper.size() + Comments.size() + DumpDate.size() * IsValidDate(DumpDate) + 100 * IsValidTime(FadeTime) + 100 * IsValidTime(FadeDuration) ; }
CString COXCalendarEdit::GetText() { CString strText = COXMaskedEdit::GetText(); if (IsEmptyDate(strText)) return _T(""); else if (IsValidDate(strText)) return strText; else return GetErrorString(); }
// 从该年的某天计算日期 // 如果无对应日期,则操作失败并返回false;否则返回true bool ChineseDate::FromYearDay(int days) { if (days < 1 && days > ChineseCalendarDB::GetYearDays(m_year)) return false; m_month = 1; int monthDay = ChineseCalendarDB::GetMonthDays(m_year, m_month); while (days > monthDay) { days -= monthDay; ++m_month; monthDay = ChineseCalendarDB::GetMonthDays(m_year, m_month); } m_day = monthDay; assert(IsValidDate()); // 当ChineseDate对象内部数据变化时确保仍是正确的日期 return true; }