home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / mfc / advanced / oldbars / statbar.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-03-27  |  2.9 KB  |  83 lines

  1. // statbar.h : definition of old backward compatible CStatusBar
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1992-1998 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and related
  9. // electronic documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12.  
  13. #ifndef _STATBAR_H_
  14. #define _STATBAR_H_
  15.  
  16. struct AFX_STATUSPANE;      // private to implementation
  17.  
  18. class COldStatusBar : public CControlBar
  19. {
  20.     DECLARE_DYNAMIC(COldStatusBar)
  21. // Construction
  22. public:
  23.     COldStatusBar();
  24.     BOOL Create(CWnd* pParentWnd,
  25.             DWORD dwStyle = WS_CHILD | WS_VISIBLE | CBRS_BOTTOM,
  26.             UINT nID = AFX_IDW_STATUS_BAR);
  27.     BOOL SetIndicators(const UINT* lpIDArray, int nIDCount);
  28.  
  29. // Attributes
  30. public: // standard control bar things
  31.     int CommandToIndex(UINT nIDFind) const;
  32.     UINT GetItemID(int nIndex) const;
  33.     void GetItemRect(int nIndex, LPRECT lpRect) const;
  34. public:
  35.     void GetPaneText(int nIndex, CString& s) const;
  36.     BOOL SetPaneText(int nIndex, LPCTSTR lpszNewText, BOOL bUpdate = TRUE);
  37.     void GetPaneInfo(int nIndex, UINT& nID, UINT& nStyle, int& cxWidth) const;
  38.     void SetPaneInfo(int nIndex, UINT nID, UINT nStyle, int cxWidth);
  39.     UINT GetPaneStyle(int nIndex) const;
  40.     void SetPaneStyle(int nIndex, UINT nStyle);
  41.  
  42. // Implementation
  43. public:
  44.     virtual ~COldStatusBar();
  45.     virtual CSize CalcFixedLayout(BOOL bStretch, BOOL bHorz);
  46.     virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  47.  
  48. #ifdef _DEBUG
  49.     virtual void AssertValid() const;
  50.     virtual void Dump(CDumpContext& dc) const;
  51.     void EnableDocking(DWORD dwDockStyle);
  52. #endif
  53.  
  54. protected:
  55.     HFONT m_hFont;
  56.     int m_cxSizeBox;        // for Win4 style size box in corner
  57.     BOOL m_bHideSizeBox;    // hide size box if TRUE
  58.  
  59.     inline AFX_STATUSPANE* _GetPanePtr(int nIndex) const;
  60.     void DrawStatusText(CDC* pDC, const CRect& rect,
  61.         LPCTSTR lpszText, UINT nStyle);
  62.     virtual void DoPaint(CDC* pDC);
  63.     virtual void OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler);
  64.     //{{AFX_MSG(COldStatusBar)
  65.     afx_msg UINT OnNcHitTest(CPoint point);
  66.     afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
  67.     afx_msg void OnSize(UINT nType, int cx, int cy);
  68.     afx_msg LRESULT OnSetFont(WPARAM wParam, LPARAM lParam);
  69.     afx_msg LRESULT OnGetFont(WPARAM wParam, LPARAM lParam);
  70.     afx_msg LRESULT OnSetText(WPARAM wParam, LPARAM lParam);
  71.     afx_msg LRESULT OnGetText(WPARAM wParam, LPARAM lParam);
  72.     afx_msg LRESULT OnGetTextLength(WPARAM wParam, LPARAM lParam);
  73.     afx_msg LRESULT OnSizeParent(WPARAM wParam, LPARAM lParam);
  74.     afx_msg void OnSettingChange(UINT uFlags, LPCTSTR lpszSection);
  75.     //}}AFX_MSG
  76.     DECLARE_MESSAGE_MAP()
  77. };
  78.  
  79. // define CStatusBar to COldStatusBar for convenience
  80. #define CStatusBar COldStatusBar
  81.  
  82. #endif //!_STATBAR_H_
  83.