wxStaticBitmap help text when mouse hovers Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
mael15
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 539
Joined: Fri May 22, 2009 8:52 am
Location: Bremen, Germany

wxStaticBitmap help text when mouse hovers

Post by mael15 »

Hello,
I have some complicated settings in a typical dialog that I have to explain in more detail. To keep the dialog minimal, I want to add a wxStaticBitmap showing a questionmark and show an in depth explanation as soon as the mouse hovers over it, just like in a wxMenuItem using SetHelp(wxString).
Is there an easy way without having to create a custom panel showing the text? wxWindowBase::SetHelpText(wxString) does not result in showing the string.
Thank you.
User avatar
doublemax
Moderator
Moderator
Posts: 19160
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxStaticBitmap help text when mouse hovers

Post by doublemax »

wxRichToolTip is nice, but you have to trigger it yourself. You can't set it up so that it automatically appears like a normal tooltip.
http://docs.wxwidgets.org/trunk/classwx ... l_tip.html
Use the source, Luke!
mael15
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 539
Joined: Fri May 22, 2009 8:52 am
Location: Bremen, Germany

Re: wxStaticBitmap help text when mouse hovers

Post by mael15 »

thanx, the description says "and a native MSW version which can be only used with text controls"? I develop for Windows.
Or is this what you meant with "trigger it yourself"? If so, how?
User avatar
doublemax
Moderator
Moderator
Posts: 19160
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxStaticBitmap help text when mouse hovers

Post by doublemax »

thanx, the description says "and a native MSW version which can be only used with text controls"? I develop for Windows.
I don't think that's true. I'm pretty sure i've used it for other controls already. Make a small test to confirm.
Or is this what you meant with "trigger it yourself"? If so, how?
With "trigger it yourself" i mean that you have to actively show it. It doesn't appear on its own like a tooltip.
Use the source, Luke!
mael15
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 539
Joined: Fri May 22, 2009 8:52 am
Location: Bremen, Germany

Re: wxStaticBitmap help text when mouse hovers

Post by mael15 »

Ok, it works, but there is no way to hide it? Seems like one can only set a timeout but I want to show a longer text that should be readable as long as the mouse is over the wxStaticBitmap.
User avatar
doublemax
Moderator
Moderator
Posts: 19160
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxStaticBitmap help text when mouse hovers

Post by doublemax »

I would set a long timeout, then the user can hide the tooltip by clicking outside.
Use the source, Luke!
mael15
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 539
Joined: Fri May 22, 2009 8:52 am
Location: Bremen, Germany

Re: wxStaticBitmap help text when mouse hovers

Post by mael15 »

doublemax wrote:I would set a long timeout, then the user can hide the tooltip by clicking outside.
SetTimeout(0) leaves it as long as the user does not click.
Post Reply