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 » fail to change the size of docked control bar Collapse All
Subject Author Date
Dominik Braendlin Feb 8, 2010 - 8:12 AM

Dear Support,


I am trying to resize 4 docked control bars at runtime.  The first code snippet does the docking. The 2nd code snippet should resize the control bars. If there is only one contol bar docked it works but as soon as there is more than one control bar that is docked it fails. What is wrong.



m_wndMainItem0.SetInitDesiredSizeVertical(CSize(cxScreen * 3 / 5, 0));

m_wndMainItem0.DockControlBarInnerOuter(

AFX_IDW_DOCKBAR_LEFT,

m_wndMainItem0.DockControlBarIntoTabbedContainer(

&m_wndMainItem1, -1, NULL,

m_wndMainItem0.DockControlBarIntoTabbedContainer(

&m_wndMainItem2, -1, NULL,

m_wndMainItem0.DockControlBarIntoTabbedContainer(

&m_wndMainItem3, -1, NULL,

ShowControlBar(&m_wndMainItem0, TRUE, FALSE);

ShowControlBar(&m_wndMainItem1, TRUE, FALSE);

ShowControlBar(&m_wndMainItem2, TRUE, FALSE);

ShowControlBar(&m_wndMainItem3, TRUE, FALSE);

true);false);false);false);

//---------------------------------------------------------------------------

void

{

 

m_wndMainItem0.SetInitDesiredSizeVertical(CSize(nDesired, 32767));

m_wndMainItem0.CalcDynamicLayout(nDesired, LM_VERTDOCK|LM_COMMIT);

 

m_wndMainItem1.SetInitDesiredSizeVertical(CSize(nDesired, 32767));

m_wndMainItem1.CalcDynamicLayout(nDesired, LM_VERTDOCK|LM_COMMIT);

 

m_wndMainItem2.SetInitDesiredSizeVertical(CSize(nDesired, 32767));

m_wndMainItem2.CalcDynamicLayout(nDesired, LM_VERTDOCK|LM_COMMIT);

 

m_wndMainItem3.SetInitDesiredSizeVertical(CSize(nDesired, 32767));

m_wndMainItem3.CalcDynamicLayout(nDesired, LM_VERTDOCK|LM_COMMIT);

 

RecalcLayout();

}

CMainFrame::OnHomeSub2Item0()int nDesired = 250;

Thanks


Adrian



 



 

Technical Support Feb 9, 2010 - 7:46 AM

A tabbed group of resizable control bars is also a resizable control bar of the CExtDynTabControlBar type (CExtControlBar-derived of course). The CExtControlBar::_GetNearestTabbedContainer() API returns a pointer to the parent tabbed bar or NULL pointer if the queried bar is not inside the tabbed group. You should resize the tabbed bar group instead of the single bar.

Robert Fox Sep 20, 2010 - 7:55 AM


Thanks, that’s just what I needed. Moved from version 2.53 to 2.90 and suddenly my old way of setting desired sizes (sizing the bar itself and the bar I docked on) wasn’t working anymore. Using the nearest tabbed container works fine.


Jos Smit


Dominik Braendlin Feb 9, 2010 - 8:32 AM

Thank you. Now it works!

Technical Support Feb 8, 2010 - 12:47 PM

Please take a look at the following test project.

http://www.prof-uis.com/download/forums/ChangeFloatingSize3.zip


Dominik Braendlin Feb 9, 2010 - 12:17 AM

Thank you for the example. Unfortunately it seems that you are missing my point. I am well able to manage one Bar. My problem arises if there is more than one bar involved. I have four bars that are docked together as a group. That is when your code fails. I need an example that can cope with this kind of situation.

Adrian