Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Hybride: SpeedButton, Checkbox and Image

0 views
Skip to first unread message

sple...@gmail.com

unread,
Aug 12, 2005, 11:32:50 AM8/12/05
to
Hello,

I try to make my control change state of other controls of the same
type when they have the same GroupIndex set...
All I get is Access Violation :(

could you please take a look at my code and tell me what is wrong?

Excerpt that makes problems:

________________________________________________________
procedure TxImage.Click;
var i, cc: integer;
begin
inherited;
if FGroupIndex <> 0 then
FChecked := True
else
FChecked := not FChecked;

if Assigned(PictureON) and Assigned(PictureOFF) Then
if FChecked then Picture.Bitmap := PictureON.Bitmap
else Picture.Bitmap := PictureOFF.Bitmap;

//THIS PART MAKES PROBLEMS :(((((
if (FGroupIndex <> 0) and (Parent <> nil) and FChecked then
begin
cc := Parent.controlCount -1;
with Parent do
begin
for i := 0 to cc do
if Parent.Controls[i] is TxImage then
if TxImage(Parent.Controls[i]).FGroupIndex = FGroupIndex then
begin
TxImage(Parent.Controls[i]).Checked := False;
TxImage(Parent.Controls[i]).Invalidate;
end;
end;
end;
//THIS PART MAKES PROBLEMS :(((((

invalidate;
end;
________________________________________________________

whole code here:
http://rafb.net/paste/results/qWkjL977.html

Thanks in advance!
~spleen

sple...@gmail.com

unread,
Aug 12, 2005, 1:04:02 PM8/12/05
to
Spleenth said:

[...]
my friend has helped me, and here is the final version that works:
http://rafb.net/paste/results/LbtpCl48.html

you may use it and modify as you wish -.^

Cheers!
~spleen

0 new messages