File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -1174,6 +1174,7 @@ inherited MainForm: TMainForm
11741174 end
11751175 end
11761176 object appEvents: TApplicationEvents
1177+ OnHelp = appEventsHelp
11771178 OnHint = appEventsHint
11781179 Left = 291
11791180 Top = 96
Original file line number Diff line number Diff line change @@ -478,6 +478,11 @@ TMainForm = class(THelpAwareForm)
478478 procedure actViewTestUnitUpdate (Sender: TObject);
479479 // / <summary>Displays the Welcome page in the details pane.</summary>
480480 procedure actWelcomeExecute (Sender: TObject);
481+ // / <summary>Handles events triggered when help system is invoked. Prevents
482+ // / exception being raised when F1 key is pressed when a menu is dropped
483+ // / down.</summary>
484+ function appEventsHelp (Command: Word; Data: Integer;
485+ var CallHelp: Boolean): Boolean;
481486 // / <summary>Handles events triggered when a control issues a hint. The
482487 // / hint is displayed in the form's status bar.</summary>
483488 procedure appEventsHint (Sender: TObject);
@@ -1215,6 +1220,16 @@ procedure TMainForm.AfterShowForm;
12151220 fMainDisplayMgr.ShowWelcomePage;
12161221end ;
12171222
1223+ function TMainForm.appEventsHelp (Command: Word; Data: Integer;
1224+ var CallHelp: Boolean): Boolean;
1225+ begin
1226+ // Prevent Delphi Help system from interfering!
1227+ // This prevents exception being raised when F1 is pressed over menu items
1228+ // while still allowing our custom help manager to operate.
1229+ CallHelp := False;
1230+ Result := True;
1231+ end ;
1232+
12181233procedure TMainForm.appEventsHint (Sender: TObject);
12191234begin
12201235 if Assigned(fStatusBarMgr) then
You can’t perform that action at this time.
0 commit comments