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/buttonglyph.inc svneol=native#text/pascal
lcl/include/buttons.inc svneol=native#text/pascal lcl/include/buttons.inc svneol=native#text/pascal
lcl/include/canvas.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/clipbrd.inc svneol=native#text/pascal
lcl/include/colorbutton.inc svneol=native#text/pascal lcl/include/colorbutton.inc svneol=native#text/pascal
lcl/include/colordialog.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); constructor TCustomCheckBox.Create(TheOwner: TComponent);
begin begin
inherited Create(TheOwner); inherited Create(TheOwner);
fCompStyle := csCheckbox; //todo: move to TButtonControl
FState := cbUnchecked;
FAllowGrayed := false;
TabStop := true;
with GetControlClassDefaultSize do with GetControlClassDefaultSize do
SetInitialBounds(0, 0, CX, CY); SetInitialBounds(0, 0, CX, CY);
AutoSize := true;
end; end;
{------------------------------------------------------------------------------ {------------------------------------------------------------------------------

View File

@ -53,6 +53,7 @@ constructor TRadioButton.Create(TheOwner : TComponent);
begin begin
inherited Create(TheOwner); inherited Create(TheOwner);
fCompStyle := csRadioButton; fCompStyle := csRadioButton;
AutoSize := True;
end; end;
{------------------------------------------------------------------------------ {------------------------------------------------------------------------------
@ -93,6 +94,8 @@ class procedure TRadioButton.WSRegisterClass;
begin begin
inherited WSRegisterClass; inherited WSRegisterClass;
RegisterRadioButton; 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; end;
function TRadioButton.DialogChar(var Message: TLMKey): boolean; function TRadioButton.DialogChar(var Message: TLMKey): boolean;

View File

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

View File

@ -1204,10 +1204,8 @@ type
public public
constructor Create(TheOwner: TComponent); override; constructor Create(TheOwner: TComponent); override;
public public
property AutoSize default true;
property AllowGrayed: Boolean read FAllowGrayed write FAllowGrayed default false; property AllowGrayed: Boolean read FAllowGrayed write FAllowGrayed default false;
property State: TCheckBoxState read GetState write SetState default cbUnchecked; property State: TCheckBoxState read GetState write SetState default cbUnchecked;
property TabStop default true;
property OnChange; property OnChange;
end; end;
@ -1216,12 +1214,14 @@ type
{ TCheckBox } { TCheckBox }
TCheckBox = class(TCustomCheckBox) TCheckBox = class(TCustomCheckBox)
public
constructor Create(TheOwner: TComponent); override;
published published
property Action; property Action;
property Align; property Align;
property AllowGrayed; property AllowGrayed;
property Anchors; property Anchors;
property AutoSize; property AutoSize default True;
property BidiMode; property BidiMode;
property BorderSpacing; property BorderSpacing;
property Caption; property Caption;
@ -1263,7 +1263,7 @@ type
property ShowHint; property ShowHint;
property State; property State;
property TabOrder; property TabOrder;
property TabStop; property TabStop default True;
property Visible; property Visible;
end; end;
@ -1278,7 +1278,7 @@ type
published published
property AllowGrayed; property AllowGrayed;
property Anchors; property Anchors;
property AutoSize default false; property AutoSize;
property BorderSpacing; property BorderSpacing;
property Caption; property Caption;
property Checked; property Checked;
@ -1305,7 +1305,7 @@ type
property ShowHint; property ShowHint;
property State; property State;
property TabOrder; property TabOrder;
property TabStop; property TabStop default True;
property Visible; property Visible;
end; end;
@ -1323,9 +1323,8 @@ type
constructor Create(TheOwner: TComponent); override; constructor Create(TheOwner: TComponent); override;
published published
property Align; property Align;
property AllowGrayed;
property Anchors; property Anchors;
property AutoSize; property AutoSize default True;
property BidiMode; property BidiMode;
property BorderSpacing; property BorderSpacing;
property Caption; property Caption;
@ -1363,9 +1362,8 @@ type
property ParentShowHint; property ParentShowHint;
property PopupMenu; property PopupMenu;
property ShowHint; property ShowHint;
property State;
property TabOrder; property TabOrder;
property TabStop; property TabStop default False;
property Visible; property Visible;
end; end;
@ -1564,6 +1562,7 @@ end;
{$I buttoncontrol.inc} {$I buttoncontrol.inc}
{$I buttons.inc} {$I buttons.inc}
{$I checkbox.inc}
{$I radiobutton.inc} {$I radiobutton.inc}
{$I togglebox.inc} {$I togglebox.inc}