123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- /***=========================================================================
- ==== ====
- ==== D C U t i l i t y ====
- ==== ====
- =============================================================================
- ==== ====
- ==== File name : TrueColorToolBar.h ====
- ==== Project name : Tester ====
- ==== Project number : --- ====
- ==== Creation date : 13/1/2003 ====
- ==== Author(s) : Dany Cantin ====
- ==== ====
- ==== Copyright ?DCUtility 2003 ====
- ==== ====
- =============================================================================
- ===========================================================================
- usage :
- ///////////////////////////////////////////////////////////////////////
- if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
- | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
- !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
- {
- TRACE0("Failed to create toolbar\n");
- return -1; // fail to create
- }
- m_wndToolBar.LoadTrueColorToolBar( 32, IDB_NORMAL, IDB_NORMAL, IDB_NORMAL);*/
- #ifndef TRUECOLORTOOLBAR_H_
- #define TRUECOLORTOOLBAR_H_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- #include <afxtempl.h>
- /////////////////////////////////////////////////////////////////////////////
- // CTrueColorToolBar
- class CTrueColorToolBar : public CToolBar
- {
- // Construction
- public:
- CTrueColorToolBar();
- // Attributes
- private:
- BOOL m_bDropDown;
- struct stDropDownInfo {
- public:
- UINT uButtonID;
- UINT uMenuID;
- CWnd* pParent;
- };
-
- CArray <stDropDownInfo, stDropDownInfo&> m_lstDropDownButton;
-
- // Operations
- public:
- BOOL LoadTrueColorToolBar(int nBtnWidth,
- UINT uToolBar,
- UINT uToolBarHot = 0,
- UINT uToolBarDisabled = 0);
- void AddDropDownButton(CWnd* pParent, UINT uButtonID, UINT uMenuID);
- private:
- BOOL SetTrueColorToolBar(UINT uToolBarType,
- UINT uToolBar,
- int nBtnWidth);
- // Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CTrueColorToolBar)
- //}}AFX_VIRTUAL
- // Implementation
- public:
- virtual ~CTrueColorToolBar();
- // Generated message map functions
- protected:
- //{{AFX_MSG(CTrueColorToolBar)
- #ifdef VC60
- afx_msg void OnToolbarDropDown(NMTOOLBAR* pnmh, LRESULT* plRes);
- #else
- afx_msg void OnToolbarDropDown(NMHDR *pNMHDR, LRESULT *pResult);
- #endif
- afx_msg BOOL OnEraseBkgnd(CDC* pDC);
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- };
- /////////////////////////////////////////////////////////////////////////////
- //{{AFX_INSERT_LOCATION}}
- // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
- #endif // TRUECOLORTOOLBAR_H_
|