Nested Dialogs Example ?
genady -- genady@radmail.rad.co.il
Thursday, January 09, 1997
Environment: VC++ 4.2b, Win 95
Hello.
Can anybody point me to a good example of nested dialogs ( not a common
FileOpen Dialog ).
Thanx in advance.
<--------------------------> ///||\\\
< Yakubovich Gennady > /_ _ )
< genady@radmail.rad.co.il > ( . . )
< 972-3-6459408 > ( / )
<-----------------------------oOOo---- _ -------oOOo--->
Jim Lawson Williams -- jimlw@mail.ccur.com.au
Monday, January 13, 1997
[Mini-digest: 2 responses]
At 07:01 AM 9/01/97 +0200, genady@radmail.rad.co.il (genady) wrote:
>Environment: VC++ 4.2b, Win 95
>
>
>Hello.
>Can anybody point me to a good example of nested dialogs ( not a common
>FileOpen Dialog ).
>
G'day!
Not sure want you want.
The bits appended have been abstracted from an application. Hopefully they makes sense after the surgery.
Regards,
Jim LW
void COuterDlg::OnSpecial()
{
//User does not like list selections,
//& requests control of variables:
CInnerDlg dlg;
dlg.m_VarsInnerDlg = m_VarsOuterDlg;
if (m_nChoice == 0)
{
//Selection from list is "User Defined"
dlg.m_VarsInnerDlg.m_nVar1 =
dlg.m_VarsInnerDlg.m_nVar2 = 0;
}
if (dlg.DoModal() == IDOK)
{
m_VarsOuterDlg = dlg.m_VarsInnerDlg;
CDialog::OnOK();
}
else
{
m_Cancel.SetFocus();
}
}
///////////////////////////////////////////////////////////////////////////////
// CInnerDlg dialog
CInnerDlg::CInnerDlg(CWnd* pParent /*=NULL*/)
: CDialog(CInnerDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CInnerDlg)
//}}AFX_DATA_INIT
}
void CInnerDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CInnerDlg)
DDX_Text(pDX, IDC_VAR1, m_nVar1);
DDV_MinMaxFloat(pDX, m_nVar1, 1.0, 1999.0);
DDX_Text(pDX, IDC_VAR2, m_nVar2);
DDV_MinMaxFloat(pDX, m_nVar2, 1., 1999.);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CInnerDlg, CDialog)
//{{AFX_MSG_MAP(CInnerDlg)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
////////////////////////////////////////////////////////////////////////
// CInnerDlg message handlers
BOOL CInnerDlg::OnInitDialog()
{
m_nDisplay1 = m_VarsInnerDlg.m_nVar1;
m_nDisplay2 = m_VarsInnerDlg.m_nVar2;
CDialog::OnInitDialog();
//now set to filter the input via CEditNumbersInLine --
//substitute our controls for the standard CEdit boxes:
if ( !m_editNumbers1.CreatedOK()
||!m_editNumbers2.CreatedOK()
||!m_editNumbers1.SubclassDlgItem(IDC_VAR1,this)
||!m_editNumbers2.SubclassDlgItem(IDC_VAR2,this))
{
EndDialog(IDCANCEL);
return FALSE;
}
//set 'em "unsigned":
m_editNumbers1.SetUnsignedFlag(TRUE);
m_editNumbers2.SetUnsignedFlag(TRUE);
if (m_VarsInnerDlg.m_bMetric)
{
//dealing in millimeters, so no fractions:
m_editNumbers1.SetNoFractionsFlag(TRUE);
m_editNumbers2.SetNoFractionsFlag(TRUE);
}
CenterWindow();
return TRUE; // return TRUE unless you set the focus to a control
}
void CInnerDlg::OnOK()
{
if (UpdateData(TRUE))
{
m_VarsInnerDlg.m_nVar1 = m_nDisplay1;
m_VarsInnerDlg.m_nVar2 = m_nDisplay2;
CDialog::OnOK();
}
}
>From the BBC's "Barchester Chronicles":
"I know that ultimately we are not supposed to understand.
But I also know that we must try."
-- the Reverend Septimus Harding, crypt-analyst, clog-dancer, C++ programmer
-----From: dima@ssm6000.samsung.ru (Dulepov Dmitry)
[Mailer: "Groupware E-Mail". Version 1.02.054]
>Can anybody point me to a good example of nested dialogs ( not a common
>FileOpen Dialog ).
What do you mean under 'nested dialogs' ? I didn't understand.
Dmitry A. Dulepov
Samsung Electronics Co., Ltd.
Russian Research Center
Phone: +7 (095) 213-9207
Fax: +7 (095) 213-9196
E-mail: dima@src.samsung.ru
====================================
| Вернуться в корень Архива
|