diff --git a/.gitattributes b/.gitattributes index 66857c2a1c..9b49013c67 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4455,6 +4455,7 @@ lcl/include/buttoncontrol.inc svneol=native#text/pascal lcl/include/buttonglyph.inc svneol=native#text/pascal lcl/include/buttons.inc svneol=native#text/pascal lcl/include/canvas.inc svneol=native#text/pascal +lcl/include/checkbox.inc svneol=native#text/pascal lcl/include/clipbrd.inc svneol=native#text/pascal lcl/include/colorbutton.inc svneol=native#text/pascal lcl/include/colordialog.inc svneol=native#text/pascal diff --git a/lcl/include/checkbox.inc b/lcl/include/checkbox.inc new file mode 100644 index 0000000000..265f55ed20 --- /dev/null +++ b/lcl/include/checkbox.inc @@ -0,0 +1,33 @@ +{%MainUnit ../stdctrls.pp} + +{****************************************************************************** + checkbox.inc + ****************************************************************************** + + ***************************************************************************** + * * + * This file is part of the Lazarus Component Library (LCL) * + * * + * See the file COPYING.modifiedLGPL.txt, included in this distribution, * + * for details about the copyright. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * * + ***************************************************************************** +} + +// included by stdctrls.pp + +{ TCheckBox } + +constructor TCheckBox.Create(TheOwner: TComponent); +begin + inherited Create(TheOwner); + fCompStyle := csCheckbox; + TabStop := True; + AutoSize := True; + //FState := cbUnchecked; + //FAllowGrayed := false; +end; diff --git a/lcl/include/customcheckbox.inc b/lcl/include/customcheckbox.inc index 5c0b911231..c69e687057 100644 --- a/lcl/include/customcheckbox.inc +++ b/lcl/include/customcheckbox.inc @@ -92,13 +92,9 @@ end; constructor TCustomCheckBox.Create(TheOwner: TComponent); begin inherited Create(TheOwner); - fCompStyle := csCheckbox; - FState := cbUnchecked; - FAllowGrayed := false; - TabStop := true; + //todo: move to TButtonControl with GetControlClassDefaultSize do SetInitialBounds(0, 0, CX, CY); - AutoSize := true; end; {------------------------------------------------------------------------------ diff --git a/lcl/include/radiobutton.inc b/lcl/include/radiobutton.inc index c47b8f3c34..81724738fa 100644 --- a/lcl/include/radiobutton.inc +++ b/lcl/include/radiobutton.inc @@ -53,6 +53,7 @@ constructor TRadioButton.Create(TheOwner : TComponent); begin inherited Create(TheOwner); fCompStyle := csRadioButton; + AutoSize := True; end; {------------------------------------------------------------------------------ @@ -93,6 +94,8 @@ class procedure TRadioButton.WSRegisterClass; begin inherited WSRegisterClass; RegisterRadioButton; + RegisterPropertyToSkip(TRadioButton, 'State', 'Removed in 0.9.29. It should not be allowed to set the State directly', ''); + RegisterPropertyToSkip(TRadioButton, 'AllowGrayed', 'Removed in 0.9.29. Grayed state is not supported by TRadioButton', ''); end; function TRadioButton.DialogChar(var Message: TLMKey): boolean; diff --git a/lcl/include/togglebox.inc b/lcl/include/togglebox.inc index 3a3efd774f..33dc2bf580 100644 --- a/lcl/include/togglebox.inc +++ b/lcl/include/togglebox.inc @@ -32,7 +32,7 @@ constructor TToggleBox.Create(TheOwner : TComponent); begin inherited Create(TheOwner); fCompStyle := csToggleBox; - AutoSize := False; + TabStop := True; end; {------------------------------------------------------------------------------} diff --git a/lcl/stdctrls.pp b/lcl/stdctrls.pp index 249dea8eb3..ddeb4100d5 100644 --- a/lcl/stdctrls.pp +++ b/lcl/stdctrls.pp @@ -1204,10 +1204,8 @@ type public constructor Create(TheOwner: TComponent); override; public - property AutoSize default true; property AllowGrayed: Boolean read FAllowGrayed write FAllowGrayed default false; property State: TCheckBoxState read GetState write SetState default cbUnchecked; - property TabStop default true; property OnChange; end; @@ -1216,12 +1214,14 @@ type { TCheckBox } TCheckBox = class(TCustomCheckBox) + public + constructor Create(TheOwner: TComponent); override; published property Action; property Align; property AllowGrayed; property Anchors; - property AutoSize; + property AutoSize default True; property BidiMode; property BorderSpacing; property Caption; @@ -1263,7 +1263,7 @@ type property ShowHint; property State; property TabOrder; - property TabStop; + property TabStop default True; property Visible; end; @@ -1278,7 +1278,7 @@ type published property AllowGrayed; property Anchors; - property AutoSize default false; + property AutoSize; property BorderSpacing; property Caption; property Checked; @@ -1305,7 +1305,7 @@ type property ShowHint; property State; property TabOrder; - property TabStop; + property TabStop default True; property Visible; end; @@ -1323,9 +1323,8 @@ type constructor Create(TheOwner: TComponent); override; published property Align; - property AllowGrayed; property Anchors; - property AutoSize; + property AutoSize default True; property BidiMode; property BorderSpacing; property Caption; @@ -1363,9 +1362,8 @@ type property ParentShowHint; property PopupMenu; property ShowHint; - property State; property TabOrder; - property TabStop; + property TabStop default False; property Visible; end; @@ -1564,6 +1562,7 @@ end; {$I buttoncontrol.inc} {$I buttons.inc} +{$I checkbox.inc} {$I radiobutton.inc} {$I togglebox.inc}