Jump to content
Attila Kovacs

Close all othr pages in the IDE

Recommended Posts

Am I the only one annoyed that the function 'Close all other pages' (Shift + Ctrl + F4) also closes the welcome page?

How much time have you spent in the past 30 years reopening the welcome page?

 

Share this post


Link to post

I am not affected here. The Welcome Page closes when a project is opened and opens again when it is closed.

Share this post


Link to post

@Uwe Raabe

 

ok, looks like postponing the open/close helped (got AV on closing opening wp from OTA FileNotification events)

 

https://stackoverflow.com/questions/38997386/queue-procedure-call-on-same-main-thread

 

still your solution 😄

 

 

by the way, is it possible to auto-dock the wizard's DockableForm's after compiling/instlaling the ota wizard?

or should I imitate a layout-combo-enter after loading the dll

 

 

 

 

Edited by Attila Kovacs

Share this post


Link to post

More recent Delphi versions have TThread.ForceQueue, which does something similar.

 

Regarding the docking: I never tried it, but as it is a TCustomForm, you should be able to dock it in code. It might be tricky to find the correct target, though.

Share this post


Link to post

Ok, once I find an acceptable release, I may decide to buy it again.

After reinstalling the wizard, the tthread version stopped working, so I had to switch to using a timer instead. The only way it would work was if it was loaded at startup. Fortunately, it's becoming more stable now.

 

The annoying undocked wizard windows are now history, at least I'm testing this code and it looks ok:

procedure TClipboardWizard.ToggleLayout;
var
  ctx: TRttiContext;
  AppBuilder: TComponent;
  AppBuilderType: TRTTIType;
  cbDesktopKeyPress: TRTTIMethod;
  Key: Char;
begin
  ctx := TRttiContext.Create;
  try
    AppBuilder := Application.FindComponent('AppBuilder');
    if AppBuilder <> nil then
    begin
      AppBuilderType := ctx.GetType(AppBuilder.ClassType);
      cbDesktopKeyPress := AppBuilderType.GetMethod('cbDesktopKeyPress');
      Key := Chr(VK_RETURN);
      if cbDesktopKeyPress <> nil then
        cbDesktopKeyPress.Invoke(AppBuilder, [AppBuilder, TValue.From(Key)]); // cbDesktopKeyPress(Sender: TObject; var Key: Char);
    end;
  finally
    ctx.Free;
  end;
end;

 

Thank you for the input and the ideas.

 

 

 

Edited by Attila Kovacs

Share this post


Link to post
9 hours ago, Uwe Raabe said:

More recent Delphi versions have TThread.ForceQueue

It seems it was introduced in 10.2 Tokyo.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×