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 Tech Support » Docked bar problem Collapse All
Subject Author Date
Offer Har Nov 9, 2008 - 7:11 AM

I have a docked bar that I want to behave like this:


1) Docked to the left


2) No title


3) Cannot be closed


4) Cannot be moved from the left


5) Other bars can be tabbled into it


This is how I created it:



    m_wndBar.Create("Data", m_pChildFrm, 12001,
        WS_CHILD|WS_VISIBLE|CBRS_TOP|CBRS_TOOLTIPS|CBRS_FLYBY|CBRS_SIZE_DYNAMIC|CBRS_HIDE_INPLACE);
    m_wndBar.EnableDocking(CBRS_ALIGN_LEFT);
    m_wndBar.DockControlBarInnerOuter(AFX_IDW_DOCKBAR_LEFT, true, m_pChildFrm, true);

All is fine unless another control-bar is tabbed together with it - then I can start and move this bar around and close it.


The images below ilustrate the probelm:




Offer Har Nov 10, 2008 - 4:11 PM

I don’t understand why something so simple like preventing the closing of a control-bar should involve writing so much code, which I still don’t see how it can even do what I need:


I must have a control-bar that cannot be closed ever - the user have no way of bringing it back.


Ron.

Technical Support Nov 11, 2008 - 9:13 AM

Please implement the CExtControlBar::_ClosingIsEnabled() virtual method in your CExtControlBar-derived class and simply return false() from it. You should not implement your own tabbed bar class for this task. Your control bar will not be close-able. The tabbed group of bars with your bar will also not be close-able.

Offer Har Nov 11, 2008 - 3:31 PM

Thanks - I still have one problem.


When I tab another control-bar into this control-bar, I can start draging it around by tearing it with a drag from teh tab-control.


Can this be prevented?

Technical Support Nov 12, 2008 - 1:06 PM

It should not be difficult to make one of the control bars in the SDI sample application based on your control bar class. We would be happy to clarify what’s wrong in your bar class. It should not take much time.

Offer Har Nov 11, 2008 - 9:20 AM

Great! that’s exactly what I need - will try it out soon...

Technical Support Nov 10, 2008 - 11:46 AM

A tabbed bar group is also a kind of control bar. Here is the description of how to remove the "X"-button from bar caption and how to make Prof-UIS using your custom tabbed control bar class:

http://www.prof-uis.com/prof-uis/tech-support/faq/control-bars.aspx#how-to-remove-the-close-button-x-from-the-control-bar

So, you will have two control bar classes: a simple control bar and a tabbed group bar. Both of them can determine whether the control bar drag-n-dropping is enabled. If the CExtControlBar::_DraggingIsEnabled() virtual method returns false, the control bar drag-and-drop is not enabled. The simple control bar class should implement this method and simply return false from it. The tabbed bar should not implement this virtual method. It’s already implemented: the CExtDynControlBar::_DraggingIsEnabled() method invokes the CExtControlBar::_DraggingIsEnabled() virtual methods of all the control bars in container and returns false if some of contained bars does not allow drag-and-drop.


Offer Har Nov 10, 2008 - 4:12 PM

I don’t understand why something so simple like preventing the closing of a control-bar should involve writing so much code, which I still don’t see how it can even do what I need:


 


I must have a control-bar that cannot be closed ever - the user have no way of bringing it back.


 


Ron.