#if !defined(AFX_MYTAB_H__A02A1E63_A40D_11D1_8640_CBEB69CC4D32__INCLUDED_)
#define AFX_MYTAB_H__A02A1E63_A40D_11D1_8640_CBEB69CC4D32__INCLUDED_

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
// MyTab.h : header file
//
#ifndef _MYTABINFO_
typedef struct _MyTabInfo
{
//	CRect   rcItem;
    CString strTag;
	CString strText;
	WPARAM  CommandID;
//	CRgn    rgnItem1;
//	CRgn    rgnItem2;
	POINT   points[4];
    LPARAM  uparam;
	struct _MyTabInfo* ptrNext;

} MYTABINFO, FAR* LPMYTABINFO;

#define _MYTABINFO_
#endif

/////////////////////////////////////////////////////////////////////////////
// CMyTab window

class CMyTab : public CWnd
{
// Construction
public:
	CMyTab();

// Attributes
public:
	COLORREF m_ColorBack;
// Operations
public:
	int     SetCurSel(int nItem);
	int     GetCurSel() { return (m_nCount==0) ? -1 : m_nCurSel; }
	CString GetItemText(int nItem);
    int     GetItemCount() { return m_nCount; }
	void    DeleteItem(int nItem);
	void    DeleteAllItems();

	void    SetItem(int nItem, LPCSTR szText, WPARAM CommandID);
    void    SetItemText(int nItem, LPCSTR szText);
	void    InsertItem(int nItem, LPCSTR szText, WPARAM CommandID);
    void    SetItemData(int nItem, LPARAM uParam);
    void    SetItemTag(int nItem, LPCSTR szText);
    CString GetItemTag(int nItem);
    int     FindItemTag(LPCSTR szText);
// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CMyTab)
	public:
	virtual BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CMyTab();

	// Generated message map functions
protected:
	//{{AFX_MSG(CMyTab)
		// NOTE - the ClassWizard will add and remove member functions here.
	afx_msg void OnPaint();
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnSize(UINT nType, int cx, int cy);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
private:
	int         m_dx;
	int         m_nItemWidth;
	int         m_nItemHeight;

	int         m_cxMargin;
	int         m_nCurSel;
	int         m_nCount;
	int         m_xScroll;
	BOOL        m_bScroll;
	CFont       m_font;
	CBrush      m_brBackgrnd;
	MYTABINFO m_ItemBase;

	LPMYTABINFO GetItemPtr(int nItem);
	void          RecalcItemArea();
	void          DrawItem(CDC* pDC, LPMYTABINFO lpItem, BOOL bSel);

};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_MYTAB_H__A02A1E63_A40D_11D1_8640_CBEB69CC4D32__INCLUDED_)
