lcl: fix setting radiogroup.itemindex under gtk2. Issue #22013

git-svn-id: trunk@37264 -
This commit is contained in:
blikblum 2012-05-13 10:31:27 +00:00
parent 2b2f0f00f8
commit aa7b1efed9
2 changed files with 4 additions and 19 deletions

View File

@ -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;

View File

@ -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);