mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 03:49:30 +02:00
MG: fixed designer component deletion
git-svn-id: trunk@3252 -
This commit is contained in:
parent
be6391b14b
commit
ee117c5aeb
@ -516,7 +516,7 @@ Begin
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
Component.Free;
|
Component.Free;
|
||||||
{$IFDEF VerboseFormEditor}
|
{$IFDEF VerboseFormEditor}
|
||||||
writeln('TComponentInterface.Delete B ',Component.Name,':',Component.ClassName);
|
writeln('TComponentInterface.Delete B ');
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
Destroy;
|
Destroy;
|
||||||
Result := True;
|
Result := True;
|
||||||
|
@ -14,6 +14,13 @@
|
|||||||
*****************************************************************************
|
*****************************************************************************
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function TButtonControl.IsCheckedStored: boolean;
|
||||||
|
begin
|
||||||
|
Result := true;
|
||||||
|
//Result := (ActionLink = nil)
|
||||||
|
// or not TButtonActionLink(ActionLink).IsCheckedLinked;
|
||||||
|
end;
|
||||||
|
|
||||||
function TButtonControl.GetChecked: Boolean;
|
function TButtonControl.GetChecked: Boolean;
|
||||||
begin
|
begin
|
||||||
GetChecked := False;
|
GetChecked := False;
|
||||||
@ -21,14 +28,12 @@ end;
|
|||||||
|
|
||||||
procedure TButtonControl.SetChecked(Value: Boolean);
|
procedure TButtonControl.SetChecked(Value: Boolean);
|
||||||
begin
|
begin
|
||||||
|
// this is done in the overriden methods
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
constructor TButtonControl.Create(AOwner: TComponent);
|
constructor TButtonControl.Create(AOwner: TComponent);
|
||||||
begin
|
begin
|
||||||
inherited Create(AOwner);
|
inherited Create(AOwner);
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// included by stdctrls.pp
|
// included by stdctrls.pp
|
||||||
|
@ -111,7 +111,7 @@ end;
|
|||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
function TCustomCheckBox.GetChecked : Boolean;
|
function TCustomCheckBox.GetChecked : Boolean;
|
||||||
begin
|
begin
|
||||||
GetChecked := (GetState = cbChecked);
|
GetChecked := (GetState = cbChecked);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
@ -123,19 +123,18 @@ end;
|
|||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
procedure TCustomCheckBox.SetChecked(Value : Boolean);
|
procedure TCustomCheckBox.SetChecked(Value : Boolean);
|
||||||
var
|
var
|
||||||
OldState : TCheckBoxState;
|
OldState : TCheckBoxState;
|
||||||
begin
|
begin
|
||||||
OldState := FState;
|
OldState := FState;
|
||||||
If Value then
|
If Value then
|
||||||
FState := cbChecked
|
FState := cbChecked
|
||||||
else
|
else
|
||||||
FState := cbUnChecked;
|
FState := cbUnChecked;
|
||||||
if FState <> OldState then
|
if FState <> OldState then
|
||||||
begin
|
begin
|
||||||
ApplyChanges;
|
ApplyChanges;
|
||||||
if assigned (OnClick)
|
if Assigned(OnClick) then OnClick(Self);
|
||||||
then OnClick (self);
|
end;
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
@ -147,10 +146,10 @@ end;
|
|||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
procedure TCustomCheckBox.Toggle;
|
procedure TCustomCheckBox.Toggle;
|
||||||
begin
|
begin
|
||||||
if GetChecked then
|
if GetChecked then
|
||||||
SetChecked(False)
|
SetChecked(False)
|
||||||
else
|
else
|
||||||
SetChecked(True);
|
SetChecked(True);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
@ -162,12 +161,15 @@ end;
|
|||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
procedure TCustomCheckBox.ApplyChanges;
|
procedure TCustomCheckBox.ApplyChanges;
|
||||||
begin
|
begin
|
||||||
if HandleAllocated
|
if HandleAllocated then
|
||||||
then CNSendMessage (LM_SetValue, Self, @fState);
|
CNSendMessage(LM_SetValue,Self,@fState);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$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
|
Revision 1.5 2002/07/23 07:40:51 lazarus
|
||||||
MG: fixed get widget position for inherited gdkwindows
|
MG: fixed get widget position for inherited gdkwindows
|
||||||
|
|
||||||
|
@ -376,10 +376,11 @@ type
|
|||||||
TButtonControl = class(TWinControl)
|
TButtonControl = class(TWinControl)
|
||||||
private
|
private
|
||||||
FClicksDisabled: Boolean;
|
FClicksDisabled: Boolean;
|
||||||
|
function IsCheckedStored: boolean;
|
||||||
protected
|
protected
|
||||||
function GetChecked: Boolean; virtual;
|
function GetChecked: Boolean; virtual;
|
||||||
procedure SetChecked(Value: 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;
|
property ClicksDisabled: Boolean read FClicksDisabled write FClicksDisabled;
|
||||||
public
|
public
|
||||||
constructor Create(AOwner: TComponent); override;
|
constructor Create(AOwner: TComponent); override;
|
||||||
@ -631,6 +632,9 @@ end.
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$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
|
Revision 1.35 2002/08/25 13:31:35 lazarus
|
||||||
MG: replaced C-style operators
|
MG: replaced C-style operators
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user