Detecting the active wxAUI pane

From: Dave Page <dpage(at)pgadmin(dot)org>
To: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
Cc: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Detecting the active wxAUI pane
Date: 2009-02-25 12:49:44
Message-ID: 937d27e10902250449w227c95a1k6ee9828941624b5a@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

I've been looking at how we can detect which AUI pane is active, and
unfortunately, it doesn't seem like there is a clean way.

Ideally, wxAUI would provide a event that is fired whenever it's
SetActivePane() function is called, so we can simply note in an event
handler which pane it is. But there is no such event.

The only way I can currently see to do this is as follows:

- Setup a timer to fire a few times per second (I wonder if we can
catch a wxPaintEvent instead - not sure how that would work with an
undocked pane though).

- Call wxAuiManager::GetAllPanes to get an array of wxAuiPaneInfo's

- For each pane in the array, check
HasFlag(wxAuiPaneInfo::optionActive) to see if that pane is active.

- Adjust the toolbar accordingly for the active pane.

This is a truly horrible kludge, but so far the best option I have I'm afraid.

--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com

Browse pgadmin-hackers by date

  From Date Subject
Next Message Dave Page 2009-02-25 13:22:31 Re: Server Status window work
Previous Message Dave Page 2009-02-25 11:22:25 Re: Server Status window work