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.
Subject |
Author |
Date |
|
Gregor Jasny
|
Aug 18, 2007 - 10:14 AM
|
Hi,
I need to add/remove buttons to a floating CExtToolControlBar. After calling InsertButton or remove button I try to notify the toolbar that its layout changed:
CFrameWnd *pParent = GetParentFrame(); if (pParent) { pParent->RecalcLayout(); pParent->Invalidate(); pParent->RedrawWindow(); }
But the upper part (which contains the title and the small ’x’) stays at the old size until I move the mouse somewhere over the toolbar.
In another docked toolbar I change the button text from time to time. But RecalcLayout does not work there, too. So the text ’runs’ into the next toolbar button.
What do I miss here?
Thanks! Gregor
|
|
Technical Support
|
Aug 19, 2007 - 9:59 AM
|
In some cases the non-client area of floating mini frame window should be re-painted manually. You should invoke the following code: CFrameWnd * pFrame = GetParentFrame();
if( pFrame != NULL )
{
ASSERT_VALID( pFrame );
pFrame->RecalcLayout();
if( pFrame->IsKindOf( RUNTIME_CLASS( CMiniFrameWnd ) ) )
pFrame->SendMessage( WM_NCPAINT );
}
|
|