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 » How to resize a docked control bar? Collapse All
Subject Author Date
Chun Pong Lau Jul 20, 2008 - 1:24 PM

Dear support team,


I know a resizable control bar can be sized initially or resize in floating mode. (i.e. by SetInitDesiredSizeFloating, SetInitDesiredSizeHorizontal, SetInitDesiredSizeVertical)


But I don’t know how to resize it when it is docked. It is very important to my project development. Please help.


Thanks a lot.


Regards,


Chun Pong

Chun Pong Lau Jul 28, 2008 - 1:37 PM

Suppose there are only two resizable control bars.


We can detect their common container by comparing locations with GetWindowRect().


How can we resize this container?

Technical Support Jul 30, 2008 - 4:01 AM

We can code some algorithm which resizes the bar and recursively resize all its parent containers. But if we invoke this algorithm for several different bars, esizing of some next bar will typically downsize previously resized bars. Please assume resizable control bars as fully resizable by user windows. Such bars are typically configured by the user once when he/she starts using application and then they never become resized.

Technical Support Jul 23, 2008 - 11:40 AM

Here is the sample that demonstrates how to manage floating control bars programmatically:

ChangeFloatingSize

You can use the same approach for docked control bars.

Chun Pong Lau Jul 23, 2008 - 1:44 PM

I am sorry to tell you that the methods used in the project only works for the floating control but NOT for the docked controls.


Please advice.


 

Technical Support Jul 25, 2008 - 5:21 AM

Here is the updated version of this sample application. We added two methods, CChangeFloatingSizeView::OnButtonWidth() and CChangeFloatingSizeView::OnButtonHeight(), which are very similar to the CChangeFloatingSizeView::OnButtonFloat() method from the previous version of this sample application.

Chun Pong Lau Jul 25, 2008 - 10:11 AM

What if we want to resize 2 control bars which are docked in the following way?



    m_wndResizableBar.DockControlBarInnerOuter( AFX_IDW_DOCKBAR_LEFT, false );

    m_wndResizableBar2.DockControlBarLTRB(60, &m_wndResizableBar, AFX_IDW_DOCKBAR_BOTTOM, true);


It seems both the advised functions OnButtonWidth() & OnButtonHeight() are not working then.

Technical Support Jul 26, 2008 - 10:46 AM

The two lines of code in your message dock two control bars into one row container bar. It’s possible to resize the entire container bar but not its parts because the size of its parts is managed by the container bar using proportional resizing algorithm. The same is true for tabbed bar containers.


Chun Pong Lau Jul 26, 2008 - 11:50 AM

Please advise us how to resize the entire container bar. It would really help.

Technical Support Jul 28, 2008 - 12:30 PM

It’s possible to get a pointer to the container bar and resize it, but the container bar can be placed inside other container bar and so on. For instance, one row of bars can be part of other column of bars and so on. As a result, there is not point even to try to resize control bars. The control bars are fully resizable by the user without any limits. But it’s not really possible to identify location of resizable bars and relative to its containers whcih makes programmatic control bar resizing unreasonable.