Z-Order Issues of Modal Dialogs

TOAD 13.0.3.81on Windows 64 Bit

Any chance you can sort out this recurring Z-order issue, where modal dialogs popup beneath other windows? This problem has been in TOAD for about a decade.

A classic example, so I've F4'd a package call in another package's source. It brings up Describe Objects for that package source, I want to go to a line number to investigate an exception, Ctrl-G for Goto Line dialogue, but it's underneath the Describe Objects Window!

I know TOAD used to be written in Delphi, so you might want to read this.

If Delphi, this code below should fix your issue, if you set the modal dialog ParentForm to the form that spawned them :

function TMyForm.ShowModal(ParentForm: TCustomForm): Integer;
begin
  PopupMode := pmAuto;  // prevents recreation of window on next line
  PopupParent := ParentForm;
  Result := inherited ShowModal;
end;

Hey Paul,

We've done a lot of work to fix these over the years. And for me, CTRL+G comes up on top of the describe window. I've heard of cases where a user says that some window comes up behind, then they restart Toad, do the same thing, and the window comes up where it should. I'm not sure what leads to the wrong behavior after a while.

The technique we use is basically the same was what you suggested except we use pmExplicit instead of pmAuto:

procedure TSomeForm.ButtonClick(Sender: TObject);
var
  frm: TSomeOtherForm;
begin
  frm := TSomeOtherForm.Create(Self);
  try
    frm.PopupMode := pmExplicit;
    frm.PopupParent := self;
    if frm.ShowModal = mrOK then
    begin
       do something;
    end;
  finally
    frm.free;
  end;
end;

I'm not 100% sure that we're using this technique with the goto dialog, but I will double-check.

Thanks for the bug report and specific example.

Edit: we are not using that with the "goto line" dialog. I'll fix.

-John

1 Like

Another one I see this problem with is "New Connection" dialog, it appears beneath forms like "Describe Objects".

Thanks. For me it comes up correctly, but I see we aren't specifying popup parent there either, so maybe this one somehow gets out-of-whack after a while too. I'll fix.

1 Like