mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-21 11:05:49 +01:00
LCL: added TControl.AddHandlerBeforeDestruction
git-svn-id: trunk@35090 -
This commit is contained in:
parent
1f910951e2
commit
aad4d125c5
@ -872,7 +872,8 @@ type
|
|||||||
chtOnVisibleChanged,
|
chtOnVisibleChanged,
|
||||||
chtOnEnabledChanging,
|
chtOnEnabledChanging,
|
||||||
chtOnEnabledChanged,
|
chtOnEnabledChanged,
|
||||||
chtOnKeyDown
|
chtOnKeyDown,
|
||||||
|
chtOnBeforeDestruction
|
||||||
);
|
);
|
||||||
|
|
||||||
TLayoutAdjustmentPolicy = (
|
TLayoutAdjustmentPolicy = (
|
||||||
@ -1118,6 +1119,7 @@ type
|
|||||||
procedure SetAccessibleValue(AValue: TCaption);
|
procedure SetAccessibleValue(AValue: TCaption);
|
||||||
procedure SetAccessibleRole(AValue: TLazAccessibilityRole);
|
procedure SetAccessibleRole(AValue: TLazAccessibilityRole);
|
||||||
procedure SetAnchorSide(Kind: TAnchorKind; AValue: TAnchorSide);
|
procedure SetAnchorSide(Kind: TAnchorKind; AValue: TAnchorSide);
|
||||||
|
procedure SetAnchorSide(AIndex: Integer; AValue: TAnchorSide);
|
||||||
procedure SetBorderSpacing(const AValue: TControlBorderSpacing);
|
procedure SetBorderSpacing(const AValue: TControlBorderSpacing);
|
||||||
procedure SetBoundsRect(const ARect: TRect);
|
procedure SetBoundsRect(const ARect: TRect);
|
||||||
procedure SetBoundsRectForNewParent(const AValue: TRect);
|
procedure SetBoundsRectForNewParent(const AValue: TRect);
|
||||||
@ -1455,6 +1457,7 @@ type
|
|||||||
public
|
public
|
||||||
constructor Create(TheOwner: TComponent);override;
|
constructor Create(TheOwner: TComponent);override;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
|
procedure BeforeDestruction; override;
|
||||||
procedure EditingDone; virtual;
|
procedure EditingDone; virtual;
|
||||||
procedure ExecuteDefaultAction; virtual;
|
procedure ExecuteDefaultAction; virtual;
|
||||||
procedure ExecuteCancelAction; virtual;
|
procedure ExecuteCancelAction; virtual;
|
||||||
@ -1521,6 +1524,9 @@ type
|
|||||||
procedure AddHandlerOnKeyDown(const OnKeyDownEvent: TKeyEvent;
|
procedure AddHandlerOnKeyDown(const OnKeyDownEvent: TKeyEvent;
|
||||||
AsFirst: boolean = false);
|
AsFirst: boolean = false);
|
||||||
procedure RemoveHandlerOnKeyDown(const OnKeyDownEvent: TKeyEvent);
|
procedure RemoveHandlerOnKeyDown(const OnKeyDownEvent: TKeyEvent);
|
||||||
|
procedure AddHandlerOnBeforeDestruction(const OnBeforeDestructionEvent: TNotifyEvent;
|
||||||
|
AsFirst: boolean = false);
|
||||||
|
procedure RemoveHandlerOnBeforeDestruction(const OnBeforeDestructionEvent: TNotifyEvent);
|
||||||
public
|
public
|
||||||
// standard properties, which should be supported by all descendants
|
// standard properties, which should be supported by all descendants
|
||||||
property AccessibleDescription: TCaption read GetAccessibleDescription write SetAccessibleDescription;
|
property AccessibleDescription: TCaption read GetAccessibleDescription write SetAccessibleDescription;
|
||||||
|
|||||||
@ -2139,6 +2139,11 @@ begin
|
|||||||
GetAnchorSide(Kind).Assign(AValue);
|
GetAnchorSide(Kind).Assign(AValue);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TControl.SetAnchorSide(AIndex: Integer; AValue: TAnchorSide);
|
||||||
|
begin
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TControl.SetBorderSpacing(const AValue: TControlBorderSpacing);
|
procedure TControl.SetBorderSpacing(const AValue: TControlBorderSpacing);
|
||||||
begin
|
begin
|
||||||
if FBorderSpacing=AValue then exit;
|
if FBorderSpacing=AValue then exit;
|
||||||
@ -4554,6 +4559,18 @@ begin
|
|||||||
RemoveHandler(chtOnKeyDown,TMethod(OnKeyDownEvent));
|
RemoveHandler(chtOnKeyDown,TMethod(OnKeyDownEvent));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TControl.AddHandlerOnBeforeDestruction(
|
||||||
|
const OnBeforeDestructionEvent: TNotifyEvent; AsFirst: boolean);
|
||||||
|
begin
|
||||||
|
AddHandler(chtOnBeforeDestruction,TMethod(OnBeforeDestructionEvent));
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TControl.RemoveHandlerOnBeforeDestruction(
|
||||||
|
const OnBeforeDestructionEvent: TNotifyEvent);
|
||||||
|
begin
|
||||||
|
RemoveHandler(chtOnBeforeDestruction,TMethod(OnBeforeDestructionEvent));
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TControl.RemoveAllHandlersOfObject(AnObject: TObject);
|
procedure TControl.RemoveAllHandlersOfObject(AnObject: TObject);
|
||||||
var
|
var
|
||||||
HandlerType: TControlHandlerType;
|
HandlerType: TControlHandlerType;
|
||||||
@ -4711,6 +4728,12 @@ begin
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TControl.BeforeDestruction;
|
||||||
|
begin
|
||||||
|
inherited BeforeDestruction;
|
||||||
|
DoCallNotifyHandler(chtOnBeforeDestruction);
|
||||||
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
Method: TControl.Create
|
Method: TControl.Create
|
||||||
Params: None
|
Params: None
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user