From 330e4a4b46c0d0bf371cc87f73ecdf9bb38a0885 Mon Sep 17 00:00:00 2001 From: mattias Date: Thu, 2 Dec 2004 11:23:41 +0000 Subject: [PATCH] synedit now stops, when key was handled git-svn-id: trunk@6321 - --- components/synedit/synedit.pp | 10 ++++++++-- ide/main.pp | 13 ++++++++++++- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/components/synedit/synedit.pp b/components/synedit/synedit.pp index 039daf1a44..3bccbc6dfb 100644 --- a/components/synedit/synedit.pp +++ b/components/synedit/synedit.pp @@ -6739,9 +6739,15 @@ begin ExecuteCommand(Command, AChar, Data); // notify hooked command handlers after the command was executed inside of // the class - NotifyHookedCommandHandlers(TRUE, Command, AChar, Data); + {$IFDEF SYN_LAZARUS} + if Command <> ecNone then + {$ENDIF} + NotifyHookedCommandHandlers(TRUE, Command, AChar, Data); end; - DoOnCommandProcessed(Command, AChar, Data); + {$IFDEF SYN_LAZARUS} + if Command <> ecNone then + {$ENDIF} + DoOnCommandProcessed(Command, AChar, Data); end; procedure TCustomSynEdit.ExecuteCommand(Command: TSynEditorCommand; diff --git a/ide/main.pp b/ide/main.pp index 2da8fd6275..2f834c9fed 100644 --- a/ide/main.pp +++ b/ide/main.pp @@ -2033,6 +2033,9 @@ begin ecSaveAll: DoSaveAll([sfCheckAmbigiousFiles]); + + ecQuit: + mnuQuitClicked(Self); ecBuild: begin @@ -6233,6 +6236,7 @@ procedure TMainIDE.DoRestart; {$IFNDEF VER1_0} StartLazProcess := TProcess.Create(nil); try + // TODO: use the target directory, where the new startlazarus is StartLazProcess.CurrentDirectory := ExtractFileDir(ParamStr(0)); ExeName := AppendPathDelim(StartLazProcess.CurrentDirectory) + 'startlazarus' + GetDefaultExecutableExt; @@ -6250,6 +6254,7 @@ procedure TMainIDE.DoRestart; {$ENDIF} end; +var CanClose: boolean; begin {$IFDEF VER1_0} if not StartedByStartLazarus then begin @@ -6257,7 +6262,10 @@ begin exit; end; {$ENDIF} - mnuQuitClicked(Self); + CanClose:=true; + MainIDEBar.OnCloseQuery(Self, CanClose); + if not CanClose then exit; + MainIDEBar.Close; if Application.Terminated then begin if StartedByStartLazarus then ExitCode := ExitCodeRestartLazarus @@ -10955,6 +10963,9 @@ end. { ============================================================================= $Log$ + Revision 1.802 2004/12/02 11:23:41 mattias + synedit now stops, when key was handled + Revision 1.801 2004/11/26 21:43:41 vincents fixed fpc 1.0.x compilation