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 » Preventing CExtControlBar from floating. Collapse All
Subject Author Date
Ken Knapton Oct 27, 2004 - 4:47 PM

First of all, thank you for your great product and awesome support.


I am implementing several child windows inside of a CExtTabPageContainerWnd, and inside each of these child windows, i want to have several dockable windows ( I am currently using the CExtControlBar class for the implementation ).  The problem however comes when I float one of the child’s control bars.  If I then move to a different page using the tabs, the child window’s control bar is still visible and is floating.  Is there a way to disable a CExtControlBar from floating so that it is restricted to only being able to dock against the sides of it’s parent ( or inside another sibling CExtControlBar of course )?


Any help would be much appreciated.


Thank you

Ken Knapton Oct 28, 2004 - 9:34 AM

Thank you for the quick response.  At first it seemed to not be docking at all when i used my derived class, but after switching the paint manager to something other than CExtPaintManagerStudio2005,


it worked fine. So there appears to be a bug in the Studio2005 style that prevents it from docking. Consequently this is the style I was hoping to use.... again, any help would be very appreciated.


Thank you again for the fast response.


p.s. Here is my derived class. Very quick and simple like you suggested.


class CExtNoFloatControlBar : public CExtControlBar { public: virtual void ToggleDocking() { } virtual void FloatControlBar( CPoint ptFloat, DWORD dwStyle = CBRS_ALIGN_TOP ) { } };

Technical Support Oct 28, 2004 - 1:58 AM

What you need to do is to create a CExtControlBar-derived class and override these two methods:

virtual void ToggleDocking();    
virtual void FloatControlBar( 
     CPoint ptFloat, 
     DWORD dwStyle = CBRS_ALIGN_TOP 
); 

Both methods should do nothing.

Ken Knapton Oct 28, 2004 - 5:10 PM

I apologize for bombarding you with messages before you have a chance to respond.  After making the above changes, i have noticed some erratic behavior when docking the two bars that i have in the window.   When i dock them inside each other ( so they become tabbed ), if i try a few times, i can get the dockbars to float.  If i then pull one of the dockbars tabbed with each other OUT of the tabbed configuration and try to float it, it dissapears.  After it dissapears, any attempts to move the other dockbar results in an assertion on line 1454 of extcontrolbartabbedfeatures.cpp.


Thanks.

Ken Knapton Oct 28, 2004 - 9:35 AM

sorry, replied to the wrong message.... please look above ;)


Thanks

Technical Support Oct 29, 2004 - 9:08 AM

There is one important difference in the drag-and-drop algorithms for Visual Studio NET and Visual Studio 2005. When you are dragging a resizable control bar and any style except for Visual Studio 2005 is applied, the resizable control bar itself remains sit in its previous position and you only see its representation outline moving around or its temporary tabs in tab containers. It finally takes its new position only after you release the left mouse button. If you press the ESC key, the drag-and-drop operation’s canceled and resizable bar remains sit in its previous position.

In case of Visual Studio 2005, a resizable bar being dragged is constantly changing its real location. The previous locations are lost. So, unfortunately it is impossible to prevent the control bar from get floating in this case. In fact, this docking algorithm does not work at all if your resizable control bar cannot be floating.

You may only use the .NET algorithm and 2005 style together. The ProfStudio sample allows you to do this optionally. Please take a look at the CMainFrame::OnDockingAlgorithmDefaultByTheme, CMainFrame::OnDockingAlgorithm2003, and CMainFrame::OnDockingAlgorithm2005 methods in this sample.

We wonder why you decided to prevent the control bars from being floated. Because of some inconvenience for your users, for or some other reason?

Ken Knapton Nov 1, 2004 - 3:53 PM

Thanks, I’ve implemented removed the floating capabilities, and reassigned the docking algorithm to 2003 so I can still maintain the 2005 look.  Have you been able to reproduce and possibly solve the unpredictable behavior with floating toolbars and exceptions I was receiving?


Thanks

Technical Support Nov 2, 2004 - 5:52 AM

To prevent control bars from being floating when the docking algorithm 2005 is used, we need to implement some kind of temporary windows look like resizable control bars being drag-and-dropped. To do this is not easy and does not make Prof-UIS much better. Besides, the floating control bars may be very useful and convenient in most applications.