RandomClear icon

How to return from "Detailed" dialog

RandomClear | PRO | 07/23/15 10:50:47 AM UTC | 0 ⭐ | 10650 👁️ | Never ⏰ | []
Delphi |

1.7 KB

|

None

|

0 👍

/

0 👎

// By default, "EurekaLog Detailed" dialog will send bug report and close/restart/terminate application when dialog is closed. 
// This can be not an intuitive behaviour when this dialog is shown from another dialog (such as "MS Classic").
// This code can be used to change this behaviour, so closing "EurekaLog Detailed" dialog will revert back to previous dialog.
 
uses
  ETypes,
  EDialog,
  EDialogWinAPIEurekaLogDetailed;
 
type
  // Override dialog class to customize its behaviour
  TEurekaLogDetailedDialog = class(EDialogWinAPIEurekaLogDetailed.TEurekaLogDetailedDialog)
  protected
    function AssignOnCloseData: Boolean; override;
    function GetCanSend: Boolean; override;
    function GetShowTerminateControl: Boolean; override;
    function GetShowAppendDetailsControl: Boolean; override;
  end;
 
{ TEurekaLogDetailedDialog }
 
function TEurekaLogDetailedDialog.AssignOnCloseData: Boolean;
begin
  // Switch dialog back to previous dialog type
  Options.ExceptionDialogType := FallbackDialogClass;
  if Options.ExceptionDialogType = edtNone then
    Options.ExceptionDialogType := edtEurekaLog;
  FResponse.SendResult := srRestart;
 
  Result := inherited;
end;
 
// Disable some UI elements in dialog:
function TEurekaLogDetailedDialog.GetCanSend: Boolean;
begin
  Result := False;
end;
 
function TEurekaLogDetailedDialog.GetShowAppendDetailsControl: Boolean;
begin
  Result := False;
end;
 
function TEurekaLogDetailedDialog.GetShowTerminateControl: Boolean;
begin
  Result := False;
end;
 
initialization
  // Register our class to be used by EurekaLog.
  // Be sure to register it as "first" - to override default class
  RegisterDialogClassFirst(TEurekaLogDetailedDialog);
end.

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎