diff --git a/lcl/extctrls.pp b/lcl/extctrls.pp index 83ab7a4d06..74e47c7fcd 100644 --- a/lcl/extctrls.pp +++ b/lcl/extctrls.pp @@ -648,6 +648,7 @@ type procedure ItemKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); procedure ItemResize(Sender: TObject); protected + procedure InitializeWnd; override; procedure UpdateRadioButtonStates; virtual; procedure ReadState(Reader: TReader); override; procedure SetItem(Value: TStrings); @@ -660,7 +661,6 @@ type constructor Create(TheOwner: TComponent); override; destructor Destroy; override; function CanModify: boolean; virtual; - procedure CreateWnd; override; function Rows: integer; public property AutoFill: Boolean read FAutoFill write SetAutoFill; diff --git a/lcl/include/radiogroup.inc b/lcl/include/radiogroup.inc index e01c0a1f80..c03008f739 100644 --- a/lcl/include/radiogroup.inc +++ b/lcl/include/radiogroup.inc @@ -92,27 +92,27 @@ begin end; {------------------------------------------------------------------------------ - Method: TCustomRadioGroup.CreateWnd + Method: TCustomRadioGroup.InitializeWnd Params: none Returns: Nothing Create the visual component of the Radiogroup. ------------------------------------------------------------------------------} -procedure TCustomRadioGroup.CreateWnd; +procedure TCustomRadioGroup.InitializeWnd; var i : integer; temp : TRadioButton; begin if FCreatingWnd then exit; FCreatingWnd := true; - //DebugLn('[TCustomRadioGroup.CreateWnd] 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); // destroy radiobuttons, if there are too many while FButtonList.Count>FItems.Count do begin TRadioButton(FButtonList[FButtonList.Count-1]).Free; FButtonList.Delete(FButtonList.Count-1); end; - //DebugLn('[TCustomRadioGroup.CreateWnd] B ',Name,':',ClassName,' FItems.Count=',FItems.Count,' HandleAllocated=',HandleAllocated); + //DebugLn('[TCustomRadioGroup.InitializeWnd] B ',Name,':',ClassName,' FItems.Count=',FItems.Count,' HandleAllocated=',HandleAllocated); // create as many TRadioButton as needed while (FButtonList.Count0 then begin for i:=0 to FItems.Count-1 do begin Temp := TRadioButton(FButtonList[i]); @@ -167,7 +163,7 @@ begin FHiddenButton.Checked:=(fItemIndex=-1); UpdateTabStops; end; - //DebugLn('[TCustomRadioGroup.CreateWnd] F ',Name,':',ClassName,' FItems.Count=',FItems.Count,' HandleAllocated=',HandleAllocated,' ItemIndex=',ItemIndex); + //DebugLn('[TCustomRadioGroup.InitializeWnd] F ',Name,':',ClassName,' FItems.Count=',FItems.Count,' HandleAllocated=',HandleAllocated,' ItemIndex=',ItemIndex); FCreatingWnd := false; end;