?? tipsdialog.cpp
字號:
// TipsDialog.cpp : implementation file
//
#include "stdafx.h"
#include "ScrollerTest.h"
#include "TipsDialog.h"
// CTipsDialog dialog
IMPLEMENT_DYNAMIC(CTipsDialog, CDialog)
CTipsDialog::CTipsDialog(CWnd* pParent /*=NULL*/)
: CDialog(CTipsDialog::IDD, pParent)
{
}
CTipsDialog::~CTipsDialog()
{
}
void CTipsDialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(CTipsDialog, CDialog)
ON_COMMAND(1, SwitchTip)
END_MESSAGE_MAP()
// CTipsDialog message handlers
BOOL CTipsDialog::OnInitDialog()
{
CDialog::OnInitDialog();
m_scroller.SetFont("Microsoft Sans Serif", 10, FW_SEMIBOLD);
m_scroller.SetText("\tHello!");
m_scroller.SetWrapping(FALSE);
// short messages, read while paused, not scrolling
// so scroll quickly and pause for a 6 secs.
m_scroller.SetScrollDelay(0);
m_scroller.SetScrollPause(6000);
CRect rect;
GetClientRect(&rect);
m_scroller.Create(rect, this, WS_CHILD|WS_VISIBLE, 1);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CTipsDialog::SwitchTip()
{
static const CString astrTips[] = {
"This is an example of using CScrollerCtrl to present alternating messages.",
"All public methods except Create() can be called before or after creation.",
"Text shadows are displayed only when a pattern is set, and are a combination of the foreground and background colors.",
"I'm too lazy to think up any more tips.",
"\n\n\t\t-o-"};
static const int nNumTips = sizeof(astrTips)/sizeof(CString);
static int nCurrentTip = 0;
m_scroller.SetText(astrTips[nCurrentTip%nNumTips]);
++nCurrentTip;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -