Re: [MFC] DDX/DDV and DoDataExchange between nested PropertySheets
You still haven't answer my questions:
Originally Posted by VictorN
What exactly are you trying to achieve with the sheet resizing and what do all these magic numbers (10, 15) mean?
Besides, your code has memory leaks (at least in the case of m_poPropSheet->Create(...) fails...
Originally Posted by npuleio
Code:
BOOL CMyDialogDlg::OnInitDialog()
{
CDialog::OnInitDialog();
...
// Extra initialization here
m_poPropSheet = new CPropertySheet();
pageConfig = new CPage_Config( m_poPropSheet );
m_poPropSheet->AddPage(pageConfig);
DWORD dwStyle = WS_VISIBLE | WS_CHILD;
DWORD dwExStyle = WS_EX_LEFT|WS_EX_CONTROLPARENT;
if ( !m_poPropSheet->Create(this, dwStyle, dwExStyle) )
{
DestroyWindow();
return FALSE;
}
...
return TRUE; // return TRUE unless you set the focus to a control
}
Why do you create this property sheet in the heap?
Just declare the CPropertySheet instance, NOT a pointer, then create it...
Code:
// in the header:
protected:
HICON m_hIcon;
CPropertySheet m_PropSheet;
// in the .cpp:
if ( !m_PropSheet.Create(this, dwStyle, dwExStyle) )
{
DestroyWindow();
return FALSE;
}
Re: [MFC] DDX/DDV and DoDataExchange between nested PropertySheets
Hello Victor,
"What exactly are you trying to achieve with the sheet resizing and what do all these magic numbers (10, 15) mean?" <--- they are the space difference from the border of the CDialog where the width or the height has to be less than...
About this:
Code:
m_poPropSheet = new CPropertySheet();
I declared in .h the variable as you can see in the code pasted (there's a part which is the .h code), so it would be accessible in entire current document...
Re: [MFC] DDX/DDV and DoDataExchange between nested PropertySheets
In fact without using new and removing the *, it won't have a memory leak...tomorrow morning I'll fix it...
About the sizing propertysheet and tabcontrol of propertysheet itself how I could set correctly this SetWindowPos to have correct full right and bottom size?...
Re: [MFC] DDX/DDV and DoDataExchange between nested PropertySheets
HI Arjay....
since I got difficulties applying document/view methodology on propertysheets and pages... so I would ask you if it's appliable also to modeless propertysheets that methodology for DDX/DDV DoDataExchange?....
Re: [MFC] DDX/DDV and DoDataExchange between nested PropertySheets
Originally Posted by npuleio
HI Arjay....
since I got difficulties applying document/view methodology on propertysheets and pages... so I would ask you if it's appliable also to modeless propertysheets that methodology for DDX/DDV DoDataExchange?....
Re: [MFC] DDX/DDV and DoDataExchange between nested PropertySheets
Well, it looks like some child windows/controls are on the top...
But what did you expected as a result of your trial and error method with those magic numbers (1, 5, 8, 10, 15, 80,...)?
Re: [MFC] DDX/DDV and DoDataExchange between nested PropertySheets
Hello Victor and Arjay,
I have to measure with those magic numbers (1, 5, 8, 10, 15, 80,...) because there's always a space to fit it...
Anyway if you have a good suggest to fit sheets and pages in their client area without making them disappearing, I'd like a little help...
and since I have nested pages and sheets for example the next level sheet disappear...wonder why... I tried also with NULL in the place of &CWnd::wndBotton... (the IDC_PROGRESSBAR is only at bottom in top level sheet, that causes that - 65 in the code otherwise it would be hided)
Re: [MFC] DDX/DDV and DoDataExchange between nested PropertySheets
According to the sceenshot, it looks like another control is covering a portion of the sheet.
If you need more help with this, zip up a small sample project and post it here. Be sure to remove the debug and release folders and delete the .ncb file before you zip it.
Re: [MFC] DDX/DDV and DoDataExchange between nested PropertySheets
Hello Victor and Arjay,
I have three nested levels of Propertysheets... I need to make active by code a page in another sheet which is in another page.... how I could do that?....
Re: [MFC] DDX/DDV and DoDataExchange between nested PropertySheets
Originally Posted by npuleio
Hello Victor and Arjay,
I have three nested levels of Propertysheets... I need to make active by code a page in another sheet which is in another page.... how I could do that?....
Thanks in advance.
Ciao
Luigi
You probably want to rethink your design. Using nested property sheets is discouraged. 3 levels of nesting would really be a poor user experience.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.