add new components TRxRadioGroup and TRxDBRadioGroup - allow disable any of RadioButton from group

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1993 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
alexs75
2011-09-23 22:37:57 +00:00
parent 5e72832f78
commit d4c63d5b73
6 changed files with 120 additions and 34 deletions

View File

@ -194,8 +194,46 @@ type
property Visible;
end;
type
{ TRxDBRadioGroup }
TRxDBRadioGroup = class(TDBRadioGroup)
private
function GetItemEnabled(Index: integer): boolean;
procedure SetItemEnabled(Index: integer; AValue: boolean);
public
property ItemEnabled[Index: integer]: boolean read GetItemEnabled write SetItemEnabled;
end;
implementation
uses dbutils, LCLVersion;
uses dbutils, LCLVersion, vclutils, StdCtrls;
{ TRxDBRadioGroup }
function TRxDBRadioGroup.GetItemEnabled(Index: integer): boolean;
var
R:TRadioButton;
begin
if (Index < -1) or (Index >= Items.Count) then
RaiseIndexOutOfBounds(Self, Items, Index);
R:=FindComponent('RadioButton'+IntToStr(Index)) as TRadioButton;
if Assigned(R) then
Result:=R.Enabled
else
Result:=False;
end;
procedure TRxDBRadioGroup.SetItemEnabled(Index: integer; AValue: boolean);
var
R:TRadioButton;
begin
if (Index < -1) or (Index >= Items.Count) then
RaiseIndexOutOfBounds(Self, Items, Index);
R:=FindComponent('RadioButton'+IntToStr(Index)) as TRadioButton;
if Assigned(R) then
R.Enabled:=AValue;
end;
{ TCustomRxDBProgressBar }