// MyDialog.cpp: Implementierungsdatei
//
#include "stdafx.h"
#include "LayoutManager.h"
#include "MyDialog.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// Dialogfeld CMyDialog
CMyDialog::CMyDialog(CWnd* pParent /*=NULL*/)
: ETSLayoutDialog(CMyDialog::IDD, pParent)
{
//{{AFX_DATA_INIT(CMyDialog)
// HINWEIS: Der Klassen-Assistent f�gt hier Elementinitialisierung ein
//}}AFX_DATA_INIT
}
void CMyDialog::DoDataExchange(CDataExchange* pDX)
{
ETSLayoutDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CMyDialog)
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CMyDialog, ETSLayoutDialog)
//{{AFX_MSG_MAP(CMyDialog)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// Behandlungsroutinen f�r Nachrichten CMyDialog
BOOL CMyDialog::OnInitDialog()
{
ETSLayoutDialog::OnInitDialog();
/* DialogMgr: Add this: */
// See article for comments
// define the Layout
// Possibility 1
CreateRoot(VERTICAL)
<< item ( IDC_NEW_ITEM_STATIC, NORESIZE )
<< ( pane(HORIZONTAL, ABSOLUTE_VERT )
<< item( IDC_NEW_ITEM, GREEDY )
<< item( IDC_ADD_ITEM, NORESIZE )
)
<< item ( IDC_ITEM_LIST_STATIC, NORESIZE )
<< item ( IDC_ITEM_LIST, GREEDY )
<< ( pane(HORIZONTAL, ABSOLUTE_VERT )
<< item( IDOK, RELATIVE_HORZ, 70 )
<< item( IDCANCEL, RELATIVE_HORZ, 30 )
);
UpdateLayout();
/*
// Possibility 2
CPane newItemPane=new Pane ( this, HORIZONTAL );
newItemPane->addItem ( IDC_NEW_ITEM, GREEDY );
newItemPane->addItem ( IDC_ADD_ITEM, NORESIZE );
CPane bottomPane=new Pane ( this, HORIZONTAL );
bottomPane->addItem ( paneNull, GREEDY );
bottomPane->addItem ( IDOK, NORESIZE );
bottomPane->addItem ( IDCANCEL, NORESIZE );
CreateRoot( VERTICAL );
m_RootPane->addItem ( IDC_NEW_ITEM_STATIC, NORESIZE );
m_RootPane->addPane ( newItemPane, ABSOLUTE_VERT );
m_RootPane->addItem ( IDC_ITEM_LIST_STATIC, NORESIZE );
m_RootPane->addItem ( IDC_ITEM_LIST, GREEDY );
m_RootPane->addPane ( bottomPane, ABSOLUTE_VERT );
UpdateLayout();
/*
/*
// Possibility 3
UpdateLayout (
paneVert()
<< item ( IDC_NEW_ITEM_STATIC, NORESIZE )
<< ( pane(HORIZONTAL, ABSOLUTE_VERT )
<< item( IDC_NEW_ITEM, GREEDY )
<< item( IDC_ADD_ITEM, NORESIZE )
)
<< item ( IDC_ITEM_LIST_STATIC, NORESIZE )
<< item ( IDC_ITEM_LIST, GREEDY )
<< ( pane(HORIZONTAL, ABSOLUTE_VERT )
<< item( paneNull, GREEDY )
<< item( IDOK, NORESIZE )
<< item( IDCANCEL, NORESIZE )
);
);
*/
/************************/
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX-Eigenschaftenseiten sollten FALSE zur�ckgeben
}
// Only horizontally sizable
////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// Dialogfeld CMyDialogHorz
CMyDialogHorz::CMyDialogHorz(CWnd* pParent /*=NULL*/)
: ETSLayoutDialog(CMyDialogHorz::IDD, pParent)
{
//{{AFX_DATA_INIT(CMyDialogHorz)
// HINWEIS: Der Klassen-Assistent f�gt hier Elementinitialisierung ein
//}}AFX_DATA_INIT
}
void CMyDialogHorz::DoDataExchange(CDataExchange* pDX)
{
ETSLayoutDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CMyDialogHorz)
// HINWEIS: Der Klassen-Assistent f�gt hier DDX- und DDV-Aufrufe ein
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CMyDialogHorz, ETSLayoutDialog)
//{{AFX_MSG_MAP(CMyDialogHorz)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// Behandlungsroutinen f�r Nachrichten CMyDialogHorz
BOOL CMyDialogHorz::OnInitDialog()
{
ETSLayoutDialog::OnInitDialog();
/* DialogMgr: Add this: */
// See article for comments
// define the Layout
CPane newItemPane = pane( HORIZONTAL, ABSOLUTE_VERT )
<< item( IDC_NEW_ITEM, GREEDY )
<< item( IDC_ADD_ITEM, NORESIZE );
CPane bottomPane = pane ( HORIZONTAL, ABSOLUTE_VERT )
<< itemGrowing(HORIZONTAL)
<< item( IDOK, NORESIZE )
<< item( IDCANCEL, NORESIZE );
CreateRoot( VERTICAL )
<< item( IDC_NEW_ITEM_STATIC, NORESIZE )
<< newItemPane
<< item( IDC_ITEM_LIST_STATIC, NORESIZE )
// This line is the difference to CMyDialog !!!
<< item( IDC_ITEM_LIST, ABSOLUTE_VERT )
<< bottomPane;
UpdateLayout ();
/************************/
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX-Eigenschaftenseiten sollten FALSE zur�ckgeben
}
// Only vertically sizable
////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// Dialogfeld CMyDialogVert
CMyDialogVert::CMyDialogVert(CWnd* pParent /*=NULL*/)
: ETSLayoutDialog(CMyDialogVert::IDD, pParent)
{
//{{AFX_DATA_INIT(CMyDialogVert)
// HINWEIS: Der Klassen-Assistent f�gt hier Elementinitialisierung ein
//}}AFX_DATA_INIT
}
void CMyDialogVert::DoDataExchange(CDataExchange* pDX)
{
ETSLayoutDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CMyDialogVert)
// HINWEIS: Der Klassen-Assistent f�gt hier DDX- und DDV-Aufrufe ein
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CMyDialogVert, ETSLayoutDialog)
//{{AFX_MSG_MAP(CMyDialogVert)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// Behandlungsroutinen f�r Nachrichten CMyDialogVert
BOOL CMyDialogVert::OnInitDialog()
{
ETSLayoutDialog::OnInitDialog();
/* DialogMgr: Add this: */
// See article for comments
// define the Layout
CPane newItemPane = pane( HORIZONTAL, ABSOLUTE_VERT )
// This line is different from CMyDialog !!!
<< item( IDC_NEW_ITEM, ABSOLUTE_HORZ )
<< item( IDC_ADD_ITEM, NORESIZE );
CPane bottomPane = pane ( HORIZONTAL, ABSOLUTE_VERT )
// This line is different from CMyDialog !!!
<< item( paneNull, ALIGN_FILL_HORZ | ABSOLUTE_HORZ)
<< item( IDOK, NORESIZE )
<< item( IDCANCEL, NORESIZE );
CreateRoot( VERTICAL )
<< item( IDC_NEW_ITEM_STATIC, NORESIZE )
<< newItemPane
<< item( IDC_ITEM_LIST_STATIC, NORESIZE )
// This line is the difference to CMyDialog !!!
<< item( IDC_ITEM_LIST, ABSOLUTE_HORZ )
<< bottomPane;
UpdateLayout ();
/************************/
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX-Eigenschaftenseiten sollten FALSE zur�ckgeben
}