Detecting the active wxAUI pane - Mailing list pgadmin-hackers

From Dave Page
Subject Detecting the active wxAUI pane
Date
Msg-id 937d27e10902250449w227c95a1k6ee9828941624b5a@mail.gmail.com
Whole thread Raw
List 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

pgadmin-hackers by date:

Previous
From: Dave Page
Date:
Subject: Re: Server Status window work
Next
From: Dave Page
Date:
Subject: Re: Server Status window work