From 6f5fa419e8b7c8ca0a8dce03db746b253614ac33 Mon Sep 17 00:00:00 2001 From: ondrej Date: Wed, 20 Jul 2016 18:01:57 +0000 Subject: [PATCH] lcl: change OnExceptionCircle to OnCircularException, remove handler list. git-svn-id: trunk@52730 - --- docs/xml/lcl/forms.xml | 10 +--------- lcl/forms.pp | 9 +++------ lcl/include/application.inc | 21 ++------------------- 3 files changed, 6 insertions(+), 34 deletions(-) diff --git a/docs/xml/lcl/forms.xml b/docs/xml/lcl/forms.xml index 42d21f3172..b9be0680a9 100644 --- a/docs/xml/lcl/forms.xml +++ b/docs/xml/lcl/forms.xml @@ -5841,8 +5841,6 @@ ?application/taskbar window?purpose?what's the purpose for *not* returning MainForm.Handle??? - Handler invoked when there is an exception circle before killing the app with Halt - A queued asynchronous callback request node. @@ -9319,13 +9317,7 @@ Before 0.9.31 there was no exception. Therefore some resourceless forms might us - Handler invoked when there is an exception circle before killing the app with Halt - - Adds an application exception circle handler. - - - Removes an application exception circle handler. - + Handler invoked when there is an exception circle before killing the app with Halt diff --git a/lcl/forms.pp b/lcl/forms.pp index 03b3b6b7ea..9064d243e6 100644 --- a/lcl/forms.pp +++ b/lcl/forms.pp @@ -1218,8 +1218,7 @@ type ahtHelp, ahtHint, ahtShowHint, - ahtGetMainFormHandle, - ahtExceptionCircle + ahtGetMainFormHandle ); PAsyncCallQueueItem = ^TAsyncCallQueueItem; @@ -1301,7 +1300,7 @@ type FMainFormOnTaskBar: Boolean; FModalLevel: Integer; FMoveFormFocusToChildren: Boolean; - FOnExceptionCircle: TExceptionEvent; + FOnCircularException: TExceptionEvent; FOnGetMainFormHandle: TGetHandleEvent; FOnMessageDialogFinished: TModalDialogFinished; FOnModalBegin: TNotifyEvent; @@ -1468,8 +1467,6 @@ type procedure RemoveOnDeactivateHandler(Handler: TNotifyEvent); procedure AddOnExceptionHandler(Handler: TExceptionEvent; AsFirst: Boolean=true); procedure RemoveOnExceptionHandler(Handler: TExceptionEvent); - procedure AddOnExceptionCircleHandler(Handler: TExceptionEvent; AsFirst: Boolean=true); - procedure RemoveOnExceptionCircleHandler(Handler: TExceptionEvent); procedure AddOnEndSessionHandler(Handler: TNotifyEvent; AsFirst: Boolean=true); procedure RemoveOnEndSessionHandler(Handler: TNotifyEvent); procedure AddOnQueryEndSessionHandler(Handler: TQueryEndSessionEvent; AsFirst: Boolean=true); @@ -1566,7 +1563,7 @@ type property OnShowHint: TShowHintEvent read FOnShowHint write FOnShowHint; property OnUserInput: TOnUserInputEvent read FOnUserInput write FOnUserInput; property OnDestroy: TNotifyEvent read FOnDestroy write FOnDestroy; - property OnExceptionCircle: TExceptionEvent read FOnExceptionCircle write FOnExceptionCircle; + property OnCircularException: TExceptionEvent read FOnCircularException write FOnCircularException; property ShowButtonGlyphs: TApplicationShowGlyphs read FShowButtonGlyphs write SetShowButtonGlyphs default sbgAlways; property ShowMenuGlyphs: TApplicationShowGlyphs read FShowMenuGlyphs write SetShowMenuGlyphs default sbgAlways; property ShowHint: Boolean read FShowHint write SetShowHint; diff --git a/lcl/include/application.inc b/lcl/include/application.inc index 2f00b00199..0254d5ea25 100644 --- a/lcl/include/application.inc +++ b/lcl/include/application.inc @@ -1195,14 +1195,8 @@ begin DebugLn('TApplication.HandleException: ', 'there was another exception during showing the first exception'); - if (ExceptObject is Exception) then - begin - if Assigned(OnExceptionCircle) then - OnExceptionCircle(Sender, Exception(ExceptObject)); - i := FApplicationHandlers[ahtExceptionCircle].Count; - while FApplicationHandlers[ahtException].NextDownIndex(i) do - TExceptionEvent(FApplicationHandlers[ahtExceptionCircle][i])(Sender, Exception(ExceptObject)); - end; + if Assigned(OnCircularException) and (ExceptObject is Exception) then + OnCircularException(Sender, Exception(ExceptObject)); HaltingProgram:=true; DumpExceptionBackTrace; @@ -1813,22 +1807,11 @@ begin AddHandler(ahtEndSession,TMethod(Handler),AsFirst); end; -procedure TApplication.AddOnExceptionCircleHandler(Handler: TExceptionEvent; - AsFirst: Boolean); -begin - AddHandler(ahtExceptionCircle,TMethod(Handler),AsFirst); -end; - procedure TApplication.RemoveOnEndSessionHandler(Handler: TNotifyEvent); begin RemoveHandler(ahtEndSession,TMethod(Handler)); end; -procedure TApplication.RemoveOnExceptionCircleHandler(Handler: TExceptionEvent); -begin - RemoveHandler(ahtExceptionCircle,TMethod(Handler)); -end; - procedure TApplication.AddOnQueryEndSessionHandler( Handler: TQueryEndSessionEvent; AsFirst: Boolean); begin