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
ProgInd.cpp
Package: strategy.zip [view]
Upload User: xrc9201
Upload Date: 2013-02-04
Package Size: 35k
Code Size: 3k
Category:
SourceCode/Document
Development Platform:
Visual C++
- // ProgInd.cpp : implementation file
- //
- #include "stdafx.h"
- #include "ProgInd.h"
- #include "Filler.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CProgressIndicator
- CProgressIndicator::CProgressIndicator( CFiller * pFiller ) : m_pFiller( pFiller )
- {
- // Step 1 - Set m_bCreated to FALSE
- m_bCreated = FALSE;
- // Step 2 - Check and create m_pFiller
- if( m_pFiller == NULL )
- {
- m_pFiller = new CLToRFiller;
- m_bCreated = TRUE;
- }
- // Step 3 - Validate m_pFiller
- ASSERT( m_pFiller != NULL );
- }
- CProgressIndicator::~CProgressIndicator()
- {
- // Step 1 - Check and delete m_pFiller
- if( m_bCreated == TRUE )
- {
- delete m_pFiller;
- }
- }
- BEGIN_MESSAGE_MAP(CProgressIndicator, CWnd)
- //{{AFX_MSG_MAP(CProgressIndicator)
- ON_WM_PAINT()
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CProgressIndicator methods
- CFiller * CProgressIndicator::GetFiller()
- {
- // Step 1 - Return m_pFiller
- return m_pFiller;
- }
- INT CProgressIndicator::SetFiller( CFiller * pFiller )
- {
- // Step 1 - Validate pFiller
- ASSERT( pFiller != NULL );
- // Step 2 - Check and delete m_pFiller
- if( m_bCreated == TRUE )
- {
- delete m_pFiller;
- m_bCreated = FALSE;
- }
- // Step 3 - Set m_pFiller to the parameter passed
- m_pFiller = pFiller;
- return SUCCESS;
- }
- INT CProgressIndicator::SetText( LPCSTR lpszText )
- {
- // Step 1 - Delegate and forward this to CFiller object
- INT nRetVal = m_pFiller->SetFillerText( lpszText );
- Invalidate();
- return nRetVal;
- }
- INT CProgressIndicator::SetRange( INT nMinRange, INT nMaxRange )
- {
- // Step 1 - Delegate and forward this to CFiller object
- return m_pFiller->SetFillerRange( nMinRange, nMaxRange );
- }
- INT CProgressIndicator::GetPos()
- {
- // Step 1 - Delegate and forward this to CFiller object
- return m_pFiller->GetFillerPos();
- }
- INT CProgressIndicator::SetPos( INT nPos )
- {
- // Step 1 - Delegate and forward this to CFiller object
- INT nOldPos = m_pFiller->SetFillerPos( nPos );
- Invalidate();
- return nOldPos;
- }
- /////////////////////////////////////////////////////////////////////////////
- // CProgressIndicator message handlers
- void CProgressIndicator::OnPaint()
- {
- CPaintDC dc(this); // device context for painting
- // Step 1 - Get the client Rectangle
- CRect Rect;
- GetClientRect( & Rect );
- // Step 2 - Call DoFill to do the filling, based on the current situation
- m_pFiller->DoFill( this, Rect );
- }