Click here to Skip to main content
15,897,371 members
Articles / Desktop Programming / MFC

CXTabCtrl: an easier tab control for dialogs and forms

Rate me:
Please Sign up or sign in to vote.
4.50/5 (32 votes)
26 Jun 2000 377.8K   7.8K   77  
An easier tab control
// TabInformation.cpp : implementation file
//

#include "stdafx.h"
#include "tabctrl.h"
#include "TabInformation.h"
#include "XTabCtrl.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CTabInformation dialog


CTabInformation::CTabInformation(CWnd* pParent /*=NULL*/)
	: CDialog(CTabInformation::IDD, pParent)
{
	//{{AFX_DATA_INIT(CTabInformation)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
	m_pTab = NULL;
}


void CTabInformation::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CTabInformation)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CTabInformation, CDialog)
	//{{AFX_MSG_MAP(CTabInformation)
	ON_EN_UPDATE(IDC_ID, OnUpdateId)
	ON_BN_CLICKED(IDOK, OnOk)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CTabInformation message handlers

void CTabInformation::OnUpdateId() 
{
	// TODO: If this is a RICHEDIT control, the control will not
	// send this notification unless you override the CDialog::OnInitDialog()
	// function to send the EM_SETEVENTMASK message to the control
	// with the ENM_UPDATE flag ORed into the lParam mask.
	
	// TODO: Add your control notification handler code here
	char cText[20];
	GetDlgItemText(IDC_ID, cText, 19);

	if (m_pTab)
		m_pTab->EnableTab(1, cText[0]);
}

void CTabInformation::OnOk() 
{
	// TODO: Add your control notification handler code here
	
}

void CTabInformation::OnCancel() 
{
	// TODO: Add extra cleanup here
	return;	
//	CDialog::OnCancel();
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Architect VisionOne AG
Switzerland Switzerland
XicoLoko is a brazilian developer based in Switzerland.

Comments and Discussions