That's going to be tricky. The only thing I can think of is to
create a single OnClick event handler that each component refers to.
Then, based on conditional statements, this event handler could call
an appropriate method for the various controls. If you want to do
something special in the event handler, you could always have the
event handler call another method altogether. Seems a bit rough but
it would be better than modifying many event handlers.
--- x
Xavier Pacheco (TeamB)
Sorry but TeamB cannot answer support questions received via email.
for x := 0 to ComponentCount-1 do
if (Components[x] is TButton) or
(Components[x] is TEdit)
then
...
Mark Richter
eMCee Software
Xavier Pacheco (TeamB) <xav...@xap.cnchost.com> wrote in article
<34713385...@forums.borland.com>...
you are going at this problem from the wrong angle, i think. If you go into
help context mode by sending a WM_SYSCOMMAND message with wparam =
SC_CONTEXTHELP to your form (or have the user press the help border icon)
Windows takes over and when the user clicks on a control (actually it has
to be a TWinControl descendant) Windows sends a WM_HELP message to this
control. Delphi already handles this, if the control has a HelpContext <> 0
and the Application.Helpfile property is set to a help file name Delphi
automatically calls Application.HelpContext for you.
The problem are controls without a window handle (speedbuttons for example)
and the main menu. You can handle them by adding special case code to their
OnClick handlers that tests a flag you set when you go into help context
mode.
Your proposed solution (replacing all OnClick handlers) is in fact
workable, i think, but has a number of problems. Of course you need a way
to save all the existing OnClick handlers before you replace them with the
context-help specific handler, so you can restore them later. Dealing with
the handlers would involve a recursive scan over the Controls property of
the form and all controls you find (OnClick is a property of TControl).
The tricky part is to make absolutely sure you detect all ways the user can
get *out* of context help mode, so you can restore all the old handlers to
have your form back in normal operational mode.
Peter Below (TeamB) 10011...@compuserve.com)
Thanks once again.
Adrian
Peter Below <10011...@compuserve.com> wrote in message ...
SendMessage(Form1.handle,WM_SYSCOMMAND,SC_CONTEXTHELP,0);
PS Peter this works just fine.. will look into the help for speed
buttons as you recommended!
And yes it does change the cursor to crHelp.
The BorderIcons property allows one to set biHelp, but then the form
defaults to a dialog form...this way the form is still resizeable, and
also works with HTML help using components from Hyperact.
Adrian Wreyford wrote in message <64ve8l$v...@forums.borland.com>...