?? editstatic.cpp
字號:
// EditStatic.cpp : implementation file
//
#include "stdafx.h"
#include "..\commonctrls.h"
#include "EditStatic.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CEditStatic property page
IMPLEMENT_DYNCREATE(CEditStatic, CPropertyPage)
CEditStatic::CEditStatic() : CPropertyPage(CEditStatic::IDD)
{
//{{AFX_DATA_INIT(CEditStatic)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
CString strCredits = "\tCCloudsCtrl控件演示\n\n"
"\r<<MFC窗口編程>>\n"
"2006.12.1\n\n\n";
m_CloudsCtrl.SetCredits(strCredits);
}
CEditStatic::~CEditStatic()
{
}
void CEditStatic::DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CEditStatic)
// NOTE: the ClassWizard will add DDX and DDV calls here
DDX_Control(pDX, IDC_STATIC_4, m_stcDemo4);
DDX_Control(pDX, IDC_STATIC_1, m_stcDemo1);
DDX_Control(pDX, IDC_CLOUDS, m_CloudsCtrl);
DDX_Control(pDX, IDC_MAIN_EDIT, m_lineedit);
DDX_Control(pDX, IDC_EDIT1, m_edtTrans);
DDX_Control(pDX, IDC_STATIC11, m_stcTrans);
DDX_Control(pDX, IDC_BTN_TEXT, m_btnText);
DDX_Control(pDX, IDC_BTN_BACK, m_btnBack);
DDX_Control(pDX, IDC_BTN_BACK_TRAN, m_btnBackTran);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CEditStatic, CPropertyPage)
//{{AFX_MSG_MAP(CEditStatic)
ON_BN_CLICKED(IDC_BTN_TEXT, OnBtnText)
ON_BN_CLICKED(IDC_BTN_BACK, OnBtnBack)
ON_BN_CLICKED(IDC_BTN_BACK_TRAN, OnBtnBackTran)
ON_WM_TIMER()
ON_WM_PAINT()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CEditStatic message handlers
BOOL CEditStatic::OnInitDialog()
{
CPropertyPage::OnInitDialog();
// TODO: Add extra initialization here
m_stcDemo4.SetFormatString("%.2f");
m_stcDemo4.SetBlankPadding(9);
m_stcDemo4.SetColourFaded(RGB(40,40,40));
m_stcDemo4.SetBarHeight();
m_stcDemo4.SetColours( RGB(200,200,200), 0, RGB(150,0,0) );
m_stcDemo1.DisplayTime();
#define TIMMER_ID 1
SetTimer(TIMMER_ID, 100, NULL);
short shBtnColor = 60;
m_btnText.SetIcon(IDI_LEDON, IDI_LEDOFF);
m_btnText.OffsetColor(CButtonST::BTNST_COLOR_BK_IN, shBtnColor);
m_btnBack.SetIcon(IDI_LEDON, IDI_LEDOFF);
m_btnBack.OffsetColor(CButtonST::BTNST_COLOR_BK_IN, shBtnColor);
m_btnBackTran.SetIcon(IDI_LEDON, IDI_LEDOFF);
m_btnBackTran.OffsetColor(CButtonST::BTNST_COLOR_BK_IN, shBtnColor);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CEditStatic::OnBtnText()
{
if (m_ColDlg.DoModal() == IDOK)
{
m_edtTrans.SetTextColor(m_ColDlg.GetColor());
m_stcTrans.SetTextColor(m_ColDlg.GetColor());
}
}
void CEditStatic::OnBtnBack()
{
if (m_ColDlg.DoModal() == IDOK)
{
m_edtTrans.SetBackColor(m_ColDlg.GetColor());
m_stcTrans.SetBackColor(m_ColDlg.GetColor());
}
}
void CEditStatic::OnBtnBackTran()
{
m_edtTrans.SetBackColor(TRANS_BACK);
m_stcTrans.SetBackColor(TRANS_BACK);
Invalidate();
}
void CEditStatic::OnPaint()
{
CPaintDC dc(this); // device context for painting
// TODO: Add your message handler code here
// Do not call CPropertyPage::OnPaint() for painting messages
}
void CEditStatic::OnTimer(UINT nIDEvent)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
{
static float fCounter = 35;
if ( ((fCounter+=0.01f)*22) >1000 ) fCounter=0;
m_stcDemo1.DisplayTime();
m_stcDemo4.SetPos(fCounter*22, TRUE, 0, 1000);
CPropertyPage::OnTimer(nIDEvent);
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -