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 » How to put CExtToolControlBar into CExtControlBar Collapse All
Subject Author Date
Kenan Hrustanovic Feb 25, 2005 - 10:06 AM

 


Hello dear support team,


thanks for very nice GUI and for quick and good customer support!


I would like, in my SDI-App, to put an non-redockable CExtToolControlBar into CExtControlBar that contents an CExtResizableDialog.


Is there any way to do that?


For Example, I have a Window with AVI-Screen in my CExtControlBar and I wish an control (play, stop,...) Toolbar directly over or below this screen.


Thanks, Kenan.

Technical Support Feb 26, 2005 - 2:34 PM

Any kind of control bar provided with Prof-UIS can be used in the non-redockable mode. Please take a look at the control bars in the FixedSizePanels sample application (some of the control bars are initially invisible) and tell us which of them best fit your requirements.

Kenan Hrustanovic Feb 27, 2005 - 12:36 PM

P.S.:


If anyone want to know how to put CExtToolControlBar into CExtResizableDialog:


1. Create IDR_MYTOOLBAR toolbar


2. Insert into MainFrm.h file:


public:
  CExtToolControlBar m_wndToolBarControl;


3. Insert into ’OnCreate’ method of CMainFrame:


...


ASSERT( m_wndToolBarControl.GetSafeHwnd() != NULL );


  if( !m_wndToolBarControl.LoadToolBar( IDR_MYTOOLBAR ) )
  {
    ASSERT( FALSE );
    return FALSE;
  }


// If you want bAllOOn toolbars :)
  m_wndToolBarControl.m_bForceBalloonGradientInDialogs = TRUE;
  
  CWnd::RepositionBars(0,0xFFFF,0);


...


 

Kenan Hrustanovic Feb 27, 2005 - 12:11 PM

Hello and thanks to support team,


sorry if I was faint descripting my problem, it was this one:


- Putting ToolBar into Dialog


:) yes I know, sometime are simple things so unreachable :)


greetings


 

Technical Support Feb 28, 2005 - 11:42 AM

You can use Prof-UIS toolbars in dialogs or other windows and this is not difficult to implement. Of course, the toolbars cannot be dockable in this case. Please run the ProfStudio application and you will see that there are many toolbars like you need. For instance, the Class View window is implemented as a resizable dialog (IDD_DIALOG_CLASSVIEW ) with a toolbar and a tree-view control inside. You could use this construction in your project. Just create a dialog resource in your project and set the same properties for it as in the IDD_DIALOG_CLASSVIEW dialog of the ProfStudio project, copy or create the IDC_CLASS_VIEW_TOOLBAR custom control and define one or more controls to occupy the rest of the dockable dialog. You will also need to stick the toolbar to the dialog side. Here are what you need to do in the code:

1) Define the CExtToolControlBar m_wndToolBar; property in your dockable dialog class and add the following line to the DoDataExchange() method of your dialog class:

DDX_Control(pDX, IDC_CLASS_VIEW_TOOLBAR, m_wndToolBar); 
2) Invoke wndToolBar.LoadToolbar(...) in the OnInitDialog() method 3) Add this line at the end of the OnInitDialog() method:
RepositionBars(0,0xFFFF,IDC_TREE_CLASS_VIEW); 

The IDC_TREE_CLASS_VIEW value corresponds to the dialog control identifier of the window that should fit the rest of the dialog space.

4) Add a WM_SIZE message handler like the following to make both the toolbar and control occupy valid parts of the dockable dialog:
void CProfStudioClassView::OnSize(UINT nType, int cx, int cy) 
    {
        CExtResizableDialog::OnSize(nType, cx, cy);
        RepositionBars(0,0xFFFF,IDC_TREE_CLASS_VIEW);
    }