LCL: Fix TRadiogroup firing OnEnter/OnExit events when its ItemIndex changes. New events OnItemEnter/OnItemExit. Issue #37768.

git-svn-id: trunk@63898 -
This commit is contained in:
wp 2020-09-20 17:06:17 +00:00
parent a3272084cf
commit 90afc72ac7
2 changed files with 8 additions and 2 deletions

View File

@ -683,6 +683,8 @@ type
FItems: TStrings;
FLastClickedItemIndex: integer;
FOnClick: TNotifyEvent;
FOnItemEnter: TNotifyEvent;
FOnItemExit: TNotifyEvent;
FOnSelectionChanged: TNotifyEvent;
FReading: boolean;
FUpdatingItems: Boolean;
@ -725,6 +727,8 @@ type
property Columns: integer read FColumns write SetColumns default 1;
property ColumnLayout: TColumnLayout read FColumnLayout write SetColumnLayout default clHorizontalThenVertical;
property OnClick: TNotifyEvent read FOnClick write FOnClick;
property OnItemEnter: TNotifyEvent read FOnItemEnter write FOnItemEnter;
property OnItemExit: TNotifyEvent read FOnItemExit write FOnItemExit;
property OnSelectionChanged: TNotifyEvent read FOnSelectionChanged write FOnSelectionChanged;
end;
@ -762,6 +766,8 @@ type
property OnEndDrag;
property OnEnter;
property OnExit;
property OnItemEnter;
property OnItemExit;
property OnKeyDown;
property OnKeyPress;
property OnKeyUp;

View File

@ -146,12 +146,12 @@ end;
procedure TCustomRadioGroup.ItemEnter(Sender: TObject);
begin
DoEnter;
if Assigned(FOnItemEnter) then FOnItemEnter(Sender);
end;
procedure TCustomRadioGroup.ItemExit(Sender: TObject);
begin
DoExit;
if Assigned(FOnItemExit) then FOnItemExit(Sender);
end;
procedure TCustomRadioGroup.ItemResize(Sender: TObject);