📄 bottomdlg.cpp
字号:
// BottomDlg.cpp : implementation file
//
#include "stdafx.h"
#include "VCStyle.h"
#include "BottomDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CBottomDlg dialog
CBottomDlg::CBottomDlg(CWnd* pParent /*=NULL*/)
: CDialog(CBottomDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CBottomDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
m_imf = "";
m_brush.CreateSolidBrush(RGB(255,255,230)); // 生成一绿色刷子
}
void CBottomDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CBottomDlg)
DDX_Control(pDX, IDC_EDIT_IMF, m_edit);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CBottomDlg, CDialog)
//{{AFX_MSG_MAP(CBottomDlg)
ON_WM_SIZE()
ON_WM_CTLCOLOR()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CBottomDlg message handlers
void CBottomDlg::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
// TODO: Add your message handler code here
if(m_edit.GetSafeHwnd()){
m_edit.MoveWindow(0,0,cx,cy);
m_edit.ShowWindow(SW_SHOW);
}
}
void CBottomDlg::SetText(CString str)
{
m_imf = str;
m_edit.SetWindowText(m_imf);
m_edit.SetSel(m_imf.GetLength()-1,
m_imf.GetLength()-1);
}
void CBottomDlg::AppendText(CString str)
{
m_imf += str;
m_edit.SetWindowText(m_imf);
m_edit.SetSel(m_imf.GetLength()-1,
m_imf.GetLength()-1);
}
CString CBottomDlg::GetText()
{
return m_imf;//如果m_imf很大,这个函数性能不好
}
void CBottomDlg::OnOK()
{
}
void CBottomDlg::OnCancel()
{
}
//改变edit背景和文字颜色
HBRUSH CBottomDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
// HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
// TODO: Change any attributes of the DC here
pDC->SetBkColor(RGB(255,255,230));
pDC->SetTextColor(RGB(0,0,250));
// return CreateSolidBrush(bk);//bug!!!!!!!!!!!!!!!
return m_brush;
// TODO: Return a different brush if the default is not desired
// return hbr;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -