CXTPToolTipContext very inefficient |
Post Reply |
Author | |
Graham
Groupie Joined: 12 May 2003 Location: United Kingdom Status: Offline Points: 23 |
Post Options
Thanks(0)
Posted: 02 November 2007 at 4:16am |
Is the only way to get the tooltip context to work is by hooking in to the PreTranslateMessage like in the ToolTipContext sample? This seems very wasteful, as it is building the tooltip text for pretty much every mouse message. I put it in to my application and just by moving the cursor around on the view it uses a lot of CPU (about 40% on 3.2GHz P4D), and no tooltips are even displayed.
Is there a way to use these tooltips, by only having to generate the HTML when the tooltip is displayed (like when using LPSTR_TEXTCALLBACK in OnToolHitTest) rather than after every mouse message?
Thanks,
Graham
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hello,
Yes, LPSTR_TEXTCALLBACK is supported.
lpszText = LPSTR_TEXTCALLBACK;
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Graham
Groupie Joined: 12 May 2003 Location: United Kingdom Status: Offline Points: 23 |
Post Options
Thanks(0)
|
Could you point me in the right direction on how to achieve this please. Using the callback method I handle the notify message TTN_NEEDTEXT. But how do I then display the tooltip context in this function.
CXTPToolTipContext::FillInToolInfo requires a pointer to TOOLINFO which is only available in OnToolHitTest. Thanks, Graham |
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
I have the same problem here. What to do?
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
don't use FillInToolInfo but set LPSTR_TEXTCALLBACK.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
In my report control I do the following in the constructor: GetToolTipContext()->SetStyle(xtpToolTipHTML);Then I override:
const XTP_NM_REPORTTOOLTIPINFO& CMyReportControl::OnGetToolTipInfo(CXTPReportRow* pRow, CXTPReportRecordItem* pItem, CString& rstrToolTipText)
{
...
}
What am I doing wrong?
|
|
mgampi
Senior Member Joined: 14 July 2003 Status: Offline Points: 1198 |
Post Options
Thanks(0)
|
Hi;
I also hit the same problem.
Oleg, a small sample would be nice!
|
|
Martin
Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0 Platform: Windows 10 v 1909 (64bit) Language: VC++ 2017 |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
Override INT_PTR CXTPReportControl::OnToolHitTest(CPoint point, TOOLINFO* pTI) const method instead
or don't override any method, call GetToolTipContext()->SetStyle(xtpToolTipHTML); and set HTML tooltip using pItem->SetTooltip("<b>test</b>");
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
Hmm, I tried setting the tooltip via CMyRecordItem::SetTooltip (once in the constructor). I still get high CPU-peaks.
No, this is indeed a bug or "bad" implementation (I know this is hard stuff).
Take a look at CHTMLToolTip::GetToolSize:
READYSTATE rs;
do
{ AfxGetApp()->PumpMessage(); m_pBrowserApp->get_ReadyState (&rs); } while (rs != READYSTATE_COMPLETE);
And later you call this a lot of times:
m_wndBrowser.MoveWindow(0, 0, cx, nScrollHeight);
A solution?
An idea is to instantiate one browser object only (Navigate to "about:" only once!), which you use whenever a tooltip should be displayed. Remember that the Navigate-method takes some 100+ milliseconds on some systems!
The size of the html-window is always a problem. I think I have an idea for that too. Simply make it the size of the screen, and then you put all html-code inside a <table width="preferredWidth"> and then you show a window with this browser as a child and set the desired dimensions of the parent window - not the browser itself!
Perhaps the resizing of the browser is not the bottleneck here, but if it turns out to be slow you know how to fix it :).
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
We understand it has delays :( But global webbrowser is not solution.
For 12.0 release we're working with own Markup to replace WebBrowser's rendering.
|
|
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 |