mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-14 02:19:39 +02:00
LCL: Allow access to buttons in CheckGroup and RadioGroup. Issue #40738, patch by Dean Mustakinov.
This commit is contained in:
parent
1dbfb8fee2
commit
f2a32ca78e
@ -734,6 +734,7 @@ type
|
||||
FUpdatingItems: Boolean;
|
||||
procedure Changed(Sender: TObject);
|
||||
procedure Clicked(Sender: TObject);
|
||||
function GetButton(Index: integer): TRadioButton;
|
||||
procedure ItemEnter(Sender: TObject);
|
||||
procedure ItemExit(Sender: TObject);
|
||||
procedure ItemKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||
@ -769,6 +770,7 @@ type
|
||||
function Rows: integer;
|
||||
public
|
||||
property AutoFill: Boolean read FAutoFill write SetAutoFill;
|
||||
property Buttons[Index: integer]: TRadioButton read GetButton;
|
||||
property ItemIndex: integer read GetItemIndex write SetItemIndex default -1;
|
||||
property Items: TStrings read FItems write SetItems;
|
||||
property Columns: integer read FColumns write SetColumns default 1;
|
||||
@ -859,6 +861,7 @@ type
|
||||
FColumns: integer;
|
||||
FOnItemClick: TCheckGroupClicked;
|
||||
FUpdatingItems: Boolean;
|
||||
function GetButton(Index: integer): TCheckBox;
|
||||
function GetChecked(Index: integer): boolean;
|
||||
function GetCheckEnabled(Index: integer): boolean;
|
||||
procedure Clicked(Sender: TObject);
|
||||
@ -895,6 +898,7 @@ type
|
||||
function Rows: integer;
|
||||
public
|
||||
property AutoFill: boolean read FAutoFill write SetAutoFill;
|
||||
property Buttons[Index: integer]: TCheckBox read GetButton;
|
||||
property Items: TStrings read FItems write SetItems;
|
||||
property Checked[Index: integer]: boolean read GetChecked write SetChecked;
|
||||
property CheckEnabled[Index: integer]: boolean read GetCheckEnabled write SetCheckEnabled;
|
||||
|
@ -318,6 +318,11 @@ begin
|
||||
Result:=TCheckBox(FButtonList[Index]).Checked;
|
||||
end;
|
||||
|
||||
function TCustomCheckGroup.GetButton(Index: integer): TCheckBox;
|
||||
begin
|
||||
result := TCheckBox(FButtonList[Index]);
|
||||
end;
|
||||
|
||||
procedure TCustomCheckGroup.SetChecked(Index: integer; const AValue: boolean);
|
||||
begin
|
||||
if (Index < -1) or (Index >= FItems.Count) then
|
||||
|
@ -520,6 +520,18 @@ Begin
|
||||
CheckItemIndexChanged;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Method: TCustomRadioGroup.GetButton
|
||||
Params: Index - index of radio button in a group
|
||||
|
||||
Return instance of radio button in a group
|
||||
------------------------------------------------------------------------------}
|
||||
|
||||
function TCustomRadioGroup.GetButton(Index: integer): TRadioButton;
|
||||
begin
|
||||
result := TRadioButton(FButtonList[Index]);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Method: TCustomRadioGroup.Changed
|
||||
Params: sender - the calling object
|
||||
|
Loading…
Reference in New Issue
Block a user