mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-05 06:37:20 +01:00
Adds TRadioGroup.OnSelectionChanged see bug #21155
git-svn-id: trunk@34957 -
This commit is contained in:
parent
98a0eef795
commit
6a8ddee62f
@ -607,6 +607,7 @@ type
|
||||
FItems: TStrings;
|
||||
FLastClickedItemIndex: integer;
|
||||
FOnClick: TNotifyEvent;
|
||||
FOnSelectionChanged: TNotifyEvent;
|
||||
FReading: boolean;
|
||||
FUpdatingItems: Boolean;
|
||||
procedure Changed(Sender: TObject);
|
||||
@ -647,6 +648,7 @@ 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 OnSelectionChanged: TNotifyEvent read FOnSelectionChanged write FOnSelectionChanged;
|
||||
end;
|
||||
|
||||
|
||||
@ -691,6 +693,7 @@ type
|
||||
property OnMouseMove;
|
||||
property OnMouseUp;
|
||||
property OnResize;
|
||||
property OnSelectionChanged;
|
||||
property OnStartDrag;
|
||||
property OnUTF8KeyPress;
|
||||
property ParentBidiMode;
|
||||
|
||||
@ -403,8 +403,11 @@ begin
|
||||
FItemIndex := Value;
|
||||
// trigger event to be delphi compat, even if handle isn't allocated.
|
||||
// issue #15989
|
||||
if (Value <> OldItemIndex) and not FCreatingWnd and
|
||||
Assigned(FOnClick) then FOnClick(Self);
|
||||
if (Value <> OldItemIndex) and not FCreatingWnd then
|
||||
begin
|
||||
if Assigned(FOnClick) then FOnClick(Self);
|
||||
if Assigned(FOnSelectionChanged) then FOnSelectionChanged(Self);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
//DebugLn('TCustomRadioGroup.SetItemIndex ',dbgsName(Self),' END Old=',dbgs(FItemIndex),' New=',dbgs(Value));
|
||||
@ -436,6 +439,8 @@ begin
|
||||
// for Delphi compatility: OnClick should be invoked, whenever ItemIndex
|
||||
// has changed
|
||||
if Assigned (FOnClick) then FOnClick(Self);
|
||||
// And a better named LCL equivalent
|
||||
if Assigned (FOnSelectionChanged) then FOnSelectionChanged(Self);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
|
||||
Loading…
Reference in New Issue
Block a user