Thank you for the bug report. We agree with you that when the user selects a date from the pop-up date picker, the time should not be changed. We already changed the default behavior. Please replace the CExtDateTimeWnd::OnDropDownCalendarSelChanged()
method with this:
LRESULT CExtDateTimeWnd::OnDropDownCalendarSelChanged( WPARAM wParam, LPARAM lParam )
{
ASSERT_VALID( this );
lParam;
const CExtDatePickerWnd::SELECTION_NOTIFICATION * pSN =
CExtDatePickerWnd::SELECTION_NOTIFICATION::FromWPARAM( wParam );
ASSERT( pSN != NULL );
if( pSN->m_bFinalSelectionChanging )
{
if( pSN->m_dtBegin.GetStatus() == COleDateTime::valid
&& GetStatus() == CExtDateTimeWnd::valid
)
SetDateTime(
pSN->m_dtBegin.GetYear(),
pSN->m_dtBegin.GetMonth(),
pSN->m_dtBegin.GetDay(),
m_dtDate.GetHour(),
m_dtDate.GetMinute(),
m_dtDate.GetSecond()
);
else
SetDateTime( pSN->m_dtBegin );
}
return 0L;
}
As for the second problem, we confirm this bug. To fix it, please open the
CExtDateTimeWnd::OnDigitPressed()
method, find the
case CExtDurationWnd::hour
line and replace the corresponding code with this:
case CExtDurationWnd::hour:
{
bool b24Hours = OnQueryTimeFormat24Hours();
if( nValue < 0 || nValue > 23 )
nValue = nDigit;
pII->m_nValue = nValue;
if( !b24Hours )
{
if( nHour >= 12 && nValue < 12 )
nValue += 12;
if( pII->m_nValue > 12 )
pII->m_nValue -= 12;
}
ASSERT( pII->m_nValue >= 0
&& ( (pII->m_nValue <= 23 && b24Hours)
|| (pII->m_nValue <= 12 && !b24Hours) )
);
ASSERT( nValue >= 0 && nValue <= 23 );
nHour = nValue;
}
break;
After that recompile the library. These fixes will also be available in the next library release.