Click here to Skip to main content
15,884,099 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 966.4K   11.9K   320  
A framework to provide automatic layout control for dialogs and forms
// CtrlDialog.cpp: Implementierungsdatei
//

#include "stdafx.h"
#include "LayoutManager.h"
#include "CtrlDialog.h"

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

/////////////////////////////////////////////////////////////////////////////
// Dialogfeld CCtrlDialog 


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


void CCtrlDialog::DoDataExchange(CDataExchange* pDX)
{
	ETSLayoutDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CCtrlDialog)
		// HINWEIS: Der Klassen-Assistent f�gt hier DDX- und DDV-Aufrufe ein
	//}}AFX_DATA_MAP
}


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

/////////////////////////////////////////////////////////////////////////////
// Behandlungsroutinen f�r Nachrichten CCtrlDialog 

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

	CPane checkPane = pane( VERTICAL )
		<< item( IDC_CHECK1, NORESIZE)
		<< itemGrowing(VERTICAL)
		<< item( IDC_CHECK2, NORESIZE)
		<< itemGrowing(VERTICAL)
		<< item( IDC_CHECK3, NORESIZE);

	// note the usage of sizeExtraBorder and sizeTopExtra
	CPane groupPane = paneCtrl( IDC_GROUP1, HORIZONTAL, GREEDY, nDefaultBorder, 10, 10 )
		<< checkPane
		<< item( IDC_LIST1, GREEDY );

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

	CreateRoot(VERTICAL)
		<< groupPane
		<< 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