| 1 | /* |
|---|
| 2 | Written by Steve Bryndin (fishbed@tezcat.com, steveb@gvsi.com). |
|---|
| 3 | |
|---|
| 4 | This code may be used in compiled form in any way you wish. This |
|---|
| 5 | file may be redistributed unmodified by any means PROVIDING it is |
|---|
| 6 | not sold for profit without the authors written consent, and |
|---|
| 7 | providing that this notice and the authors name is included. |
|---|
| 8 | An email letting me know that you are using it would be |
|---|
| 9 | nice as well. |
|---|
| 10 | |
|---|
| 11 | This software is provided "as is" without express or implied warranty. |
|---|
| 12 | Use it at you own risk! The author accepts no liability for any damages |
|---|
| 13 | to your computer or data these products may cause. |
|---|
| 14 | */ |
|---|
| 15 | |
|---|
| 16 | // From http://www.codeguru.com/submission_guide.shtml : |
|---|
| 17 | // |
|---|
| 18 | // "While we are talking about copyrights, you retain copyright of |
|---|
| 19 | // your article and code but by submitting it to CodeGuru you give it |
|---|
| 20 | // permission to use it in a fair manner and also permit all developers |
|---|
| 21 | // to freely use the code in their own applications - even if they are |
|---|
| 22 | // commercial." |
|---|
| 23 | |
|---|
| 24 | |
|---|
| 25 | #if !defined(AFX_INFOBAR_H__C789E26C_DA4B_11D2_BF44_006008085F93__INCLUDED_) |
|---|
| 26 | #define AFX_INFOBAR_H__C789E26C_DA4B_11D2_BF44_006008085F93__INCLUDED_ |
|---|
| 27 | |
|---|
| 28 | #if _MSC_VER > 1000 |
|---|
| 29 | #pragma once |
|---|
| 30 | #endif // _MSC_VER > 1000 |
|---|
| 31 | // InfoBar.h : header file |
|---|
| 32 | // |
|---|
| 33 | |
|---|
| 34 | ///////////////////////////////////////////////////////////////////////////// |
|---|
| 35 | // CInfoBar window |
|---|
| 36 | |
|---|
| 37 | class CInfoBar : public CControlBar |
|---|
| 38 | { |
|---|
| 39 | // Construction |
|---|
| 40 | public: |
|---|
| 41 | CInfoBar(); |
|---|
| 42 | |
|---|
| 43 | // Attributes |
|---|
| 44 | public: |
|---|
| 45 | |
|---|
| 46 | // Operations |
|---|
| 47 | public: |
|---|
| 48 | |
|---|
| 49 | // Overrides |
|---|
| 50 | // ClassWizard generated virtual function overrides |
|---|
| 51 | //{{AFX_VIRTUAL(CInfoBar) |
|---|
| 52 | //}}AFX_VIRTUAL |
|---|
| 53 | |
|---|
| 54 | // Implementation |
|---|
| 55 | public: |
|---|
| 56 | void SetTextColor(COLORREF crNew); |
|---|
| 57 | void SetBackgroundColor(COLORREF cr); |
|---|
| 58 | BOOL SetTextFont(LPCTSTR lpFontName); |
|---|
| 59 | BOOL SetBitmap(UINT nResID); |
|---|
| 60 | void SetText(LPCTSTR lpszNew); |
|---|
| 61 | LPCTSTR GetText(); |
|---|
| 62 | virtual ~CInfoBar(); |
|---|
| 63 | |
|---|
| 64 | // Generated message map functions |
|---|
| 65 | protected: |
|---|
| 66 | //{{AFX_MSG(CInfoBar) |
|---|
| 67 | afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); |
|---|
| 68 | afx_msg BOOL OnEraseBkgnd(CDC* pDC); |
|---|
| 69 | afx_msg void OnPaint(); |
|---|
| 70 | afx_msg void OnSysColorChange(); |
|---|
| 71 | //}}AFX_MSG |
|---|
| 72 | afx_msg LRESULT OnSizeParent(WPARAM, LPARAM lParam); |
|---|
| 73 | DECLARE_MESSAGE_MAP() |
|---|
| 74 | |
|---|
| 75 | BOOL m_bCustomBkgnd; |
|---|
| 76 | int m_cxAvailable; |
|---|
| 77 | CFont m_font; |
|---|
| 78 | CString m_caption; |
|---|
| 79 | CBitmap m_bm; |
|---|
| 80 | |
|---|
| 81 | virtual void OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler); |
|---|
| 82 | virtual CSize CalcFixedLayout(BOOL bStretch, BOOL bHorz); |
|---|
| 83 | private: |
|---|
| 84 | COLORREF m_crBackgroundColor; |
|---|
| 85 | COLORREF m_crTextColor; |
|---|
| 86 | CSize m_sizeBitmap; |
|---|
| 87 | }; |
|---|
| 88 | |
|---|
| 89 | ///////////////////////////////////////////////////////////////////////////// |
|---|
| 90 | |
|---|
| 91 | //{{AFX_INSERT_LOCATION}} |
|---|
| 92 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. |
|---|
| 93 | |
|---|
| 94 | #endif // !defined(AFX_INFOBAR_H__C789E26C_DA4B_11D2_BF44_006008085F93__INCLUDED_) |
|---|