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
colorbtn.h
Package: color_button_demo.zip [view]
Upload User: sz27991729
Upload Date: 2007-01-01
Package Size: 13k
Code Size: 2k
Category:
Button control
Development Platform:
Visual C++
- #ifndef __COLORBTN_H__
- #define __COLORBTN_H__
- /////////////////////////////////////////////////////////////////////////////
- // colorBtn.h : header file for the CColorButton class
- //
- // Written by Bob Ryan (ryan@cyberzone.net)
- // Copyright (c) 1998.
- //
- // This code may be freely distributable in any application. If
- // you make any changes to the source, please let me know so that
- // I might make a better version of the class.
- //
- // This file is provided "as is" with no expressed or implied warranty.
- // The author accepts no liability for any damage/loss of business that
- // this product may cause.
- //
- /////////////////////////////////////////////////////////////////////////////
- class CColorButton : public CButton
- {
- DECLARE_DYNAMIC(CColorButton)
- public:
- CColorButton();
- virtual ~CColorButton();
- BOOL Attach(const UINT nID, CWnd* pParent,
- const COLORREF BGColor = RGB(192, 192, 192), // gray button
- const COLORREF FGColor = RGB(1, 1, 1), // black text
- const COLORREF DisabledColor = RGB(128, 128, 128), // dark gray disabled text
- const UINT nBevel = 2
- );
- protected:
- virtual void DrawItem(LPDRAWITEMSTRUCT lpDIS);
- void DrawFrame(CDC *DC, CRect R, int Inset);
- void DrawFilledRect(CDC *DC, CRect R, COLORREF color);
- void DrawLine(CDC *DC, CRect EndPoints, COLORREF color);
- void DrawLine(CDC *DC, long left, long top, long right, long bottom, COLORREF color);
- void DrawButtonText(CDC *DC, CRect R, const char *Buf, COLORREF TextColor);
- COLORREF GetFGColor() { return m_fg; }
- COLORREF GetBGColor() { return m_bg; }
- COLORREF GetDisabledColor() { return m_disabled; }
- UINT GetBevel() { return m_bevel; }
- private:
- COLORREF m_fg, m_bg, m_disabled;
- UINT m_bevel;
- };
- #endif