00001 #if !defined(AFX_TABCTRL_H__D49FEF61_C92E_11D5_9AFA_00D04C390250__INCLUDED_)
00002 #define AFX_TABCTRL_H__D49FEF61_C92E_11D5_9AFA_00D04C390250__INCLUDED_
00003
00004 #if _MSC_VER > 1000
00005 #pragma once
00006 #endif // _MSC_VER > 1000
00007
00008 #include "MyList.h"
00009 #include "MyControl.h"
00010 #include "MyImageList.h"
00011
00012
00013
00014
00015 typedef enum _ENotifyTabCtrl
00016 {
00017 TabCtrlNothing,
00018 TabCtrlClickOnItem,
00019 TabCtrlClickOnIcon,
00020 TabCtrlClickRightOnIcon,
00021 TabCtrlChange
00022 } ENotifyTabCtrl;
00023
00024 class CMyTabCtrl : public CMyControl
00025 {
00026 public:
00027 CMyImageList imageList;
00028
00029 CMyTabCtrl (HWND hWndTab);
00030 CMyTabCtrl ();
00031 virtual ~CMyTabCtrl() { Reset(); }
00032
00033 BOOL operator=(HWND hWnd);
00034
00035 int Add (HWND hWndChild,char *title,BOOL show=FALSE);
00036 BOOL Sup (int index,BOOL viewNear=TRUE);
00037 BOOL Rename (int index,char *text);
00038
00039 BOOL Reset ();
00040
00041 int FindPage (char *title);
00042
00043 HWND operator [](char *title);
00044 HWND operator [](int index) { return m_hWndChilds[index]; }
00045
00046 ENotifyTabCtrl Notify (LPARAM lParam);
00047
00048 int GetCurPage ();
00049 int GetNbPage ();
00050 BOOL ShowPage (int index);
00051
00052 void Highlight (int index,BOOL state);
00053 BOOL SetImage (int indexTab,int indexImage);
00054
00055 int HitTest (int x,int y,BOOL *isNoWhere,BOOL *isOnItem,BOOL *isOnItemIcon,BOOL *isOnItemLabel);
00056
00057 BOOL iconIsButton;
00058 private:
00059 BOOL m_firstChild;
00060 MyList<HWND> m_hWndChilds;
00061
00062 void Init();
00063 };
00064
00065 #endif // !defined(AFX_TABCTRL_H__D49FEF61_C92E_11D5_9AFA_00D04C390250__INCLUDED_)