![]() |
How to change content of MDI tooltip ? |
Post Reply
|
| Author | |||
freehawk
Groupie
Joined: 22 April 2004 Status: Offline Points: 95 |
Post Options
Thanks(0)
Quote Reply
Topic: How to change content of MDI tooltip ?Posted: 01 August 2005 at 10:23pm |
||
|
Hello There are some tabbed MDI child window. When mouse is moved onto the tab of MDI child window, the tooltip (example: full path of file ) is displayed, Now I want to change the content of tooltip, Please help me how to do? Thank you. -Freehawk |
|||
![]() |
|||
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 03 August 2005 at 4:36am |
||
|
Hi, Option 1. Override virtual CString CXTPTabClientWnd::GetItemTooltip(const CXTPTabManagerItem* pItem) const;and return tooltip you need.
Option 2. catch WM_XTP_GETWINDOWTOOLTIP in CChildFrm and return LPCTSTR string with tooltip.
|
|||
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|||
![]() |
|||
freehawk
Groupie
Joined: 22 April 2004 Status: Offline Points: 95 |
Post Options
Thanks(0)
Quote Reply
Posted: 10 August 2005 at 12:06am |
||
|
How to change the tooltip? The following way is "How to get the tooltip".
|
|||
![]() |
|||
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 10 August 2005 at 3:50am |
||
|
in CChildFrame.h add new member CString m_strCurrentTooltip. - to change it call m_strCurrentTooltip = "New Tooltip". - to get it use "option 2" |
|||
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|||
![]() |
|||
JayW
Newbie
Joined: 25 May 2005 Status: Offline Points: 11 |
Post Options
Thanks(0)
Quote Reply
Posted: 11 August 2005 at 2:10pm |
||
|
To clarify a bit, I asssume Oleg means to do the following: A) Add the class variable m_strCurrentTooltip to the CMDIChildWnd-derived child frame class for the doc/view template to store the text for the tooltip. B) Install a message handler to trap the WM_XTP_GETWINDOWTOOLTIP message in the ChildFrm class and return the value of the m_strCurrentTooltip variable. (The message is issued by CXTPTabClientWnd::GetItemTooltip() which is used by the XTP framework to get the tooltip text before setting it, so while it seems like a "Get" method, it behaves as a "Set" method in this case.) Code as follows: In the "MyChildFrm.h" file include the following:
and, define the message handler:
In the "YourChildFrm.cpp" file include the following:
I hope that helps. (Oleg's posts have saved me countless hours... Jay |
|||
![]() |
|||
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 |