mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-07-14 09:16:01 +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;
|
procedure UpdateTabStops;
|
||||||
protected
|
protected
|
||||||
class procedure WSRegisterClass; override;
|
class procedure WSRegisterClass; override;
|
||||||
procedure Loaded; override;
|
|
||||||
procedure InitializeWnd; override;
|
procedure InitializeWnd; override;
|
||||||
procedure UpdateRadioButtonStates; virtual;
|
procedure UpdateRadioButtonStates; virtual;
|
||||||
procedure ReadState(Reader: TReader); override;
|
procedure ReadState(Reader: TReader); override;
|
||||||
|
@ -95,13 +95,9 @@ begin
|
|||||||
if FCreatingWnd then RaiseGDBException('TCustomRadioGroup.InitializeWnd');
|
if FCreatingWnd then RaiseGDBException('TCustomRadioGroup.InitializeWnd');
|
||||||
FCreatingWnd := true;
|
FCreatingWnd := true;
|
||||||
//DebugLn('[TCustomRadioGroup.InitializeWnd] A ',Name,':',ClassName,' FItems.Count=',FItems.Count,' HandleAllocated=',HandleAllocated,' ItemIndex=',ItemIndex);
|
//DebugLn('[TCustomRadioGroup.InitializeWnd] A ',Name,':',ClassName,' FItems.Count=',FItems.Count,' HandleAllocated=',HandleAllocated,' ItemIndex=',ItemIndex);
|
||||||
|
UpdateItems;
|
||||||
inherited InitializeWnd;
|
inherited InitializeWnd;
|
||||||
|
|
||||||
if (FHiddenButton<>nil) and (FHiddenButton.Parent=Self) then
|
|
||||||
FHiddenButton.HandleNeeded;
|
|
||||||
RealizeItemIndex;
|
RealizeItemIndex;
|
||||||
|
|
||||||
FCreatingWnd := false;
|
FCreatingWnd := false;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -190,13 +186,9 @@ begin
|
|||||||
ARadioButton.Caption := FItems[i];
|
ARadioButton.Caption := FItems[i];
|
||||||
ARadioButton.Parent := Self;
|
ARadioButton.Parent := Self;
|
||||||
end;
|
end;
|
||||||
with FHiddenButton do
|
FHiddenButton.Parent:=Self;
|
||||||
begin
|
if HandleAllocated then
|
||||||
FHiddenButton.Visible:=false;
|
FHiddenButton.HandleNeeded;
|
||||||
Parent:=Self;
|
|
||||||
if HandleAllocated then
|
|
||||||
FHiddenButton.HandleNeeded;
|
|
||||||
end;
|
|
||||||
|
|
||||||
// the checked and unchecked states can be applied only after all other
|
// the checked and unchecked states can be applied only after all other
|
||||||
for i := 0 to FItems.Count-1 do
|
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));
|
//DebugLn('TCustomRadioGroup.UpdateControlsPerLine ',dbgs(ChildSizing.ControlsPerLine),' ',dbgs(NewControlsPerLine),' FColumns=',dbgs(FColumns),' FItems.Count=',dbgs(FItems.Count),' ',dbgs(ChildSizing.Layout=cclLeftToRightThenTopToBottom));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomRadioGroup.Loaded;
|
|
||||||
begin
|
|
||||||
inherited Loaded;
|
|
||||||
UpdateItems;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TCustomRadioGroup.ItemKeyDown(Sender: TObject; var Key: Word;
|
procedure TCustomRadioGroup.ItemKeyDown(Sender: TObject; var Key: Word;
|
||||||
Shift: TShiftState);
|
Shift: TShiftState);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user