mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-17 14:49:28 +02:00
lcl: fix setting radiogroup.itemindex under gtk2. Issue #22013
git-svn-id: trunk@37264 -
This commit is contained in:
parent
2b2f0f00f8
commit
aa7b1efed9
@ -627,7 +627,6 @@ type
|
||||
procedure UpdateTabStops;
|
||||
protected
|
||||
class procedure WSRegisterClass; override;
|
||||
procedure Loaded; override;
|
||||
procedure InitializeWnd; override;
|
||||
procedure UpdateRadioButtonStates; virtual;
|
||||
procedure ReadState(Reader: TReader); override;
|
||||
|
@ -95,13 +95,9 @@ begin
|
||||
if FCreatingWnd then RaiseGDBException('TCustomRadioGroup.InitializeWnd');
|
||||
FCreatingWnd := true;
|
||||
//DebugLn('[TCustomRadioGroup.InitializeWnd] A ',Name,':',ClassName,' FItems.Count=',FItems.Count,' HandleAllocated=',HandleAllocated,' ItemIndex=',ItemIndex);
|
||||
|
||||
UpdateItems;
|
||||
inherited InitializeWnd;
|
||||
|
||||
if (FHiddenButton<>nil) and (FHiddenButton.Parent=Self) then
|
||||
FHiddenButton.HandleNeeded;
|
||||
RealizeItemIndex;
|
||||
|
||||
FCreatingWnd := false;
|
||||
end;
|
||||
|
||||
@ -190,13 +186,9 @@ begin
|
||||
ARadioButton.Caption := FItems[i];
|
||||
ARadioButton.Parent := Self;
|
||||
end;
|
||||
with FHiddenButton do
|
||||
begin
|
||||
FHiddenButton.Visible:=false;
|
||||
Parent:=Self;
|
||||
if HandleAllocated then
|
||||
FHiddenButton.HandleNeeded;
|
||||
end;
|
||||
FHiddenButton.Parent:=Self;
|
||||
if HandleAllocated then
|
||||
FHiddenButton.HandleNeeded;
|
||||
|
||||
// the checked and unchecked states can be applied only after all other
|
||||
for i := 0 to FItems.Count-1 do
|
||||
@ -225,12 +217,6 @@ begin
|
||||
//DebugLn('TCustomRadioGroup.UpdateControlsPerLine ',dbgs(ChildSizing.ControlsPerLine),' ',dbgs(NewControlsPerLine),' FColumns=',dbgs(FColumns),' FItems.Count=',dbgs(FItems.Count),' ',dbgs(ChildSizing.Layout=cclLeftToRightThenTopToBottom));
|
||||
end;
|
||||
|
||||
procedure TCustomRadioGroup.Loaded;
|
||||
begin
|
||||
inherited Loaded;
|
||||
UpdateItems;
|
||||
end;
|
||||
|
||||
procedure TCustomRadioGroup.ItemKeyDown(Sender: TObject; var Key: Word;
|
||||
Shift: TShiftState);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user