Click here to Skip to main content
15,885,886 members
Articles / Desktop Programming / MFC

Layout Manager for Dialogs, Formviews, DialogBars and PropertyPages

Rate me:
Please Sign up or sign in to vote.
4.92/5 (91 votes)
4 Aug 2000 967.3K   11.9K   320  
A framework to provide automatic layout control for dialogs and forms
// TabDialog.cpp: Implementierungsdatei
//

#include "stdafx.h"
#include "LayoutManager.h"
#include "TabDialog.h"

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

/////////////////////////////////////////////////////////////////////////////
// Dialogfeld CTabDialog 


CTabDialog::CTabDialog(CWnd* pParent /*=NULL*/)
	: ETSLayoutDialog(CTabDialog::IDD, pParent)
{
	//{{AFX_DATA_INIT(CTabDialog)
		// HINWEIS: Der Klassen-Assistent f�gt hier Elementinitialisierung ein
	//}}AFX_DATA_INIT
}


void CTabDialog::DoDataExchange(CDataExchange* pDX)
{
	ETSLayoutDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CTabDialog)
	DDX_Control(pDX, IDC_TAB1, m_Tab);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CTabDialog, ETSLayoutDialog)
	//{{AFX_MSG_MAP(CTabDialog)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// Behandlungsroutinen f�r Nachrichten CTabDialog 

BOOL CTabDialog::OnInitDialog() 
{
	ETSLayoutDialog::OnInitDialog();
	
	/* DialogMgr: Add this: */

	// Add some items to the tab
	m_Tab.InsertItem(0,_T("Test1"));
	m_Tab.InsertItem(1,_T("Test2"));
	m_Tab.InsertItem(2,_T("Test3"));
	m_Tab.InsertItem(3,_T("Test4"));
	m_Tab.InsertItem(4,_T("Test5"));
	m_Tab.InsertItem(5,_T("Test6"));

	// define the Tab (as a Pane)
	CPane tabPane = paneTab( &m_Tab, HORIZONTAL )
		<< item( IDC_LIST1 );

	CPane bottomPane = pane( HORIZONTAL, ABSOLUTE_VERT )
		<< itemGrowing(HORIZONTAL)
		<< item( IDOK, NORESIZE )
		<< item( IDCANCEL, NORESIZE );

	CreateRoot( VERTICAL )
		<< tabPane
		<< bottomPane;

	UpdateLayout ();
	/************************/	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX-Eigenschaftenseiten sollten FALSE zur�ckgeben
}

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
Web Developer
Germany Germany
independant software developer from Germany.
author of Euraconf, an isdn/pabx management software

Programmer since 1991, c/c++/java, started with professional games development, now mainly network, telecommunication and internet stuff

Comments and Discussions