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 » Is Controlbar docking affected by SetRedraw(FALSE)? Collapse All
Subject Author Date
Dave Kymlicka Apr 1, 2005 - 9:23 AM

I have to re-dock toolbars and controlbars many times during runtime (user is allowed to re-configure layout). During this process, I cannot show+hide the mainframe: must leave frame outline, main menu, status bar all visible.

My questions are:

1. If I use pMainFrame->SetRedraw(FALSE), are there any negative effects I need to worry about when re-docking toolbars and controlbars? Or will they re-dock OK? Please keep in mind I am using some of your wild docking techniques, such docking 3 controlbars together, sharing space across one row:

pBarA->DockControlBarInnerOuter( AFX_IDW_DOCKBAR_BOTTOM, false, FRM, true );
pBarB->DockControlBarLTRB( 66, pBarA, AFX_IDW_DOCKBAR_RIGHT, true );
pBarC->DockControlBarLTRB( 50, pBarB, AFX_IDW_DOCKBAR_RIGHT, true );


2. Is ControlBar docking affected by their visibility?
(Toolbar docking is affected by visibility, as we’ve discussed in another forum posting).


3. Is controlBar docking affected by Mainframe->SetRedraw(FALSE)? will their RecalcLayout() still work OK?



I am using:
CExtToolControlBar    // toolbars
CExtDynamicControlBar    // control bars
CExtTabMdiWhidbeyWnd // mdi tabs

Here’s pseudocode of what I’m trying to do:

class CMainFrame : public CMDIFrameWnd, public CExtDynamicBarSite
{
....
}

// hide all toolbars
// hide all controlbars

pMainframe->SetRedraw(FALSE);

// re-dock all toolbars according to new specified layout
// re-dock all controlbars according to new specified layout

// show only desired toolbars
// show only desired controlbars

pMainframe->SetRedraw(TRUE);

Technical Support Apr 3, 2005 - 12:01 PM

We never used the SetRedraw() method with regard to frame windows because it is not needed at all. You can try the StateInFile sample application: save GUI states in several files, load these files and make a conclusion about flickering. The methods for serializing control bars are the same as in case of docking them. There is one thing which may affect flickering in your project. It deals with visibility of a control bar. In case of any window but a control bar, you can use the window style flags and check whether WS_VISIBLE is on. In case of control bars, you need to use the CExtControlBar::IsVisible() method. This is because, the control bar’s window can be visible but, in fact, it may get hidden in some time when the CFrameWnd::RecalcLayout() method is invoked. The same is true for the case when the window is still hidden but in fact somewhere in code it has already forced to be shown and it will become displayed when CFrameWnd::RecalcLayout() is called. This technique (which is used both in MFC and Prof-UIS) effectively eliminates flickering when docking is used. So, the flicker free redocking feature is not based on SetRedraw() method. All CExtControlBar::DockControlBar...() methods have the bRecalcLayout parameter which you can set to false for the flicker free bar redocking.

Dave Kymlicka Apr 4, 2005 - 8:22 PM

Regrettably, I cannot use serialization for this particular feature because the docking information must be human-readable: I’m loading all this info from XML files.

Thanks for the advice, good to know ProfUIS shouldn’t be adversly affected by SetRedraw().