On 30/07/1999 at 20:33 Alistair George wrote:
>> You've really got to show us more code.
>> What is wrong with pointing all the buttons at a single OnClick
>> event that looks something like:
>>
>> procedure MyOnClick(Sender : TComponent );
>> begin
>> TSpeedButton( Sender ).Down := False;
>> end;
>Brilliant idea but...........handle this
>
>procedure TCamForm.PicButtonClick(Sender: TObject);
>begin
> if (picselect = pic1.Tag) and (FIMG1.Visible = true) then exit;
> Picclick(Pic1.Tag);
>end;
>
>//using each btn tag in subproc picclick(tag)
>//there is probably a way using that nice idea, but somehow I feel I have
>done that beat already.
... assuming 'pic1' is a SpeedButton...
procedure TCamForm.PicButtonClick(Sender: TObject);
var theButtonUserClicked : TSpeedButton;
begin
theButtonUserClicked := TSpeedButton( Sender );
if (picselect = theButtonUserClicked.Tag) and (FIMG1.Visible = true) then exit;
Picclick(theButtonUserClicked.Tag);
end;
.. but I don't understand what purpose 'picselect' would serve -- it *sounds* like it
represents the button that has just been clicked, which is redundant because we
already know it's 'Sender', so the 'picselect = theButtonUserClicked.Tag' condition
should be removed.
What does FIMG1 represent? Is there a relationship between it and pic1? Does pic2 have
a FIMG2?
Show us lots of code and I'm sure we could come up with a better solution, but I'm
going to stop guessing now.
Cheers,
Kerry S
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz