You've already forked lazarus-ccr
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:
@ -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 }
|
||||
|
||||
|
Reference in New Issue
Block a user