Board index » cppbuilder » Hint in TMenuItem doesn't show

Hint in TMenuItem doesn't show

I have put a hint text on one of my TMenuItems (Hint property), but the hint
text doesn't show in runtime. Normally a component has a ShowHint property,
but TMenuItem doesn't have such a property.
Any ideas why my hint text doesn't show?
I'm using BCB4 Ent.

TIA
Kim Hellan

 

Re:Hint in TMenuItem doesn't show


You would need to implement this behavior yourself.  So you know, though,
when you highlight a menu item, the Application's global hint becomes the
menuitem's hint, so you could try catching the Application->OnHint event,
and then use your own THintWindow to display the Hint

Gambit

Quote
"Kim Hellan" <Hel...@post5.tele.dk> wrote in message

news:8dnmfr$aa61@bornews.borland.com...
Quote
> I have put a hint text on one of my TMenuItems (Hint property), but the
hint
> text doesn't show in runtime. Normally a component has a ShowHint
> property, but TMenuItem doesn't have such a property.

Re:Hint in TMenuItem doesn't show


Then.... what is the TMenuItem::Hint property for, if you have to do some
programming yourself anyway?
.....and why is it so much more difficult to apply a tooltip hint to menu
items, compared to, let's say, an edit box or a combo box?

TIA
Kim Hellan

Quote
Remy Lebeau wrote in message <8dog24$e...@bornews.borland.com>...
>You would need to implement this behavior yourself.  So you know, though,
>when you highlight a menu item, the Application's global hint becomes the
>menuitem's hint, so you could try catching the Application->OnHint event,
>and then use your own THintWindow to display the Hint

>> I have put a hint text on one of my TMenuItems (Hint property), but the
>hint text doesn't show in runtime. Normally a component has a ShowHint
>> property, but TMenuItem doesn't have such a property.

Re:Hint in TMenuItem doesn't show


Quote
"Kim Hellan" <Hel...@post5.tele.dk> wrote in message

news:8dqbbq$4aa1@bornews.borland.com...

Quote
> Then.... what is the TMenuItem::Hint property for, if you have to do some
> programming yourself anyway?

You didn't read my posting very closely, did you?  I said,:
"So you know, though, when you highlight a menu item, the Application's
global hint becomes the menuitem's hint, "

You need to supply a Hint for the menuitem so it can be passed to the
Application->Hint for usage.

Quote
> .....and why is it so much more difficult to apply a tooltip hint to menu
> items, compared to, let's say, an edit box or a combo box?

That's just the way Windows manages hint windows, I guess.  Honestly,
stepping through the VCL source code, I can't find ANYWHERE where the Hint
property is accessed at all for display, except for menu's when the set
Application->Hint (thus triggering Application->OnHint).  So, somehow,
Windows is probably controlling this behavior instead of the VCL.

Gambit

Re:Hint in TMenuItem doesn't show


I stand corrected.  I finally tracked it down the code in the VCL after all
that controls hints.  After a LOT of internal processing by the VCL, the
initial trigger to a Hint being displayed on a VCL control like TEdit or
TComboBox is the control responding to the WM_MOUSEMOVE event.  The reason
Hint's don't show up for menus is that menu's don't receive this message.

Gambit

Quote
"Remy Lebeau" <gambi...@gte.net> wrote in message

news:8dr47p$9bb5@bornews.borland.com...
Quote
> That's just the way Windows manages hint windows, I guess.  Honestly,
> stepping through the VCL source code, I can't find ANYWHERE where
> the Hint property is accessed at all for display, except for menu's when
> the set Application->Hint (thus triggering Application->OnHint).  So,
> somehow, Windows is probably controlling this behavior instead of the
> VCL.

Other Threads