mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-13 21:39:21 +02:00
LCL: TMenuItem.AddHandler: changed AsLast to AsFirst for consistency and implemented it
git-svn-id: trunk@39782 -
This commit is contained in:
parent
7392702afb
commit
62fb47e350
@ -963,9 +963,9 @@ begin
|
||||
end;
|
||||
|
||||
procedure TMenuItem.AddHandlerOnDestroy(const OnDestroyEvent: TNotifyEvent;
|
||||
AsLast: boolean);
|
||||
AsFirst: boolean);
|
||||
begin
|
||||
AddHandler(mihtDestroy, TMethod(OnDestroyEvent),AsLast);
|
||||
AddHandler(mihtDestroy, TMethod(OnDestroyEvent),not AsFirst);
|
||||
end;
|
||||
|
||||
procedure TMenuItem.RemoveHandlerOnDestroy(const OnDestroyEvent: TNotifyEvent);
|
||||
@ -974,11 +974,11 @@ begin
|
||||
end;
|
||||
|
||||
procedure TMenuItem.AddHandler(HandlerType: TMenuItemHandlerType;
|
||||
const AMethod: TMethod; AsLast: boolean);
|
||||
const AMethod: TMethod; AsFirst: boolean);
|
||||
begin
|
||||
if FMenuItemHandlers[HandlerType] = nil then
|
||||
FMenuItemHandlers[HandlerType] := TMethodList.Create;
|
||||
FMenuItemHandlers[HandlerType].Add(AMethod);
|
||||
FMenuItemHandlers[HandlerType].Add(AMethod,not AsFirst);
|
||||
end;
|
||||
|
||||
procedure TMenuItem.RemoveHandler(HandlerType: TMenuItemHandlerType;
|
||||
|
@ -246,10 +246,10 @@ type
|
||||
// Event lists
|
||||
procedure RemoveAllHandlersOfObject(AnObject: TObject); override;
|
||||
procedure AddHandlerOnDestroy(const OnDestroyEvent: TNotifyEvent;
|
||||
AsLast: boolean = false);
|
||||
AsFirst: boolean = false);
|
||||
procedure RemoveHandlerOnDestroy(const OnDestroyEvent: TNotifyEvent);
|
||||
procedure AddHandler(HandlerType: TMenuItemHandlerType;
|
||||
const AMethod: TMethod; AsLast: boolean);
|
||||
const AMethod: TMethod; AsFirst: boolean);
|
||||
procedure RemoveHandler(HandlerType: TMenuItemHandlerType;
|
||||
const AMethod: TMethod);
|
||||
public
|
||||
|
Loading…
Reference in New Issue
Block a user