On the Origin of CTabCtrlEx used in Tabbed Dialogs
-
Hello, this is a bit of a strange question: I have a CTabCtrlEx class that was passed to me for doing tabbed dialog forms: in substance it is a class that allows dialogs to be inscribed inside a tabbed control. It is probably a well known class but I cannot find the origin of it (maybe Jeff Prosise's, but I don't know for certain). Hence the question is, do you know any reference to this class in the literature ? I attach here the class itself ---- header ----
#if !defined(AFX_TABCTRLEX_H__INCLUDED_)
#define AFX_TABCTRLEX_H__INCLUDED_#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// TabCtrlEx.h : header file#define TBC_NO_IMAGE -1
class CTabCtrlEx : public CTabCtrl
{
private:
BOOL m_bDeleteItemDlg;
BOOL m_itemRectIsValid;
CRect m_itemDlgRect;
CDialog* m_pLastSelDlg;public:
CTabCtrlEx(BOOL bDeleteItemDlg = FALSE);
~CTabCtrlEx();BOOL InitItem(UINT nIDTemplate, CDialog\* pDlg, CDialog\* pParent); int AddItem(LPTSTR lpczText, CDialog\* pDlg, int nImage = TBC\_NO\_IMAGE); int GetItem(CDialog\* pDlg); int GetItem(LPCTSTR lpczText); CDialog\* GetNextItem(int nItem); BOOL RemoveItem(CDialog\* pDlg); BOOL RemoveItem(LPCTSTR lpczText); void RemoveAllItems(BOOL bDeleteDlg); CDialog\* GetSelectedItemDlg(); BOOL SetSelectedItemDlg(CDialog\* pDlg); void SetItemDlgRect(LPRECT lprect); BOOL GetItemDlgRect(LPRECT lprect); BOOL ShowSelectedItemDlg(); virtual BOOL DestroyWindow();
protected:
afx_msg void OnTcnSelchange(NMHDR *pNMHDR, LRESULT *pResult);
DECLARE_MESSAGE_MAP()
};//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.#endif // !defined(AFX_TABCTRLEX_H__INCLUDED_)
---- header ---- ---- body ----
// TabCtrlEx.cpp : implementation file
//#include "stdafx.h"
#include "TabCtrlEx.h"#ifdef _DEBUG
#define new DEBUG_NEW
#endif/////////////////////////////////////////////////////////////////////////////
// CTabCtrlEx dialog
CTabCtrlEx::CTabCtrlEx(BOOL bDeleteItemDlg /*FALSE*/)
{
m_bDeleteItemDlg = bDeleteItemDlg;
m_itemRectIsValid = FALSE;
m_pLastSelDlg = NULL;
}CTabCtrlEx::~CTabCtrlEx()
{
}BEGIN_MESSAGE_MAP(CTabCtrlEx, CTabCtrl)
ON_NOTIFY_REFLECT(TCN_SELCHANGE, OnTcnSelchange)
END_MESSAGE_MAP()BOOL CTabCtrlEx::DestroyWindow()
{
if(m_bDeleteItemDlg)
RemoveAllItems(m_bDeleteItemDlg);
return CTabCtrl::DestroyWindow();
}int CTabCtrlEx::AddItem(LPTSTR lpczText,
-
Hello, this is a bit of a strange question: I have a CTabCtrlEx class that was passed to me for doing tabbed dialog forms: in substance it is a class that allows dialogs to be inscribed inside a tabbed control. It is probably a well known class but I cannot find the origin of it (maybe Jeff Prosise's, but I don't know for certain). Hence the question is, do you know any reference to this class in the literature ? I attach here the class itself ---- header ----
#if !defined(AFX_TABCTRLEX_H__INCLUDED_)
#define AFX_TABCTRLEX_H__INCLUDED_#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// TabCtrlEx.h : header file#define TBC_NO_IMAGE -1
class CTabCtrlEx : public CTabCtrl
{
private:
BOOL m_bDeleteItemDlg;
BOOL m_itemRectIsValid;
CRect m_itemDlgRect;
CDialog* m_pLastSelDlg;public:
CTabCtrlEx(BOOL bDeleteItemDlg = FALSE);
~CTabCtrlEx();BOOL InitItem(UINT nIDTemplate, CDialog\* pDlg, CDialog\* pParent); int AddItem(LPTSTR lpczText, CDialog\* pDlg, int nImage = TBC\_NO\_IMAGE); int GetItem(CDialog\* pDlg); int GetItem(LPCTSTR lpczText); CDialog\* GetNextItem(int nItem); BOOL RemoveItem(CDialog\* pDlg); BOOL RemoveItem(LPCTSTR lpczText); void RemoveAllItems(BOOL bDeleteDlg); CDialog\* GetSelectedItemDlg(); BOOL SetSelectedItemDlg(CDialog\* pDlg); void SetItemDlgRect(LPRECT lprect); BOOL GetItemDlgRect(LPRECT lprect); BOOL ShowSelectedItemDlg(); virtual BOOL DestroyWindow();
protected:
afx_msg void OnTcnSelchange(NMHDR *pNMHDR, LRESULT *pResult);
DECLARE_MESSAGE_MAP()
};//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.#endif // !defined(AFX_TABCTRLEX_H__INCLUDED_)
---- header ---- ---- body ----
// TabCtrlEx.cpp : implementation file
//#include "stdafx.h"
#include "TabCtrlEx.h"#ifdef _DEBUG
#define new DEBUG_NEW
#endif/////////////////////////////////////////////////////////////////////////////
// CTabCtrlEx dialog
CTabCtrlEx::CTabCtrlEx(BOOL bDeleteItemDlg /*FALSE*/)
{
m_bDeleteItemDlg = bDeleteItemDlg;
m_itemRectIsValid = FALSE;
m_pLastSelDlg = NULL;
}CTabCtrlEx::~CTabCtrlEx()
{
}BEGIN_MESSAGE_MAP(CTabCtrlEx, CTabCtrl)
ON_NOTIFY_REFLECT(TCN_SELCHANGE, OnTcnSelchange)
END_MESSAGE_MAP()BOOL CTabCtrlEx::DestroyWindow()
{
if(m_bDeleteItemDlg)
RemoveAllItems(m_bDeleteItemDlg);
return CTabCtrl::DestroyWindow();
}int CTabCtrlEx::AddItem(LPTSTR lpczText,
federico.strati wrote:
do you know any reference to this class in the literature ?
What information are you after? You have the full source, so in one sense it is fully documented. Are you concerned about using copyrighted code?