![]() |
Adding Office 2007 tooltips to regular CButtons |
Post Reply
|
| Author | |
gjasny
Newbie
Joined: 17 January 2008 Location: Germany Status: Offline Points: 5 |
Post Options
Thanks(0)
Quote Reply
Topic: Adding Office 2007 tooltips to regular CButtonsPosted: 17 March 2008 at 11:06am |
|
Hi,
I want to add Office 2007 style tooltips to regular CButtons inside a CDialog. Could anyone please outline the necessary steps? I.e. I don't know what to do with the CXTPToolTipContext. Thanks! Gregor |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 17 March 2008 at 1:25pm |
|
Hi,
Check ToolTipContext sample. It shows how to use CXTPToolTipContext for Dialog.
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
gjasny
Newbie
Joined: 17 January 2008 Location: Germany Status: Offline Points: 5 |
Post Options
Thanks(0)
Quote Reply
Posted: 28 March 2008 at 1:14pm |
|
Hi,
In OnInitDialog() I call now m_moduleContext.SetModuleToolTipContext(); This works as long as nobody else calls EnableTooltips() because the following lines in mfc/tooltips.cpp overwrites the m_pfnFilterToolTipMessage function pointer. BOOL CWnd::_EnableToolTips(BOOL bEnable, UINT nFlag) { [...] // if already enabled for tooltips, nothing to do if (!(m_nFlags & nFlag)) { // success AFX_MODULE_STATE* pModuleState = _AFX_CMDTARGET_GETSTATE(); pModuleState->m_pfnFilterToolTipMessage = &CWnd::_FilterToolTipMessage; } [...] } Another approach I tried, is to call m_moduleContext.FilterToolTipMessage(this, pMsg); in PreTranslateMessage(). But this has the downside that I need to change every window with tooltips. Do you have any other hints for me? |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 28 March 2008 at 3:45pm |
|
Hi,
yeap SetModuleToolTipContext is designed method for global tooltip context.
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
gjasny
Newbie
Joined: 17 January 2008 Location: Germany Status: Offline Points: 5 |
Post Options
Thanks(0)
Quote Reply
Posted: 31 March 2008 at 5:20am |
So if every call of EnableToolTips resets the desired effect, when and where should I call it? Thanks, Gregor |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 01 April 2008 at 1:36am |
|
Hi,
You can call SetModuleToolTipContext in constructor of your main form/dialog.
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |