ExCtrls: Add property ItemEnabled[] to TRadioGroupEx and TCheckGroupEx.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8710 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2023-02-18 17:36:27 +00:00
parent 04ffc7bc2e
commit 0f9c884d87

View File

@@ -321,11 +321,13 @@ type
FOnItemEnter: TNotifyEvent;
FOnItemExit: TNotifyEvent;
FOnSelectionChanged: TNotifyEvent;
function GetItemEnabled(AIndex: Integer): Boolean;
procedure SetAutoFill(const AValue: Boolean);
procedure SetColumnLayout(const AValue: TColumnLayout);
procedure SetColumns(const AValue: integer);
procedure SetImages(const AValue: TCustomImageList);
procedure SetImagesWidth(const AValue: Integer);
procedure SetItemEnabled(AIndex: Integer; AValue: Boolean);
procedure SetItems(const AValue: TStrings);
procedure SetOnGetImageIndex(const AValue: TGetImageIndexEvent);
procedure SetReadOnly(const AValue: Boolean);
@@ -346,6 +348,7 @@ type
property Columns: Integer read FColumns write SetColumns default 1;
property Images: TCustomImageList read FImages write SetImages;
property ImagesWidth: Integer read FImagesWidth write SetImagesWidth default 0;
property ItemEnabled[AIndex: Integer]: Boolean read GetItemEnabled write SetItemEnabled;
property Items: TStrings read FItems write SetItems;
property ReadOnly: Boolean read FReadOnly write SetReadOnly default false;
property OnClick: TNotifyEvent read FOnClick write FOnClick;
@@ -385,6 +388,7 @@ type
public
property ButtonCount: Integer read GetButtonCount;
property Buttons[AIndex: Integer]: TRadioButtonEx read GetButtons;
property ItemEnabled;
published
constructor Create(AOwner: TComponent); override;
end;
@@ -484,6 +488,7 @@ type
constructor Create(AOwner: TComponent); override;
property ButtonCount: Integer read GetButtonCount;
property Buttons[AIndex: Integer]: TCheckBoxEx read GetButtons;
property ItemEnabled;
public
property Checked[Index: integer]: boolean read GetChecked write SetChecked;
property CheckEnabled[Index: integer]: boolean read GetCheckEnabled write SetCheckEnabled;
@@ -1437,6 +1442,11 @@ begin
// no flipping
end;
function TCustomCheckControlGroupEx.GetItemEnabled(AIndex: Integer): Boolean;
begin
Result := TControl(FButtonList.Items[AIndex]).Enabled;
end;
procedure TCustomCheckControlGroupEx.ItemEnter(Sender: TObject);
begin
if Assigned(FOnItemEnter) then FOnItemEnter(Sender);
@@ -1549,6 +1559,12 @@ begin
TCustomCheckControlEx(FButtonList[i]).ImagesWidth := FImagesWidth;
end;
procedure TCustomCheckControlGroupEx.SetItemEnabled(AIndex: Integer;
AValue: Boolean);
begin
TControl(FButtonList[AIndex]).Enabled := AValue;
end;
procedure TCustomCheckControlGroupEx.SetItems(const AValue: TStrings);
begin
if (AValue <> FItems) then