|
|
|
|
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 |
|
Offer Har
|
Nov 7, 2008 - 2:42 PM
|
I have a control-bar whose title may be longer then the width of the control-bar. Is there a way to make the full title appear in a tool-tip like the one displayed when a tab’s text does not fit into the tab?
|
|
Technical Support
|
Nov 10, 2008 - 11:51 AM
|
The following class displays a tooltip like you need: class CMyControlBar : public CExtControlBar
{
protected:
virtual LRESULT WindowProc( UINT message, WPARAM wParam, LPARAM lParam )
{
switch( message )
{
case WM_MOUSEMOVE:
case WM_NCMOUSEMOVE:
if( IsBarWithGripper() )
{
if( ! OnQueryBarHoverProcessingEnabled() )
return 0;
CExtPopupMenuTipWnd * pATTW = OnAdvancedPopupMenuTipWndGet();
if( pATTW == NULL )
return 0;
CPoint ptScreen;
if( ! ::GetCursorPos(&ptScreen) )
return 0;
CExtBarNcAreaButton * pBtn = NULL;
NcButtons_HitTest( ptScreen, &pBtn );
if( pBtn != NULL )
break;
CRect rcArea = _RectGripGet();
rcArea.DeflateRect( 2, 0 );
NcButtons_CalcGripperTextLocation( rcArea );
if( rcArea.left >= rcArea.right )
return 0;
CWindowDC dcMeasure( this );
CExtSafeString sCaption;
OnGetBarCaptionText( __EBCT_SINGLE_CAPTION_DOCKED, sCaption );
INT nCaptionTextWidthPX = CExtPaintManager::stat_CalcTextDimension( dcMeasure, PmBridge_GetPM()->m_FontCaption, sCaption ).Width();
INT nAreaWidthPX = rcArea.Width();
if( nAreaWidthPX >= nCaptionTextWidthPX )
return 0;
CRect rcDefOffsetWnd;
GetWindowRect( &rcDefOffsetWnd );
rcArea.OffsetRect( rcDefOffsetWnd.TopLeft() );
OnAdvancedPopupMenuTipWndDisplay( *pATTW, rcArea, LPCTSTR( sCaption ) );
return 0;
}
break;
}
LRESULT lResult = CExtControlBar::WindowProc( message, wParam, lParam );
return lResult;
}
};
You should repeat the same for tabbed group classes.
|
|