Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

87 lines
2.8 KiB

  1. /******************************************************************************/
  2. /* Bar.H: Defines the Interface to the CStatBar (Status Bar) CLASS */
  3. /* */
  4. /******************************************************************************/
  5. #ifndef __BAR_H__
  6. #define __BAR_H__
  7. //below size does not include bitmap width
  8. #define SIZE_POS_PANE_WIDTH 12 // Bitmap Width + 1 char separator + 5 digits + 1 char separator + 5 digits
  9. // The 2 below defines were needed, since we had to duplicate the DrawStatusText
  10. // method from the barcore.cpp file in the msvc\mfc\src directory
  11. #define CX_BORDER 1 // from auxdata.h in the msvc\mfc\src directory
  12. #define CY_BORDER 1 // from auxdata.h in the msvc\mfc\src directory
  13. /******************************************************************************/
  14. class CStatBar : public CStatusBar
  15. {
  16. DECLARE_DYNAMIC( CStatBar )
  17. private:
  18. CBitmap m_posBitmap;
  19. CBitmap m_sizeBitmap;
  20. CString m_cstringSizeSeparator;
  21. CString m_cstringPosSeparator;
  22. int m_iBitmapWidth;
  23. int m_iBitmapHeight;
  24. int m_iSizeY;
  25. protected:
  26. virtual void DoPaint(CDC* pDC);
  27. virtual CSize CalcFixedLayout(BOOL bStretch, BOOL bHorz);
  28. static void PASCAL DrawStatusText( HDC hDC, CRect const& rect,
  29. LPCTSTR lpszText, UINT nStyle,
  30. int iIndentText = 0);
  31. afx_msg LRESULT OnSetFont(WPARAM wParam, LPARAM lParam);
  32. afx_msg LRESULT OnSizeParent(WPARAM wParam, LPARAM lParam);
  33. afx_msg void OnNcDestroy( void );
  34. afx_msg void OnSysColorChange( void );
  35. public:
  36. CStatBar();
  37. ~CStatBar();
  38. BOOL Create(CWnd* pParentWnd);
  39. BOOL SetText(LPCTSTR sz);
  40. BOOL SetPosition(const CPoint& pos);
  41. BOOL SetSize(const CSize& size);
  42. BOOL ClearPosition();
  43. BOOL ClearSize();
  44. BOOL Reset();
  45. DECLARE_MESSAGE_MAP()
  46. };
  47. extern CStatBar *g_pStatBarWnd;
  48. /******************************************************************************/
  49. // NON-OBJECT Status bar API, Uses global object pointer to the StatBar object
  50. void ShowStatusBar ( BOOL bShow = TRUE );
  51. BOOL IsStatusBarVisible ();
  52. void InvalidateStatusBar ( BOOL bErase = FALSE );
  53. void ClearStatusBarSize ();
  54. void ClearStatusBarPosition ();
  55. void ClearStatusBarPositionAndSize();
  56. void ResetStatusBar ();
  57. void SetStatusBarPosition ( const CPoint& pos );
  58. void SetStatusBarSize ( const CSize& size );
  59. void SetStatusBarPositionAndSize ( const CRect& rect );
  60. void SetPrompt ( LPCTSTR, BOOL bRedrawNow = FALSE );
  61. void SetPrompt ( UINT, BOOL bRedrawNow = FALSE );
  62. /******************************************************************************/
  63. #endif // __BAR_H__