PDA

View Full Version : Objective toolkit: tooltips



feffe
11-24-2009, 12:04 AM
Hi,

I have a SECTreeCtrl in my application. I'd like to modify its tooltips, in such a way that they have no border at all.

Is there any way for eliminating (or, alternatively, for changing the color) of borders?

Thanks in advance

CodeMonkey
05-06-2010, 09:02 AM
From your previous post, answer reproduced here:

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 );
}