mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-08 00:18:16 +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;
|
FUpdatingItems: Boolean;
|
||||||
procedure Changed(Sender: TObject);
|
procedure Changed(Sender: TObject);
|
||||||
procedure Clicked(Sender: TObject);
|
procedure Clicked(Sender: TObject);
|
||||||
|
function GetButton(Index: integer): TRadioButton;
|
||||||
procedure ItemEnter(Sender: TObject);
|
procedure ItemEnter(Sender: TObject);
|
||||||
procedure ItemExit(Sender: TObject);
|
procedure ItemExit(Sender: TObject);
|
||||||
procedure ItemKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
procedure ItemKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||||
@ -769,6 +770,7 @@ type
|
|||||||
function Rows: integer;
|
function Rows: integer;
|
||||||
public
|
public
|
||||||
property AutoFill: Boolean read FAutoFill write SetAutoFill;
|
property AutoFill: Boolean read FAutoFill write SetAutoFill;
|
||||||
|
property Buttons[Index: integer]: TRadioButton read GetButton;
|
||||||
property ItemIndex: integer read GetItemIndex write SetItemIndex default -1;
|
property ItemIndex: integer read GetItemIndex write SetItemIndex default -1;
|
||||||
property Items: TStrings read FItems write SetItems;
|
property Items: TStrings read FItems write SetItems;
|
||||||
property Columns: integer read FColumns write SetColumns default 1;
|
property Columns: integer read FColumns write SetColumns default 1;
|
||||||
@ -859,6 +861,7 @@ type
|
|||||||
FColumns: integer;
|
FColumns: integer;
|
||||||
FOnItemClick: TCheckGroupClicked;
|
FOnItemClick: TCheckGroupClicked;
|
||||||
FUpdatingItems: Boolean;
|
FUpdatingItems: Boolean;
|
||||||
|
function GetButton(Index: integer): TCheckBox;
|
||||||
function GetChecked(Index: integer): boolean;
|
function GetChecked(Index: integer): boolean;
|
||||||
function GetCheckEnabled(Index: integer): boolean;
|
function GetCheckEnabled(Index: integer): boolean;
|
||||||
procedure Clicked(Sender: TObject);
|
procedure Clicked(Sender: TObject);
|
||||||
@ -895,6 +898,7 @@ type
|
|||||||
function Rows: integer;
|
function Rows: integer;
|
||||||
public
|
public
|
||||||
property AutoFill: boolean read FAutoFill write SetAutoFill;
|
property AutoFill: boolean read FAutoFill write SetAutoFill;
|
||||||
|
property Buttons[Index: integer]: TCheckBox read GetButton;
|
||||||
property Items: TStrings read FItems write SetItems;
|
property Items: TStrings read FItems write SetItems;
|
||||||
property Checked[Index: integer]: boolean read GetChecked write SetChecked;
|
property Checked[Index: integer]: boolean read GetChecked write SetChecked;
|
||||||
property CheckEnabled[Index: integer]: boolean read GetCheckEnabled write SetCheckEnabled;
|
property CheckEnabled[Index: integer]: boolean read GetCheckEnabled write SetCheckEnabled;
|
||||||
|
@ -318,6 +318,11 @@ begin
|
|||||||
Result:=TCheckBox(FButtonList[Index]).Checked;
|
Result:=TCheckBox(FButtonList[Index]).Checked;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TCustomCheckGroup.GetButton(Index: integer): TCheckBox;
|
||||||
|
begin
|
||||||
|
result := TCheckBox(FButtonList[Index]);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCustomCheckGroup.SetChecked(Index: integer; const AValue: boolean);
|
procedure TCustomCheckGroup.SetChecked(Index: integer; const AValue: boolean);
|
||||||
begin
|
begin
|
||||||
if (Index < -1) or (Index >= FItems.Count) then
|
if (Index < -1) or (Index >= FItems.Count) then
|
||||||
|
@ -520,6 +520,18 @@ Begin
|
|||||||
CheckItemIndexChanged;
|
CheckItemIndexChanged;
|
||||||
end;
|
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
|
Method: TCustomRadioGroup.Changed
|
||||||
Params: sender - the calling object
|
Params: sender - the calling object
|
||||||
|
Loading…
Reference in New Issue
Block a user