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 » MDI_InnerOuterBars and my request for control-bars inside a view Collapse All
Subject Author Date
Offer Har Nov 3, 2008 - 9:39 AM

Hi,


We’ve been having a thread about this issues:


http://www.prof-uis.com/prof-uis/tech-support/support-forum/how-to-make-cextcontrolbar-child-of-cview-62234.aspx#@lt;/p>

Ithink i’ll be able to fix most of my bugs using this sample, however, there is one issue that the sample does not solve:


3) The most problematic of all - I can still take the control-bar outside the view - my major requirement is that the control-bar will not leave the view, as the data in it is relevat only to that spefici view.


I must somehow make sure that the control-bar will not leave the view - in this sample you can drag the control-bar, for example Resizable Bar 1 outside of the MDI child window - which I must prevent.


You have to understand that I have many views, each have some embedded control-bars that contain some data that is relevant only to that view, and if it shows outside this view it becomes confusing and miss-leading.


In regular modelss floating dialogs this is a simple thing if setting the parent of the dialog.


Please help me on this one.


Thanks,


Ron.


 

Technical Support Nov 7, 2008 - 5:16 AM

This is not difficult. You should use your own CExtControlBar-derived class which implements the CExtControlBar::FloatControlBar() virtual method. Its code>ptFloat</code> parameter represents the left-top corner in screen coordinates. You should check these coordinates and make invocation of parent class method with adjusted/checked ptFloat parameter which will not allow control bar to appear outside the view window. The CExtControlBar::m_sizeFloated property contains the size of a control bar in floating state. The view window position in screen coordinates can be obtained by invoking its GetWindowRect() API.

Technical Support Nov 6, 2008 - 2:07 PM

It looks exactly like drag-n-dropping algorithm for resizable bars in Visual Studio .NET 2003.

Technical Support Nov 6, 2008 - 2:06 PM

Seems we really lost understanding of your technical task. We need more details about it. Please explain us how control bars you need should behave? How their floating state should differ from default floating state implemented in Prof-UIS control bars?

Offer Har Nov 6, 2008 - 2:15 PM

OK:


 


I have a view and a control-bar inside this view.


 


The control-bar is floating - I can dock it to the sides of the view - this is all good & well - used the InnerOuterBars as reference.


 


My other requirement is this:


 


When the control-bar is floating, and the user try to move it outside the view he will get stuck in the boundaries of the view - the control-bar will not be able leave the view.


 


Hope it is clearer now.

Technical Support Nov 7, 2008 - 5:15 AM

This is not difficult. You should use your own CExtControlBar-derived class which implements the CExtControlBar::FloatControlBar() virtual method. Its code>ptFloat</code> parameter represents the left-top corner in screen coordinates. You should check these coordinates and make invocation of parent class method with adjusted/checked ptFloat parameter which will not allow control bar to appear outside the view window. The CExtControlBar::m_sizeFloated property contains the size of a control bar in floating state. The view window position in screen coordinates can be obtained by invoking its GetWindowRect() API.

Technical Support Nov 3, 2008 - 1:22 PM

Resizable control bar can 100% avoid switching floating state if they use the Visual Studio .NET 2003 like drag-n-dropping algorithm. You can use resizable control bars which return the CExtControlBar::__RESIZABLE_DOCKING_TYPE_STUDIO_2003 value from the overridden CExtControlBar::OnQueryDockingType() virtual method. Or you can simply assign the CExtControlBar::__RESIZABLE_DOCKING_TYPE_STUDIO_2003 value to the CExtControlBar::g_eResizablePanelDockingType static property. Next step is overriding the CExtControlBar::FloatControlBar() and CExtControlBar::ToggleDocking() virtual methods. Both should have empty bodies. Such bars will not be able to switch into floating state and you will be able to re-dock them conveniently.

Offer Har Nov 5, 2008 - 6:05 AM

Dear Support - any thoughts on this matter?


I do want them to have a floating state, but when they are dragged I don’t want them to leave their parent, which is the view - like a child window behaves in default windows.

Technical Support Nov 6, 2008 - 1:29 PM

We think we understood you right when we advised you to switch to using Visual Studio .NET 2003 like control bar drag-n-dropping algorithm. This is the single available way to keep control bars non-floating when they being drag-n-dropped.

Offer Har Nov 6, 2008 - 1:34 PM

I’m not sure you did...


I do want the bar to be floating, only not outside the frame window that it is craeted in.

Offer Har Nov 3, 2008 - 1:30 PM

Dear Support,


Either I wasn’t completely clear or you did not understand my problem...


I do want them to have a floating state, but when they are dragged I don’t want them to leave their parent, which is the view - like a child window behaves in default windows.


Thanks,


Ron.

Offer Har Nov 6, 2008 - 2:13 PM

OK:


I have a view and a control-bar inside this view.


The control-bar is floating - I can dock it to the sides of the view - this is all good & well - used the InnerOuterBars as reference.


My other requirement is this:


When the control-bar is floating, and the user try to move it outside the view he will get stuck in the boundaries of the view - the control-bar will not be able leave the view.


Hope it is clearer now.