Professional UI Solutions
Site Map   /  Register


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 » Prevent not visible CExtControlBar children from painting Collapse All
Subject Author Date
Jos Smit Jan 22, 2008 - 2:41 AM

I’m sure the answer to this question is in the documentation somewhere, but I really cannot find it.

In my app I have 11 CExtControlBar instances, and typically most of them are invisible because they are docked in a tabbed container. All control bar clients are always painted, even if they are hidden behind other tabbed control bars. I want to prevent the invisible ones from painting because resizing the app is a very flashing experience this way.

So i tried to catch the OnPaint message and want to implement something like this:
if (this bar is visible) CExtControlBar::OnPaint();

However I cannot find the condition for the ’if’. I tried CExtControlBar::IsBarWindowActive(), CExtControlBar::IsVisible(), CExtControlBar::IsWindowVisible(), CFrameWnd::IsWindowVisible(), but they all did not do what I need.

Can you gues help me on this?

Jos Smit

Jos Smit Jan 22, 2008 - 5:39 AM

Thank you Suhai. It works just the way I need it!

I did not know there were good computer guys in Hungary, but now I do. Thanks again.

Suhai Gyorgy Jan 22, 2008 - 4:51 AM

I have found this in a previous post. It was for CExtDynamicControlBar, but I think it works for you as well:

CExtControlBar * pBar = ...
      If( pBar == NULL )
            return . . . // we are in the document mode
      if( pBar->IsVisible() )
            return . . . // bar is hidden or auto-hidden
CExtDynTabControlBar * pTabbed = pBar->_GetNearestTabbedContainer();
      If( pTabbed == NULL )
            return . . . // bar is not in the tabbed group
LONG nSelectedTabIndex = pTabbed->GetSwitcherSelection();
      If( nSelectedTabIndex < 0 )
            return . . . // this can happen only during bar drag-n-drop
CExtControlBar * pSelectedBar = pTabbed->GetBarAt( nSelectedTabIndex, false );
      If( pSelectedBar != pBar )
            return . . . // our pBar is not selected in the tab group
      // if we are here then you are in the in-group active bar