Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Pascal Delphi Components Writing > Hybride: SpeedB...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 136 of 155
Post > Topic >>

Hybride: SpeedButton, Checkbox and Image

by spleenth@[EMAIL PROTECTED] Aug 12, 2005 at 08:32 AM

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
 




 2 Posts in Topic:
Hybride: SpeedButton, Checkbox and Image
spleenth@[EMAIL PROTECTED  2005-08-12 08:32:50 
Re: Hybride: SpeedButton, Checkbox and Image
spleenth@[EMAIL PROTECTED  2005-08-12 10:04:02 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Jul 26 5:51:37 CDT 2008.