Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

Determine Last Active Document Tab

edited October 2015 in LMD-Tools Vote Up0Vote Down
I am trying to figure out how to determine which document tab was most recently active. For example, I might have two sets of tabbed documents and I then click on a toolpanel. I suppose I could maintain a list of recently clicked tabs and grab the topmost one, but I assume there is a built-in way to do this. How can I determine which document tab was most recently active? I hope this question is clear.
Tagged:

Comments

  • 5 Comments sorted by Votes Date Added
  • Hi,

    There no built-in way. You should track it manually.

    Eugene,
    LMD Innovative.
  • edited June 2015 Posts: 15Vote Up0Vote Down
    I have figured out that I can track the most recently activated lmddockpanel by handling its OnEnter event. The problem comes when switching among floating panels. I recognize that there is no built in support for this but can you suggest to me how I can detect when a floating panel has been activated so that I can track the most recent panel regardless of whether it is floating or docked? I do have a memo client-aligned on each panel but responding to clicks on the memos wouldn't work because a floating panel might be activated by clicking on the panel's header. Do floating windows have an OnEnter event or some other event that I can handle in order to note the most recent panel? 

    Thank you!
  • edited June 2015 Posts: 0 Accepted Answer Vote Up0Vote Down
    Hi,

    Here, things a bit complicated. OnEnter/OnExit do not work among different forms, since Delphi keeps ActiveControl for each form separately. So, you need also to use form.OnActivate event to determine when one active form is changed to another.

    You can use DockManager.OnCreateFloatingSite event to get know when new floating site is created; and use Site.FloatingForm property to get access to its implicit parent form to hook up its OnActivate event.

    Eugene,
    LMD Innovative.
  • Thank you! This was very helpful.
Sign In or Register to comment.