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 » Same problem. Would be interested by your sample project. Collapse All
Subject Author Date
Christophe Guibert Sep 25, 2004 - 1:38 PM

Dear Sergiy,


I experience a very similar problem in a CFormView derived class using CExtToolControlBar.


I am interested by your sample project including a CFormView derived class with support of toolbars in any state (docked or floated).


Could send it to me ? Thank you.


Best Regards


Christophe Guibert


 

Technical Support Sep 28, 2004 - 6:15 AM

Dear Christophe,

In form views/child dialogs, the toolbar is most often statically docked at the top of the form/dialog. You may simply implement it either in the form view or in the child dialog window. Please add the custom control to the dialog’s resource and specify:


  • ProfUIS-ControlBar as the window class name

  • 0x50002034 value as the window style

  • some name as its control identifier (e.g., IDC_CUSTOM_CONTROL_ID)


The location of this control on the resource dialog does not matter because the toolbar window is attached to the top of the form automatically. Please add the wndToolBar property of the CExtToolControlBar type to your form or dialog class and DDX_Control( pDX, IDC_CUSTOM_CONTROL_ID, m_wndToolBar ) to the DoDataExchange method body. Put the code responsible for initializing the toolbar to OnInitDialog(). You may use either m_wndToolBar.SetButtons(...) or m_wndToolBar.LoadToolbar(...). Please insert RepositionBars( 0, 0xFFFF, 0 ) at the end of the OnInitDialog and OnSize methods. After that, you should see the static toolbar in the form view or child dialog.

To prevent the form view from displaying its scroll bars, you should modify the OnSize method, in which you need to call CWnd::OnSize() instead of CFormView::OnSize(). To remove the chevron button from your toolbar, use the class below (instead of CExtToolControlBar):
class C_NoChevron_ToolControlBar : 
           public CExtToolControlBar
{
   virtual CExtBarContentExpandButton * OnCreateBarRightBtn()
   {
      return NULL;
   }
};

The dockable toolbars (those that can be docked and undocked ) are always assumed to be part of the frame window and they cannot be part of a form view or a dialog. The same is also applicable to other dockable control bars.

Christophe Guibert Sep 29, 2004 - 2:28 AM

Dear Sir,


Thank you very much for these hints, I finally managed to have the toolbars correctly displayed (I had omitted the RepositionBars() call in the OnSize()method).


Best Regards,


 


Christophe Guibert