📄 setdlg.cpp
字号:
// SetDlg.cpp : implementation file
//
#include "stdafx.h"
#include "eightnum.h"
#include "SetDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CSetDlg dialog
CSetDlg::CSetDlg(CWnd* pParent /*=NULL*/)
: CDialog(CSetDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CSetDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
m_hIcon=::AfxGetApp()->LoadIcon(IDI_SET);
m_bitmapOk.LoadBitmap(IDB_OK);
m_bitmapCancel.LoadBitmap(IDB_CANCEL);
m_strTip="搜索引擎,双击快捷“确定”";
m_iSearchEngine=0;
}
void CSetDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CSetDlg)
DDX_Control(pDX, IDC_LIST_ENGINE, m_listSearchEngine);
DDX_Control(pDX, IDOK, m_btnOk);
DDX_Control(pDX, IDCANCEL, m_btnCancel);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CSetDlg, CDialog)
//{{AFX_MSG_MAP(CSetDlg)
ON_LBN_DBLCLK(IDC_LIST_ENGINE, OnDblclkListEngine)
ON_LBN_SELCHANGE(IDC_LIST_ENGINE, OnSelchangeListEngine)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CSetDlg message handlers
BOOL CSetDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
SetIcon(m_hIcon,1);
//添加搜索引擎
m_listSearchEngine.AddString("GSE Search Engine");
m_listSearchEngine.AddString("GSE and TT Search Engine");
m_listSearchEngine.SetCurSel(m_iSearchEngine);
//添加提示
m_ToolTip.Create(this);
m_ToolTip.Activate(1);
m_ToolTip.AddTool(GetDlgItem(IDC_LIST_ENGINE),m_strTip);
m_btnOk.SetBitmap(m_bitmapOk);
m_btnCancel.SetBitmap(m_bitmapCancel);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
BOOL CSetDlg::PreTranslateMessage(MSG* pMsg)
{
// TODO: Add your specialized code here and/or call the base class
m_ToolTip.RelayEvent(pMsg);
return CDialog::PreTranslateMessage(pMsg);
}
void CSetDlg::OnDblclkListEngine()
{
// TODO: Add your control notification handler code here
OnOK();
}
void CSetDlg::OnOK()
{
// TODO: Add extra validation here
m_iSearchEngine=m_listSearchEngine.GetCurSel();
CDialog::OnOK();
}
void CSetDlg::OnSelchangeListEngine()
{
// TODO: Add your control notification handler code here
int iNum=m_listSearchEngine.GetCurSel();
switch(iNum)
{
case 0:
m_strTip="全局择优搜索引擎,双击可以快捷“确定”";
break;
case 1:
m_strTip="使用了置换表的全局择优搜索引擎,双击可以快捷“确定”";
break;
}
m_ToolTip.AddTool(GetDlgItem(IDC_LIST_ENGINE),m_strTip);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -