List Info

Thread: Re: Creating Events for new component




Re: Creating Events for new component
user name
2007-01-28 14:02:09

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-enyahoogroups.com, David Smith <djsmith_1998...> wrote:
&gt;
>
> 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):
&gt;
> For example: (some external event sets the tag
> property of the speedbutton)
>
> procedure TForm.SpeedbuttonClick(Sender: TObject);
> begin
&gt; If Speedbutton.tag = 0 Then Exit
>; else If Speedbutton.tag = 1 Then
>; begin
&gt; //code that is in the first TNotify event
&gt; end
> else If Speedbutton.tag = 2 Then
>; begin
&gt; //code that is in 2nd TNotifyEvent
> end;
>; end;
>;

__._,_.___
.

__,_._,___
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )