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 » Problem specifying the size of a floating CExtControlBar when initial state is hidden Collapse All
Subject Author Date
Shane Blackburn Jul 20, 2006 - 3:34 PM

Hi,

I’m having a bit of a problem specifying the size of a floating CExtControlBar when its initial state is off. This problem is in my application but it can be easily demonstrated with the MDI sample application. In the file MainFrm.cpp around line 369, change the following code:

m_wndResizableBar3.DockControlBar(AFX_IDW_DOCKBAR_BOTTOM,4,this,false);

to:

m_wndResizableBar3.SetInitDesiredSizeFloating(CSize(300,300));
m_wndResizableBar3.FloatControlBar(CPoint(100,100));
ShowControlBar(&m_wndResizableBar3,false,false);

Note: Make sure there is not a state saved so CExtControlBar::ProfileBarStateLoad fails, or the above code will not be called.

The initial state of Resizable Bar 3 is hidden, exactly what I want. But when you turn on Resizable Bar 3, its window size is really tiny and not the 300,300 I asked for.

Any help would be much appreciated.

Thanks,
Mike

Technical Support Jul 21, 2006 - 5:15 AM

If the initial docked or floating position of a control bar was already set before invoking CExtControlBar::FloatControlBar(), you should forcibly re-compute the layout of control bar’s parent floating mini frame window:

CExtControlBar * pBar = . . .
pBar->SetInit . . .
pBar->FloatControlBar( . . . )
pBar->GetParentFrame()->RecalcLayout();
Here is a smal sample designed to demonstrate how to change the size and position of a floating control bar.