MG: customradiogroup is now streamable

git-svn-id: trunk@226 -
This commit is contained in:
lazarus 2001-03-15 14:42:20 +00:00
parent 9522dc1fd6
commit d7a5998509
2 changed files with 52 additions and 23 deletions

View File

@ -280,8 +280,10 @@ type
FItems : TStrings;
FItemIndex : integer;
FColumns : integer;
FReading : boolean;
procedure ItemsChanged (Sender : TObject);
protected
procedure ReadState(Reader: TReader); override;
procedure SetItem (value : TStrings);
procedure SetColumns (value : integer);
procedure SetItemIndex (value : integer);
@ -326,6 +328,9 @@ end.
{
$Log$
Revision 1.8 2001/03/15 14:42:20 lazarus
MG: customradiogroup is now streamable
Revision 1.7 2001/01/12 18:27:31 lazarus
Streaming additions by MAttias
Shane

View File

@ -187,8 +187,10 @@ end;
Select one of the radiobuttons
------------------------------------------------------------------------------}
procedure TCustomRadioGroup.SetItemIndex (value : integer);
procedure TCustomRadioGroup.SetItemIndex (Value : integer);
begin
if FReading then FItemIndex:=Value
else begin
if (Value < -1) or (Value >= FItems.Count)
then raise Exception.Create('TCustomRadioGroup: Out of bounds');
@ -202,6 +204,7 @@ begin
end
else FItemIndex := value;
end;
end;
{------------------------------------------------------------------------------
Method: TCustomRadioGroup.SetItemIndex
@ -218,7 +221,8 @@ begin
if (HandleAllocated) then
begin
i := 0;
// This nasty little loop is neccessary because the group is not informed when a button is pressed
// This nasty little loop is neccessary because the group is not informed
// when a button is pressed
while (i < FButtonList.Count) and (result = -1) do
begin // find the actice button
if TRadioButton (FButtonList [i]).Checked
@ -243,8 +247,28 @@ begin
result := true;
end;
{------------------------------------------------------------------------------
Method: TCustomRadioGroup.ReadState
Params: Reader: TReader
executed when component is read from stream
------------------------------------------------------------------------------}
procedure TCustomRadioGroup.ReadState(Reader: TReader);
begin
FReading := True;
inherited ReadState(Reader);
FReading := False;
if HandleAllocated then RecreateWnd;
end;
{
$Log$
Revision 1.5 2001/03/15 14:42:20 lazarus
MG: customradiogroup is now streamable
Revision 1.4 2001/02/06 13:38:58 lazarus
Fixes from Mattias for EditorOPtions
Fixes to COmpiler that should allow people to compile if their path is set up.