MG: fixed designer component deletion

git-svn-id: trunk@3252 -
This commit is contained in:
lazarus 2002-08-27 14:33:37 +00:00
parent be6391b14b
commit ee117c5aeb
4 changed files with 35 additions and 24 deletions

View File

@ -516,7 +516,7 @@ Begin
{$ENDIF}
Component.Free;
{$IFDEF VerboseFormEditor}
writeln('TComponentInterface.Delete B ',Component.Name,':',Component.ClassName);
writeln('TComponentInterface.Delete B ');
{$ENDIF}
Destroy;
Result := True;

View File

@ -14,6 +14,13 @@
*****************************************************************************
}
function TButtonControl.IsCheckedStored: boolean;
begin
Result := true;
//Result := (ActionLink = nil)
// or not TButtonActionLink(ActionLink).IsCheckedLinked;
end;
function TButtonControl.GetChecked: Boolean;
begin
GetChecked := False;
@ -21,14 +28,12 @@ end;
procedure TButtonControl.SetChecked(Value: Boolean);
begin
// this is done in the overriden methods
end;
constructor TButtonControl.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
end;
// included by stdctrls.pp

View File

@ -111,7 +111,7 @@ end;
------------------------------------------------------------------------------}
function TCustomCheckBox.GetChecked : Boolean;
begin
GetChecked := (GetState = cbChecked);
GetChecked := (GetState = cbChecked);
end;
{------------------------------------------------------------------------------
@ -123,19 +123,18 @@ end;
------------------------------------------------------------------------------}
procedure TCustomCheckBox.SetChecked(Value : Boolean);
var
OldState : TCheckBoxState;
OldState : TCheckBoxState;
begin
OldState := FState;
If Value then
FState := cbChecked
else
FState := cbUnChecked;
if FState <> OldState then
begin
ApplyChanges;
if assigned (OnClick)
then OnClick (self);
end;
OldState := FState;
If Value then
FState := cbChecked
else
FState := cbUnChecked;
if FState <> OldState then
begin
ApplyChanges;
if Assigned(OnClick) then OnClick(Self);
end;
end;
{------------------------------------------------------------------------------
@ -147,10 +146,10 @@ end;
------------------------------------------------------------------------------}
procedure TCustomCheckBox.Toggle;
begin
if GetChecked then
SetChecked(False)
else
SetChecked(True);
if GetChecked then
SetChecked(False)
else
SetChecked(True);
end;
{------------------------------------------------------------------------------
@ -162,12 +161,15 @@ end;
------------------------------------------------------------------------------}
procedure TCustomCheckBox.ApplyChanges;
begin
if HandleAllocated
then CNSendMessage (LM_SetValue, Self, @fState);
if HandleAllocated then
CNSendMessage(LM_SetValue,Self,@fState);
end;
{
$Log$
Revision 1.6 2002/08/27 14:33:37 lazarus
MG: fixed designer component deletion
Revision 1.5 2002/07/23 07:40:51 lazarus
MG: fixed get widget position for inherited gdkwindows

View File

@ -376,10 +376,11 @@ type
TButtonControl = class(TWinControl)
private
FClicksDisabled: Boolean;
function IsCheckedStored: boolean;
protected
function GetChecked: Boolean; virtual;
procedure SetChecked(Value: Boolean); virtual;
property Checked: Boolean read GetChecked write SetChecked;// stored IsCheckedStored default False;
property Checked: Boolean read GetChecked write SetChecked stored IsCheckedStored default False;
property ClicksDisabled: Boolean read FClicksDisabled write FClicksDisabled;
public
constructor Create(AOwner: TComponent); override;
@ -631,6 +632,9 @@ end.
{ =============================================================================
$Log$
Revision 1.36 2002/08/27 14:33:37 lazarus
MG: fixed designer component deletion
Revision 1.35 2002/08/25 13:31:35 lazarus
MG: replaced C-style operators