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
CoolTabCtrl.h
Package: VC+ACCESS开发的酒店管理+论文.rar [view]
Upload User: sunh8215
Upload Date: 2010-02-13
Package Size: 1616k
Code Size: 4k
Category:
Hotel software system
Development Platform:
Visual C++
- /*####################################################################
- Filename: cooltabctrl.h
- ----------------------------------------------------
- Remarks: ...
- ----------------------------------------------------
- ####################################################################*/
- #if !defined(_ANYOU_COOL_TABCTRL_H)
- #define _ANYOU_COOL_TABCTRL_H
- #if _MSC_VER > 1000
- #pragma once
- #endif
- #include <afxtempl.h>
- #define TABMODE_NONE 0
- #define TABMODE_GROUP 1
- #define TABMODE_TOPTAB 2
- #define TABMODE_BOTTOMTAB 3
- #define TABMODE_LEFTAB 4
- #define TABMODE_RIGHTTAB 5
- /*####################################################################
- ------------------------------------------------
- class CTabPageItem
- ------------------------------------------------
- ####################################################################*/
- class CTabPageItem
- {
- friend class CCoolTabCtrl;
- private:
- CWnd* m_pWnd; //窗口,可以为NULL
- CCoolTabCtrl* m_pParentWnd;
- UINT m_dwState; //窗口类型,0:普通,1:对话框
- CString m_strText; //标签
- HICON m_hIcon; //图标
- CRect m_rect; //矩形区域
- int m_nNumber; //序号
- public:
- ~CTabPageItem();
- void OnDraw(CDC *pDC, int nState);
- void Hide();
- CTabPageItem(CCoolTabCtrl* pParentWnd, CWnd* pWnd, const CString &strText, int nNumber);
- void SetRect(const CRect& rect);
- void Expend();
- void SetIcon(HICON hicon);
- protected:
- CRect m_rcLabel;
- };
- /*####################################################################
- ------------------------------------------------
- class CCoolTabCtrl
- ------------------------------------------------
- ####################################################################*/
- class CCoolTabCtrl : public CWnd
- {
- friend class CTabPageItem;
- // Construction--------------------------------------
- DECLARE_DYNCREATE(CCoolTabCtrl)
- public:
- CCoolTabCtrl();
- virtual ~CCoolTabCtrl();
- BOOL Create(const CRect &rect, CWnd *pParentWnd, UINT dwStyle = WS_VISIBLE | WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS,
- UINT dwCtrlStyle = 0, UINT nID = 0);
- // Attributes-----------------------------------------
- public:
- void SetActivePage(int nindex);
- void SetBorderStyle(DWORD dwStyle);
- void SetCtrlStyle(DWORD dwStyle);
- int GetActivePage() { return m_nActivePage;}
- // Operations-----------------------------------------
- public:
- BOOL AddPage(CWnd* pwnd, LPCTSTR strText, UINT IconID);
- BOOL AddPage(CRuntimeClass* pClass,UINT nIDTemplate, LPCTSTR strText, UINT IconID);
- // Overrides------------------------------------------
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CCoolTabCtrl)
- //}}AFX_VIRTUAL
- // Implementation-------------------------------------
- public:
- void DrawBoder(CDC* pDC, CRect rect);
- CWnd* GetPage(int number);
- void SetMode(int nMode);
- void AutoSize();
- BOOL PlayResource(WORD wResourceID);//点击非客户区播放声音
- public:
- // static bool m_bDefaultPage;//是否为缺省的页面
- // Generated message map functions---------------------
- protected:
- int m_nMode;
- //{{AFX_MSG(CCoolTabCtrl)
- afx_msg void OnPaint();
- afx_msg BOOL OnEraseBkgnd(CDC* pDC);
- afx_msg void OnNcPaint();
- afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
- afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp);
- afx_msg void OnWindowPosChanging(WINDOWPOS FAR* lpwndpos);
- afx_msg UINT OnNcHitTest(CPoint point);
- afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint point);
- afx_msg void OnMouseMove(UINT nFlags, CPoint point);
- afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
- afx_msg void OnSize(UINT nType, int cx, int cy);
- afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- private:
- int m_nHotItem;
- DWORD m_dwBorderStyle;
- int m_nActivePage;
- CFont m_fontWnd;
- DWORD m_dwStyle;
- CArray<CTabPageItem*, CTabPageItem*> m_aTabPage;
- };
- //{{AFX_INSERT_LOCATION}}
- #endif // !defined(_ANYOU_COOLTABCTRL_H)