Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
TipsDialog.cpp
Package: ScrollerTest.rar [view]
Upload User: zengj883
Upload Date: 2013-02-03
Package Size: 670k
Code Size: 2k
Category:
SourceCode/Document
Development Platform:
C/C++
- // 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.",
- "nntt-o-"};
- static const int nNumTips = sizeof(astrTips)/sizeof(CString);
- static int nCurrentTip = 0;
- m_scroller.SetText(astrTips[nCurrentTip%nNumTips]);
- ++nCurrentTip;
- }