📄 colordlg.cpp
字号:
// ColorDlg.cpp : implementation file
//
#include "stdafx.h"
#include "TemplateTrans.h"
#include "ColorDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CColorDlg dialog
CColorDlg::CColorDlg(CWnd* pParent /*=NULL*/)
: CDialog(CColorDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CColorDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CColorDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CColorDlg)
DDX_Control(pDX, IDC_COLOR_LIST, m_lstColor);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CColorDlg, CDialog)
//{{AFX_MSG_MAP(CColorDlg)
ON_LBN_DBLCLK(IDC_COLOR_LIST, OnDblclkColorList)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CColorDlg message handlers
BOOL CColorDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// 添加伪彩色编码
for (int i = 0; i < m_nColorCount; i++)
{
m_lstColor.AddString(m_lpColorName + i * m_nNameLen);
}
// 选中初始编码表
m_lstColor.SetCurSel(m_nColor);
return TRUE;
}
void CColorDlg::OnDblclkColorList()
{
OnOK();
}
void CColorDlg::OnOK()
{
m_nColor = m_lstColor.GetCurSel();
CDialog::OnOK();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -