Instead of having everything in one large dialog box, I'm considering displaying child dialogs for individual groups of controls. The idea is that these are not free floating child dialogs, such as floating toolbars, but they will be displayed without a title, their position is locked in the parent dialog ... since you drag the parent dialog, any open child is also dragged.
NOTE: these child windows are not inside the parent dialog; they will usually be “glued” to the edge.
In MFC / VC ++ 2005, what is the best way to do this? For testing, I currently have a standard application setup based on MFC Dialog c CMainDlg, and then I created a widget dialog box CWidgetDlg. So far I have a member variable CWidgetDlg MainDlg::m_Widgetand a button on CMainDlgwith a type handler
CMainDlg::OnDisplayWidgetBtn()
{
m_Widget.ShowWindow(TRUE);
}
But of course, m_Widget doesn't have an HWND setting, and I'm trying to remember the right way to do this? I can use DDX to control dialog boxes, but what about child dialogs?
And is this a reasonable approach, or is there a more convenient, more automatic way?
source
share