コード例 #1
0
ファイル: EditDelayed.cpp プロジェクト: dalinhuang/dmibox
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);
    }
}
コード例 #2
0
ファイル: EditDelayed.cpp プロジェクト: dalinhuang/dmibox
void CEditDelayed::OnInit(CHeaderCtrl* pColumnHeader, CArray<int, int>* paIgnoredColums)
{
    SetEditRect(false);
    CRect rectWindow;
    GetClientRect(rectWindow);

    m_pctrlColumnHeader = pColumnHeader;
    m_hCursor = LoadCursor(NULL, IDC_ARROW);
    m_nCurrentColumnIdx = 0;

    CImageList* pImageList = new CImageList();
    pImageList->Create(16, 16, theApp.m_iDfltImageListColorFlags | ILC_MASK, 0, 1);
    if (pColumnHeader != NULL)
        pImageList->Add(CTempIconLoader(_T("SEARCHEDIT")));
    else
        pImageList->Add(CTempIconLoader(_T("KADNODESEARCH")));
    m_iwColumn.SetImageList(pImageList);
    m_iwColumn.Create(_T(""), WS_CHILD | WS_VISIBLE, CRect(0, 0, ICON_LEFTSPACE, rectWindow.bottom), this, 1);

    pImageList = new CImageList();
    pImageList->Create(16, 16, theApp.m_iDfltImageListColorFlags | ILC_MASK, 0, 1);
    pImageList->Add(CTempIconLoader(_T("FILTERCLEAR1")));
    pImageList->Add(CTempIconLoader(_T("FILTERCLEAR2")));
    m_iwReset.SetImageList(pImageList);
    m_iwReset.Create(_T(""), WS_CHILD , CRect(0, 0, ICON_LEFTSPACE, rectWindow.bottom), this, 1);

    if (paIgnoredColums != NULL)
        m_aIgnoredColums.Copy(*paIgnoredColums);
    ShowColumnText(true);
}
コード例 #3
0
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);
}
コード例 #4
0
ファイル: EditDelayed.cpp プロジェクト: dalinhuang/dmibox
void CEditDelayed::OnSize(UINT nType, int cx, int cy)
{
    CEdit::OnSize(nType, cx, cy);
    SetEditRect(true, true);
}