⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 finddlg.cpp

📁 Resource editor base speadrum Chinese mobile
💻 CPP
字号:
// FindDlg.cpp : implementation file
//

#include "stdafx.h"
#include "resourceeditor.h"
#include "FindDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CFindDlg dialog


CFindDlg::CFindDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CFindDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CFindDlg)
	m_bCase = FALSE;
	m_bWhole = FALSE;
	//}}AFX_DATA_INIT

    m_pLstCtrl = NULL;
}


void CFindDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CFindDlg)
	DDX_Control(pDX, IDC_CMB_FIND, m_cmbFind);
	DDX_Check(pDX, IDC_CHK_MATCH_CASE, m_bCase);
	DDX_Check(pDX, IDC_CHK_MATCH_WHOLE, m_bWhole);
	//}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CFindDlg, CDialog)
	//{{AFX_MSG_MAP(CFindDlg)
	ON_CBN_EDITCHANGE(IDC_CMB_FIND, OnEditchangeCmbFind)
	ON_CBN_SELCHANGE(IDC_CMB_FIND, OnSelchangeCmbFind)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CFindDlg message handlers

void CFindDlg::OnOK()
{
	// TODO: Add your control notification handler code here
	//
    m_cmbFind.GetWindowText(m_strFind);
    if( !m_strFind.IsEmpty() )
    {
        CResEditorApp * pApp = (CResEditorApp *)AfxGetApp();
        CStringArray &arr = pApp->m_arrTextFind;

        int nCount = arr.GetSize();
        for( int i = 0; i < nCount; ++i )
        {
            if( m_strFind.Compare(arr[i]) == 0 )
                arr.RemoveAt(i);
        }
        arr.Add(m_strFind);
    }
    CDialog::OnOK();
}

void CFindDlg::SetLstCtrl(CListCtrl *plst)
{
    _ASSERTE( plst != NULL );

    m_pLstCtrl = plst;
}

void CFindDlg::OnEditchangeCmbFind() 
{
	// TODO: Add your control notification handler code here
	//
    CString strTxt;
    m_cmbFind.GetWindowText(strTxt);

    CWnd * pWnd = GetDlgItem(IDOK);
    _ASSERTE( pWnd != NULL );

    pWnd->EnableWindow( !strTxt.IsEmpty() );
}

BOOL CFindDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	CResEditorApp * pApp = (CResEditorApp *)AfxGetApp();
    CStringArray &arr = pApp->m_arrTextFind;
    int nCount = arr.GetSize();
    for( int i = nCount - 1; i >= 0; --i )
    {
        m_cmbFind.AddString(arr[i]);
    }

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}


void CFindDlg::OnSelchangeCmbFind() 
{
	// TODO: Add your control notification handler code here
	CWnd * pWnd = GetDlgItem(IDOK);
    _ASSERTE( pWnd != NULL );

    pWnd->EnableWindow( TRUE );
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -