lcl: don't publish TRadioButton State and AllowGrayed properties: Delphi compatible.

separate TCustomCheckBox/TCheckBox constructors to avoid double setting of AutoSize/TabStop in TToggleBox/TRadioButton

git-svn-id: trunk@27055 -
This commit is contained in:
blikblum 2010-08-10 20:12:40 +00:00
parent e50914e4bf
commit 4a9091c3a2
6 changed files with 48 additions and 16 deletions

1
.gitattributes vendored
View File

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

33
lcl/include/checkbox.inc Normal file
View File

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

View File

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

View File

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

View File

@ -32,7 +32,7 @@ constructor TToggleBox.Create(TheOwner : TComponent);
begin
inherited Create(TheOwner);
fCompStyle := csToggleBox;
AutoSize := False;
TabStop := True;
end;
{------------------------------------------------------------------------------}

View File

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