LCL: TMenuItem.AddHandler: changed AsLast to AsFirst for consistency and implemented it

git-svn-id: trunk@39782 -
This commit is contained in:
mattias 2013-01-06 18:58:26 +00:00
parent 7392702afb
commit 62fb47e350
2 changed files with 6 additions and 6 deletions

View File

@ -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;

View File

@ -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