Right Click Help in Delphi DBEdit, TCombo Boxes, etc.

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
Norman
Posts: 3
Joined: Wed Sep 18, 2002 3:07 pm
Location: Cape Town, South Africa
Contact:

Right Click Help in Delphi DBEdit, TCombo Boxes, etc.

Unread post by Norman »

We are writing help for a large project at present. We find that the right click context menu "What's This?" does not appear when right clicking a Delphi TDBEdit component or TComboBox. It does, however, appear when right clicking a TDBComboBox. Is there a reason for this and how do we overcome it? Note that there is a topic for each of the components in question, and the correct help does appear when the control has focus and F1 is pressed.
If builders built buildings the way programmers write software, the first woodpecker that came along would destroy civilisation.
Wienberg's Law of Programming
User avatar
Alexander Halser
EC-Software Support
Posts: 4098
Joined: Mon Jun 24, 2002 7:24 pm
Location: Salzburg, Austria
Contact:

Unread post by Alexander Halser »

Check out the OnPopup event of TWhatsThis. Does it occour?
Alexander Halser
Senior Software Architect, EC Software GmbH
Norman
Posts: 3
Joined: Wed Sep 18, 2002 3:07 pm
Location: Cape Town, South Africa
Contact:

TWhatsThis OnPopup event.

Unread post by Norman »

I have a TWhatsThis component on my main form. The OnPopup event does not occur. What do I do to overcome this problem. I'm not clear on what should happen on this event.
If builders built buildings the way programmers write software, the first woodpecker that came along would destroy civilisation.
Wienberg's Law of Programming
User avatar
Alexander Halser
EC-Software Support
Posts: 4098
Joined: Mon Jun 24, 2002 7:24 pm
Location: Salzburg, Austria
Contact:

Unread post by Alexander Halser »

That's very odd. Maybe another component is interferring here?

I tried to duplicate your problem with an additional TDBComboBox inserted in the EHS sample application and compiled with D5. Works perfectly. If you right-click on the drop-down arrow, the What's This? menu pops up. If you click on the edit area, on the other hand, the menu does intentionally not appear, because the edit area has it's own drop down menu.
Alexander Halser
Senior Software Architect, EC Software GmbH
Norman
Posts: 3
Joined: Wed Sep 18, 2002 3:07 pm
Location: Cape Town, South Africa
Contact:

Unread post by Norman »

I've solved the problem. In fact you might like the solution, as it addresses an issue that I find irritating. You say that right clicking in the edit area of a TComboBox deliberately does not bring up the "What's This?", but I don't like that behaviour. Unsophisticated users will not necessarily know that they must right click on the drop down arrow, rather than the edit area of the combo box. What we've done, is add a TPopUpMenu component to the Main Form. It has one TMenuItem called WhatsThis. It is assigned to all of the PopUpMenu property of all non-data aware components on any form, and it uses the following code to call the context sensitive help for the component:

procedure TfmMain.WhatsThisClick(Sender: TObject);
begin
Application.HelpCommand(HELP_CONTEXTPOPUP, TControl(WhatsThisPopupMenu.PopupComponent).HelpContext);
end;

Eloquent and to the point, and it turns off the annoying right click menu that normally pops up on non-db aware controls.
Regards,
Norman
If builders built buildings the way programmers write software, the first woodpecker that came along would destroy civilisation.
Wienberg's Law of Programming
Post Reply