What you say makes sense except for one thing. The reason for doing
this is historic. In version 1 of this application, I had over 200
popup dialogs, each one unique in some way. Analysis showed me that
the essential background of the popups were the same - toolbar, status
bar, a few of the labels. It was the different controls that caused
me to create new boxes.
Therefore, in this version, I am creating a single virtual dialog box
with an empty scrollbox. This is populated by creating the controls
dynamically when needed. Therefore, I need to make as many of the
event handlers in the virtual dialog plain vanilla, able to be used by
all of the different configurations. That is why I would rather mess
with the code inside the objects specifically using the events
themselves to do the heavy lifting.
jamie
--- In delphi-en%40yahoogroups.com">delphi-en
yahoogroups.com, David Smith <djsmith_1998
...> wrote:
>
>
> All you need to do is use that external condition to
> decide in the TNotify event whether to execute the
> code or not in a decision branch (a lot of programmers
> use the Tag property for this):
>
> For example: (some external event sets the tag
> property of the speedbutton)
>
> procedure TForm.SpeedbuttonClick(Sender: TObject);
> begin
> If Speedbutton.tag = 0 Then Exit
> else If Speedbutton.tag = 1 Then
> begin
> //code that is in the first TNotify event
> end
> else If Speedbutton.tag = 2 Then
> begin
> //code that is in 2nd TNotifyEvent
> end;
> end;
>
.