Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » can CExtResizeableDialog be Created out side of CExtWRB< ...>? Collapse All
Subject Author Date
violet zhu Apr 7, 2005 - 3:26 AM

i want to create a CExtResizeableDialog ,but i find that i can not map message for the button on it.so i derives a class from CExtResizeableDialog.but i find that i can not insert it into a CExtControlBar .how could i dock a CExtResizeableDialog,unless create it from Dialog template directly by the CExtRWB<CExtResizeableDialog> .can CExtRWB accept a CResizeableDialog which created  out size the control of it.


at all ,how could i dock a CExtResizeableDialog created indirectly from a template ?

Technical Support Apr 7, 2005 - 9:41 AM

Just rename CExtResizableDialog to CDialog, do all the mapping, and finally rename the dialog class back to CExtResizableDialog. This is caused by a drawback in Visual Studio that makes it impossible to generate message handlers for the classes based on templates.

violet zhu Apr 7, 2005 - 6:09 PM

i derived a class from CExtResizeableDialog,can create a insantance from Dialog template.how could i dock this instance on a CFrameWnd.i do not want to use CExtWRB to dock it.

Technical Support Apr 8, 2005 - 4:26 AM

We are sorry but it’s not clear what you mean. The dialog window as is is cannot be docked in the frame window. You can create CExtControlBar window and than create a dialog inside it. In this case, the control bar is a dockable container for your dialog.

violet zhu Apr 8, 2005 - 5:40 AM

how could i create a dialog inside of CExtControlBar?


if i create a dialog inside of a CExtControlBar ,should i must create it from Dialog template directly? Or can i use a class which is Derived from CExtResizeableDialog.

Technical Support Apr 8, 2005 - 11:45 AM

Just create the dialog as a child of an early created control bar:

// header
CExtControlBar m_wndResizableBar;
CExtWRB< CMyDialog > m_wndInBarDlg;
 
      // CMainFrame::OnCreate method
 
      if(   !m_wndResizableBar.Create(
                  _T("Resizable Bar"),
                  this,
                  ID_VIEW_RESIZABLE_BAR
                  )
            )
      {
            TRACE0("Failed to create m_wndResizableBar\n");
            return -1;        // fail to create
      }
 
      if( !m_wndInBarDlg.Create(
                  IDD_IN_BAR_DLG,
                  &m_wndResizableBar
                  )
            )
      {
            TRACE0("Failed to create m_wndInBarDlg\n");
            return -1;        // fail to create
      }
      m_wndInBarDlg.ShowSizeGrip( FALSE );
Please note that the dialog resource should be child, not popup.

It would be better if you use a dialog class derived from CExtResizeableDialog. We would also like to recommed you examine source code of the samples that come with Prof-UIS. That would allow you to use ready-to-use chunks of code.

violet zhu Apr 8, 2005 - 8:34 PM

thanks


 

violet zhu Apr 9, 2005 - 4:18 AM

a CExtControlBar Contains a CExtResizableDialog


how could i adjust the size of the CExtControlBar to fit the CExtResizableDialog.

Technical Support Apr 9, 2005 - 10:20 AM

We will give you an example when a resizable control bar is docked vertically. Invoke the following code when the control bar is initialized in the CMainFrame::OnCreate() method:

m_wndBar.SetInitDesizredSizeVertical(
   CSize( nDialogWidth + min( 4, ::GetSystemMetrics(SM_CXSIZEFRAME) ),
       nHeight 
   )
);
m_wndBar.DockControlBar...(...);
nDialogWidth is the dialog width in pixels and nHeight is the relative height. The latter is not used if your control bar is the single in its vertical column. If you dock several control bars in one column with the CExtControlBar::DockControlBar() method then the total height value of all control bars is assumed to be 100%. So use relative values to specify which part of the total height each bar should occupy. If you use the CExtControlBar::DockControlBarLTRB(nPercentToOccupy,...) method to dock several control bars into one column, then you should find manually the nPercentToOccupy percent values which will let your dialog become fully visible inside one of the resizable bars.