home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 21 / IOPROG_21.ISO / SOFT / DEMOT.ZIP / Src / Include / TabCtrlBar.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-23  |  2.2 KB  |  84 lines

  1. // TabCtrlBar.h : header file
  2. // This class is based on the article "Sizing TabControlBar"
  3. // written by Dirk Clemens. My modifications marked *** KStowell
  4. // http://www.codeguru.com/docking/sizing_tabctrl_bar.shtml
  5. //////////////////////////////////////////////////////////////////////
  6.  
  7. #if !defined(TABCTRLBAR_H_INCLUDED)
  8. #define TABCTRLBAR_H_INCLUDED
  9.  
  10. #if _MSC_VER >= 1000
  11. #pragma once
  12. #endif // _MSC_VER >= 1000
  13.  
  14. typedef struct {
  15.     CWnd *pWnd;
  16.     char szLabel[32];
  17. }TCB_ITEM;
  18.  
  19. #include <afxtempl.h>
  20. #include "ControlBarEx.h"
  21.  
  22. /////////////////////////////////////////////////////////////////////////////
  23. // CTabCtrlBar class
  24.  
  25. class CLASS_EXPORT CTabCtrlBar : public CControlBarEx
  26. {
  27.     DECLARE_DYNAMIC(CTabCtrlBar)
  28.  
  29. // Construction
  30. public:
  31.     CTabCtrlBar();
  32.  
  33. // Attributes
  34. public:
  35.     CTabCtrl m_tabctrl;
  36.  
  37. // Operations
  38. public:
  39.  
  40. // Overrides
  41.     // ClassWizard generated virtual function overrides
  42.     //{{AFX_VIRTUAL(CTabCtrlBar)
  43.     //}}AFX_VIRTUAL
  44.  
  45. // Implementation
  46. public:
  47.     void ModifyTabStyle(DWORD dwRemove, DWORD dwAdd);
  48.     void SetActiveView(int nNewTab);
  49.     void SetActiveView(CRuntimeClass *pViewClass);
  50.     void SetImageListEx( UINT nID, UINT nSz, COLORREF clr );
  51.     void RemoveView(int nView);
  52.     CView* GetActiveView();
  53.     CView* GetView(int nView);
  54.     CView* GetView(CRuntimeClass *pViewClass);
  55.     BOOL AddView(LPCTSTR lpszLabel, CRuntimeClass *pViewClass, CCreateContext *pContext = NULL);
  56.     virtual ~CTabCtrlBar();
  57.  
  58. // Generated message map functions
  59. protected:
  60.     //{{AFX_MSG(CTabCtrlBar)
  61.     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  62.     afx_msg void OnTabSelChange(NMHDR* pNMHDR, LRESULT* pResult) ;
  63.     afx_msg void OnWindowPosChanged(WINDOWPOS FAR* lpwndpos);
  64.     //}}AFX_MSG
  65.     DECLARE_MESSAGE_MAP()
  66.  
  67. protected:
  68.     int                m_nActiveTab;
  69.     int                m_nItem;
  70.     bool            m_bEnable;
  71.     CView*            m_pActiveView;
  72.     CImageList        m_images;
  73.     CToolTipCtrl*    m_tooltip;
  74.     CList <TCB_ITEM *,TCB_ITEM *> m_views;
  75. };
  76.  
  77. /////////////////////////////////////////////////////////////////////////////
  78.  
  79. //{{AFX_INSERT_LOCATION}}
  80. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  81.  
  82. #endif // !defined(TABCTRLBAR_H_INCLUDED)
  83.  
  84.