TWhatsThis queries

This section is for programmers. Please use it for all discussons on interfacing help with your applications and related subjects.

Moderators: Alexander Halser, Michael Schwarzl

Post Reply
Shane Sturgeon
Posts: 14
Joined: Mon Jan 06, 2003 10:37 pm
Location: Dunedin, New Zealand
Contact:

TWhatsThis queries

Unread post by Shane Sturgeon »

Hi,

I have placed a TWhatsthis component on my main form in a D6 Application. It seems to work ok, except that I have a Treeview component that has a popup menu of it's own. I wasn't sure if the TWhatsthis component would add a "What's this" item to the existing popup menu or just ignore it, but it doesn't do any of these; it completely replaces it. eg my old rightclick popup menu no longer works when I right click (I get the "Whats THis" menu) but the original popup still works when I press the menu button on MS Natural Keyboard.

Is this normal behaviour, or am I doing something wrong?

Also, as a related question, does anyone know where I can get the nice "What's This" button and menu glyph? See the one beside the "Whats This" menu item in H&M to see what I am talking about. It doesn't appear to be in my Borland Glyphs collection that was installed with Delphi.
Thanks for your help

Regards

Shane
User avatar
Alexander Halser
EC-Software Support
Posts: 4105
Joined: Mon Jun 24, 2002 7:24 pm
Location: Salzburg, Austria
Contact:

Unread post by Alexander Halser »

This is a known problem with some components - the TTreeView is one of them, TRichedit another. It has to do with the Windows message system that it doesn't work in this case. But there is a simple workaround:

Add an event handler to the OnPopup event of TWhatsThis and place the following code in the handler:

Code: Select all

procedure TForm1.WhatsThisPopup(Sender, HelpItem: TObject; HContext: THelpContext; X, Y: Integer; var DoPopup: Boolean);
begin
     if (HelpItem is TTreeview) or (HelpItem is TRichEdit) then DoPopup := false;
end;
Alexander Halser
Senior Software Architect, EC Software GmbH
Post Reply