![]() |
CXTPToolTipContextToolTip and long text |
Post Reply
|
| Author | |
jimmy
Senior Member
Joined: 11 November 2003 Location: Austria Status: Offline Points: 516 |
Post Options
Thanks(0)
Quote Reply
Topic: CXTPToolTipContextToolTip and long textPosted: 27 March 2008 at 11:25am |
|
Hello,
I use CXTPToolTipContextToolTip on a dialog application. How can i set a long tooltip text (more than 80 chars ) ? Jimmy |
|
![]() |
|
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 6:51am |
|
Hi,
I don't think there is such restriction. How do you set text ?
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
jimmy
Senior Member
Joined: 11 November 2003 Location: Austria Status: Offline Points: 516 |
Post Options
Thanks(0)
Quote Reply
Posted: 28 March 2008 at 7:53am |
|
Hi,
In OnInitDialog i call EnableToolTips(); m_moduleContext.SetModuleToolTipContext(); ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTW, 0, 0xFFFF, OnToolTipText) ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTA, 0, 0xFFFF, OnToolTipText) And use BOOL CExResizeDialog::OnToolTipText(UINT, NMHDR* pNMHDR, LRESULT* pResult) from TooltipContextDialog sample. And here the function copy the string from AfxLoadString into the pTTTA->szText buffer. And this buffer has only 80 bytes. Jimmy |
|
![]() |
|
gjasny
Newbie
Joined: 17 January 2008 Location: Germany Status: Offline Points: 5 |
Post Options
Thanks(0)
Quote Reply
Posted: 28 March 2008 at 1:01pm |
|
Hi,
1. Catch A and W-Versions: ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTA, 0, 0xFFFF, OnToolTipText) ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTW, 0, 0xFFFF, OnToolTipText) 2. Create two member variables: CStringA m_TooltipStringA; CStringW m_TooltipStringW; 3. Beside the ususal black magic in OnToolTipText do the following: [...] TOOLTIPTEXTA* pTTTA = reinterpret_cast<TOOLTIPTEXTA*>(pNMHDR); TOOLTIPTEXTW* pTTTW = reinterpret_cast<TOOLTIPTEXTW*>(pNMHDR); [...] if (pNMHDR->code == TTN_NEEDTEXTA) { m_TooltipStringA = [assign long tool tip text here] pTTTA->lpszText = m_TooltipStringA.GetBuffer(0); } else if (pNMHDR->code == TTN_NEEDTEXTW) { m_TooltipStringW = [assign long tool tip text here] pTTTW->lpszText = m_TooltipStringW.GetBuffer(0); } At least this works for me. Gregor |
|
![]() |
|
jimmy
Senior Member
Joined: 11 November 2003 Location: Austria Status: Offline Points: 516 |
Post Options
Thanks(0)
Quote Reply
Posted: 31 March 2008 at 4:59am |
|
I see that this was changed from 11.1.3 to 11.2.2.
In 11.1.3 only used szText[80]. And in 11.2.2 lpszText will be used. Jimmy |
|
![]() |
|
Simon HB9DRV
Senior Member
Joined: 07 July 2005 Location: Switzerland Status: Offline Points: 458 |
Post Options
Thanks(0)
Quote Reply
Posted: 31 March 2008 at 5:10am |
Which file is this?
|
|
|
Simon HB9DRV
|
|
![]() |
|
jimmy
Senior Member
Joined: 11 November 2003 Location: Austria Status: Offline Points: 516 |
Post Options
Thanks(0)
Quote Reply
Posted: 31 March 2008 at 5:12am |
|
In file: Common\XTPToolTipContext.cpp
Jimmy |
|
![]() |
|
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 |