PDA

View Full Version : Objective toolkit: tooltips



feffe
11-24-2009, 04:43 AM
Hi,
I have a SECTreeCtrl in my program.
I'd like the tooltips be without border.

Is there any way to eliminate or modify SECListTip tooltips border color?

Thanks in advance

EDIT: Resolved. I've built my customizes SECListTip.

CodeMonkey
05-06-2010, 10:00 AM
Excellent! We're glad you figured out how to customize the SECListTip!

I should also point out that SECTreeCtrl uses a CWnd-derived custom tooltip control (SECListTip) and not the Win32 tooltip control. Therefore, handling messages relevant to the windows common control will not work. The tooltip text itself is implemented via a call to the SEC_LISTCLASS::GetItemText(int nItem, int nSubItem) member of SECTreeCtrl. Hence, in order to use different tooltip text, you will have to override this in your derived SECTreeCtrl and return the appropriate string. Further tooltip customization will require you to implement a custom tooltip class based on SECListTip and overide the HookMouseMove() and possibly the OnPaint() in order to make any changes you seek. If the HookMouseMove() member is not virtual, you can go ahead and modify the header found under '\Include\Toolkit\...\slstctip.h' and rebuild the library if necessary.

In order to specify this custom tooltip class, you will have to delete the existing tooltip object in your derived SECTreeCtrl constructor and instantiate the new one. The following code should give you another example,

//derived SECTreeCtrl
CCustTreeCtrl::CCustTreeCtrl()
{
delete m_pToolTipWnd;
m_pToolTipWnd = new CCustListTip( this );
}