|
// Replacedlg.cpp : implementation of the CReplaceDlg class
//
/////////////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "resource.h"
#include "Replacedlg.h"
LRESULT CReplaceDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
m_bCaseSensitivity = true;
m_nLastEdit = 0;
CenterWindow(GetParent());
DoDataExchange(FALSE);
return TRUE;
}
LRESULT CReplaceDlg::OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
DoDataExchange(TRUE);
EndDialog(wID);
return 0;
}
LRESULT CReplaceDlg::OnFocus(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
if (GetDlgItem(IDC_REPLACEDLG_EDIT_FIND).m_hWnd == GetFocus())
m_nLastEdit = 1;
else if (GetDlgItem(IDC_REPLACEDLG_EDIT_REPLACE).m_hWnd == GetFocus())
m_nLastEdit = 2;
return 0;
}
LRESULT CReplaceDlg::OnCRLF(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
DoDataExchange(TRUE);
if (m_nLastEdit == 1)
{
m_csFindText += _T("�");
DoDataExchange(FALSE);
GetDlgItem(IDC_REPLACEDLG_EDIT_FIND).SetFocus();
((CEdit)GetDlgItem(IDC_REPLACEDLG_EDIT_FIND)).SetSel(m_csFindText.GetLength(), m_csFindText.GetLength());
}
else if (m_nLastEdit == 2)
{
m_csReplaceText += _T("�");
DoDataExchange(FALSE);
GetDlgItem(IDC_REPLACEDLG_EDIT_REPLACE).SetFocus();
((CEdit)GetDlgItem(IDC_REPLACEDLG_EDIT_REPLACE)).SetSel(m_csReplaceText.GetLength(), m_csReplaceText.GetLength());
}
return 0;
}
LRESULT CReplaceDlg::OnTab(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
DoDataExchange(TRUE);
if (m_nLastEdit == 1)
{
m_csFindText += _T("�");
DoDataExchange(FALSE);
GetDlgItem(IDC_REPLACEDLG_EDIT_FIND).SetFocus();
((CEdit)GetDlgItem(IDC_REPLACEDLG_EDIT_FIND)).SetSel(m_csFindText.GetLength(), m_csFindText.GetLength());
}
else if (m_nLastEdit == 2)
{
m_csReplaceText += _T("�");
DoDataExchange(FALSE);
GetDlgItem(IDC_REPLACEDLG_EDIT_REPLACE).SetFocus();
((CEdit)GetDlgItem(IDC_REPLACEDLG_EDIT_REPLACE)).SetSel(m_csReplaceText.GetLength(), m_csReplaceText.GetLength());
}
return 0;
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.