void CEditDelayed::OnEnChange() { if (m_uTimerResult != 0) { // Edit control contents were changed while the control was active (had focus) ASSERT( GetFocus() == this ); m_dwLastModified = GetTickCount(); } else { // Edit control contents were changed while the control was not active (e.g. // someone called 'SetWindowText' from within an other window). ASSERT( GetFocus() != this ); DoDelayedEvalute(); } if (GetWindowTextLength() == 0 && m_bShowResetButton) { m_iwReset.ShowIcon(0); m_bShowResetButton = false; SetEditRect(true); m_iwReset.ShowWindow(SW_HIDE); } else if (GetWindowTextLength() > 0 && !m_bShowResetButton) { m_bShowResetButton = true; SetEditRect(true); m_iwReset.ShowWindow(SW_SHOW); } }
void CEditDelayed::OnTimer(UINT_PTR nIDEvent) { //ASSERT( nIDEvent == DELAYED_EVALUATE_TIMER_ID ); if (nIDEvent == DELAYED_EVALUATE_TIMER_ID) { DWORD dwElapsed = GetTickCount() - m_dwLastModified; if (dwElapsed >= 400) { DoDelayedEvalute(); m_dwLastModified = GetTickCount(); } } CEdit::OnTimer(nIDEvent); }
BOOL CEditDelayed::OnCommand(WPARAM wParam, LPARAM /*lParam*/) { wParam = LOWORD(wParam); if (wParam >= MP_FILTERCOLUMNS && wParam <= MP_FILTERCOLUMNS + 50) { if (m_nCurrentColumnIdx != (int)wParam - MP_FILTERCOLUMNS) { m_nCurrentColumnIdx = wParam - MP_FILTERCOLUMNS; if (m_bShowsColumnText) ShowColumnText(true); else if (GetWindowTextLength() != 0) DoDelayedEvalute(true); } } return TRUE; }
void CEditDelayed::OnKillFocus(CWnd* pNewWnd) { if (!m_bShuttingDown) { // Kill timer ASSERT( m_uTimerResult != 0 ); VERIFY( KillTimer(DELAYED_EVALUATE_TIMER_ID) ); m_uTimerResult = 0; // If there was something modified since the last evaluation.. DoDelayedEvalute(); if (GetWindowTextLength() == 0) ShowColumnText(true); } CEdit::OnKillFocus(pNewWnd); }
void CEditDelayed::OnLButtonUp(UINT nFlags, CPoint point){ if (m_bShowRestButton){ m_iwReset.ShowIcon(0); ReleaseCapture(); CRect editRect; GetClientRect(&editRect); if (m_pointMousePos.x > editRect.right-ICON_LEFTSPACE){ SetWindowText(_T("")); DoDelayedEvalute(); m_bShowRestButton = false; SetEditRect(true); m_iwReset.ShowWindow(SW_HIDE); SetFocus(); return; } } CEdit::OnLButtonUp(nFlags, point); }