sk8boi
asked on
Rollover on application menu icons causes text popup question
When I rollover any icon a small text pop box appears describing that icon. What causes this? I've looked in the OnNcHitTest and the OnNcMouseMove code, but don't see anything. The application is using Robohelp, and I've found the text strings that popup there, but don't see anything in the application referencing these string labels. What do I need to do to add text to pop up for a new icon?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
This is an existing application that I'm modifying. Below is some code. I see no reference to EnableToolTips or CToolTipCtrl, but all the tooltips work for the mainframe icons. The status bar icons give me nothing, however.
int CMainFrame::OnCreate(LPCRE ATESTRUCT lpCreateStruct)
{
int rc = -1;
g_hwndFrame = GetSafeHwnd();
// Even though the frame window is created here,
// must reset the style in CRevClntFrameView
// OnCreate to have it work correctly.
// Doesn't do any good to attempt to set
// style since MFC uses an internal dwStyle to
// set the cs.style anyway.
if (/*CMDIFrameWnd*/CAppBarFr ame::OnCre ate(lpCrea teStruct) == -1)
{
TRACE0("Failed to create frame window\n");
}
else
{
EnableDocking( CBRS_ALIGN_TOP | CBRS_ALIGN_BOTTOM );
if (!m_wndCaptionBar.Create(t his, IDD_DIALOGBAR,
CBRS_TOP|CBRS_TOOLTIPS|CBR S_FLYBY, IDD_DIALOGBAR))
{
RevBeep( ERROR_BEEP );
TRACE0("Failed to create captionbar\n");
}
else if (!m_wndToolBar.CreateEx(th is, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
| CBRS_TOOLTIPS | CBRS_FLYBY /*| CBRS_SIZE_DYNAMIC*/, CRect( 2,2,2,2 ) ) || //, AFX_IDW_TOOLBAR ) ||
!m_wndToolBar.LoadToolBar( IDR_MAINFR AME))
//if (!m_wndToolBar.Create(this , WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_TOOLTIPS | CBRS_FLYBY) ||
// !m_wndToolBar.LoadToolBar( IDR_MAINFR AME))
{
RevBeep( ERROR_BEEP );
TRACE0("Failed to create toolbar\n");
}
//else if (!m_wndStatusBar.Create(th is)
//|| !m_wndStatusBar.SetIndicat ors(indica tors, sizeof(indicators)/sizeof( UINT)))
//if (!m_wndStatusBar.CreateEx( this, SBT_TOOLTIPS, WS_CHILD | WS_VISIBLE | CBRS_BOTTOM, AFX_IDW_STATUS_BAR ) ||
// !m_wndStatusBar.SetIndicat ors(indica tors,
// sizeof(indicators)/sizeof( UINT)))
====>> else if (!m_wndStatusBar.Create(th is) ||
!m_wndStatusBar.SetIndicat ors(indica tors,
sizeof(indicators)/sizeof( UINT)))
{
RevBeep( ERROR_BEEP );
TRACE0("Failed to create status bar\n");
}
else
........................
I noticed the code used to have "m_wndStatusBar.CreateEx(t his, SBT_TOOLTIPS......" , but for some reason it was commented out. Below is the create code for the status bar:
BOOL CRevStatusBar::Create( CWnd* pParentWnd,
DWORD dwStyle, /* = WS_CHILD | WS_VISIBLE | CBRS_BOTTOM */
UINT nID /* = AFX_IDW_STATUS_BAR*/ )
{
m_pParent = pParentWnd;
return CStatusBar::Create( pParentWnd, dwStyle, nID );
}
So can I add CBRS_TOOLTIP as dwStyle input to CRevStatusBar::Create?
Or should I try to figure out why they switched from "m_wndStatusBar.CreateEx(t his, SBT_TOOLTIPS..... " to
"m_wndStatusBar.Create"?
Thanks,
sk8boi
int CMainFrame::OnCreate(LPCRE
{
int rc = -1;
g_hwndFrame = GetSafeHwnd();
// Even though the frame window is created here,
// must reset the style in CRevClntFrameView
// OnCreate to have it work correctly.
// Doesn't do any good to attempt to set
// style since MFC uses an internal dwStyle to
// set the cs.style anyway.
if (/*CMDIFrameWnd*/CAppBarFr
{
TRACE0("Failed to create frame window\n");
}
else
{
EnableDocking( CBRS_ALIGN_TOP | CBRS_ALIGN_BOTTOM );
if (!m_wndCaptionBar.Create(t
CBRS_TOP|CBRS_TOOLTIPS|CBR
{
RevBeep( ERROR_BEEP );
TRACE0("Failed to create captionbar\n");
}
else if (!m_wndToolBar.CreateEx(th
| CBRS_TOOLTIPS | CBRS_FLYBY /*| CBRS_SIZE_DYNAMIC*/, CRect( 2,2,2,2 ) ) || //, AFX_IDW_TOOLBAR ) ||
!m_wndToolBar.LoadToolBar(
//if (!m_wndToolBar.Create(this
// !m_wndToolBar.LoadToolBar(
{
RevBeep( ERROR_BEEP );
TRACE0("Failed to create toolbar\n");
}
//else if (!m_wndStatusBar.Create(th
//|| !m_wndStatusBar.SetIndicat
//if (!m_wndStatusBar.CreateEx(
// !m_wndStatusBar.SetIndicat
// sizeof(indicators)/sizeof(
====>> else if (!m_wndStatusBar.Create(th
!m_wndStatusBar.SetIndicat
sizeof(indicators)/sizeof(
{
RevBeep( ERROR_BEEP );
TRACE0("Failed to create status bar\n");
}
else
........................
I noticed the code used to have "m_wndStatusBar.CreateEx(t
BOOL CRevStatusBar::Create( CWnd* pParentWnd,
DWORD dwStyle, /* = WS_CHILD | WS_VISIBLE | CBRS_BOTTOM */
UINT nID /* = AFX_IDW_STATUS_BAR*/ )
{
m_pParent = pParentWnd;
return CStatusBar::Create( pParentWnd, dwStyle, nID );
}
So can I add CBRS_TOOLTIP as dwStyle input to CRevStatusBar::Create?
Or should I try to figure out why they switched from "m_wndStatusBar.CreateEx(t
"m_wndStatusBar.Create"?
Thanks,
sk8boi
>>else if (!m_wndToolBar.CreateEx(th is, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_TOOLTIPS | CBRS_FLYBY /*| CBRS_SIZE_DYNAMIC*/, CRect( 2,2,2,2 ) ) || //, AFX_IDW_TOOLBAR ) ||
In this line CBRS_TOOLTIPS is there
so u shud check the prompts of toolbar items as OnegaZhang suggested
In this line CBRS_TOOLTIPS is there
so u shud check the prompts of toolbar items as OnegaZhang suggested
ASKER
The m_wndToolBar tooltips are working fine,
Its the m_wndStatusBar that aren't working. The StatusBar fields are actually icons that display on the application, they give the status of whether a external device is connected or not, they're alittle different than your standard status bar fields that show up on the lower right of a typical windows app. Does the statusbar class normally support tooltips?
Thanks,
sk8boi
Its the m_wndStatusBar that aren't working. The StatusBar fields are actually icons that display on the application, they give the status of whether a external device is connected or not, they're alittle different than your standard status bar fields that show up on the lower right of a typical windows app. Does the statusbar class normally support tooltips?
Thanks,
sk8boi
Create a new document\nNew
the string after \n will be its tooltip!
welcome to www.fruitfruit.com