home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 31 / CDASC_31_1996_juillet_aout.iso / vrac / wdj0796.zip / RAJA.ZIP / ZCAPFORM.H < prev   
C/C++ Source or Header  |  1996-03-08  |  2KB  |  60 lines

  1. /*
  2.     File: ZCapForm.h
  3.     Author: V.Ramachandran
  4.     Date: 07 March, 1996
  5.  
  6.     ZCaptionFormView is a form view with a caption, which can be used
  7.     anywhere, but most useful when used with a splitter window.
  8. */
  9.  
  10. #ifndef __ZCaptionFormView__
  11. #define __ZCaptionFormView__
  12.  
  13. #define DEFAULT_CAPTION_HEIGHT 15        // 15 arbitrary!
  14.  
  15. class ZCaptionFormView : public CFormView
  16. {
  17. public:
  18.     ZCaptionFormView (UINT nID, int nHeight = DEFAULT_CAPTION_HEIGHT) 
  19.                 : CFormView (nID), m_nCaptionHeight (nHeight), 
  20.                   m_bActive (FALSE)
  21.                 { ASSERT (m_nCaptionHeight >= 0); }
  22.     ZCaptionFormView (LPCSTR lpszTemplateName, 
  23.                 int nHeight = DEFAULT_CAPTION_HEIGHT) 
  24.                 : CFormView (lpszTemplateName), 
  25.                   m_nCaptionHeight (nHeight), m_bActive (FALSE)
  26.                 { ASSERT (m_nCaptionHeight >= 0); }
  27.  
  28. public:
  29.     int GetCaptionHeight () const { return m_nCaptionHeight; }
  30.     void SetCaptionHeight (int nHeight) 
  31.                 { 
  32.                     ASSERT (m_nCaptionHeight >= 0);
  33.                     m_nCaptionHeight = nHeight; 
  34.                 }
  35.     void GetCaption (CString& sCaption) { sCaption = m_sCaption; }
  36.     void SetCaption (LPCSTR szCaption) { m_sCaption = szCaption; }
  37.  
  38. protected:
  39.     virtual void OnActivateView (BOOL bActivate, CView *pActivateView,
  40.                     CView *pDeactivateView);
  41.     virtual void OnActivateFrame(UINT nState, CFrameWnd* pFrameWnd);
  42.     virtual void DoDrawCaption (CDC *pDC, const RECT& rect);
  43.  
  44.     // Generated message map functions
  45.     //{{AFX_MSG(CInfoView)
  46.     afx_msg LRESULT OnNcCalcSize(WPARAM wParam, LPARAM lParam);
  47.     afx_msg void OnNcPaint();
  48.     afx_msg UINT OnNcHitTest (CPoint point);
  49.     //}}AFX_MSG
  50.     DECLARE_MESSAGE_MAP()
  51.     DECLARE_DYNAMIC (ZCaptionFormView)
  52.  
  53. protected:
  54.     int m_nCaptionHeight;
  55.     CString m_sCaption;
  56.     BOOL m_bActive;        // TRUE if active, FALSE otherwise
  57. };
  58.  
  59. #endif // __ZCaptionFormView__
  60.