Browse Source

* allow cmClose for Compilation Dialog box

pierre 26 years ago
parent
commit
99b2323dfb
1 changed files with 9 additions and 4 deletions
  1. 9 4
      ide/text/fpcompil.pas

+ 9 - 4
ide/text/fpcompil.pas

@@ -40,7 +40,7 @@ implementation
 
 
 uses
 uses
   Dos,Video,
   Dos,Video,
-  Objects,Drivers,Views,App,
+  Objects,Drivers,Views,App,Commands,
   CompHook,
   CompHook,
 {$ifdef go32v2}
 {$ifdef go32v2}
   FPRedir,
   FPRedir,
@@ -160,7 +160,8 @@ procedure DoCompile(Mode: TCompileMode);
   function IsExitEvent(E: TEvent): boolean;
   function IsExitEvent(E: TEvent): boolean;
   begin
   begin
     IsExitEvent:=(E.What=evKeyDown) and
     IsExitEvent:=(E.What=evKeyDown) and
-                 ((E.KeyCode=kbEnter) or (E.KeyCode=kbEsc));
+                 ((E.KeyCode=kbEnter) or (E.KeyCode=kbEsc)) or
+                 ((E.What=evCommand) and (E.command=cmClose));
   end;
   end;
 
 
 
 
@@ -225,6 +226,8 @@ begin
      else CompilationPhase:=cpFailed;
      else CompilationPhase:=cpFailed;
   SD^.Update;
   SD^.Update;
 
 
+  SD^.SetState(sfModal,false);
+
   if ((CompilationPhase in[cpDone,cpFailed]) or (ShowStatusOnError)) and (Mode<>cRun) then
   if ((CompilationPhase in[cpDone,cpFailed]) or (ShowStatusOnError)) and (Mode<>cRun) then
    repeat
    repeat
      SD^.GetEvent(E);
      SD^.GetEvent(E);
@@ -233,7 +236,6 @@ begin
    until IsExitEvent(E);
    until IsExitEvent(E);
 
 
   Application^.Delete(SD);
   Application^.Delete(SD);
-  SD^.SetState(sfModal,false);
   Dispose(SD, Done); SD:=nil;
   Dispose(SD, Done); SD:=nil;
 
 
 {  if (WasVisible=false) and (status.errorcount=0) then
 {  if (WasVisible=false) and (status.errorcount=0) then
@@ -244,7 +246,10 @@ end;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.8  1999-02-04 13:32:01  pierre
+  Revision 1.9  1999-02-05 13:06:28  pierre
+   * allow cmClose for Compilation Dialog box
+
+  Revision 1.8  1999/02/04 13:32:01  pierre
     * Several things added (I cannot commit them independently !)
     * Several things added (I cannot commit them independently !)
     + added TBreakpoint and TBreakpointCollection
     + added TBreakpoint and TBreakpointCollection
     + added cmResetDebugger,cmGrep,CmToggleBreakpoint
     + added cmResetDebugger,cmGrep,CmToggleBreakpoint