Add wxEVT_AUI_PANE_ACTIVATED event.

This event is sent when an AUI pane becomes active.

Closes #14026.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70807 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2012-03-04 20:31:34 +00:00
parent fc5a609912
commit 3a1ec1d5dc
4 changed files with 25 additions and 1 deletions

View File

@ -489,6 +489,8 @@ All (GUI):
- Implement best size calculation for report mode wxListCtrl.
- Fix setting of the frame icon when using non-standard icon sizes (vid).
- Implement wxDV_ROW_LINES in generic wxDataViewCtrl (RedCAT).
- Added EVT_AUI_PANE_ACTIVATED event (Ronny Krüger).
GTK:

View File

@ -841,6 +841,7 @@ wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_AUI, wxEVT_AUI_PANE_BUTTON, wxAuiManagerEv
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_AUI, wxEVT_AUI_PANE_CLOSE, wxAuiManagerEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_AUI, wxEVT_AUI_PANE_MAXIMIZE, wxAuiManagerEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_AUI, wxEVT_AUI_PANE_RESTORE, wxAuiManagerEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_AUI, wxEVT_AUI_PANE_ACTIVATED, wxAuiManagerEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_AUI, wxEVT_AUI_RENDER, wxAuiManagerEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_AUI, wxEVT_AUI_FIND_MANAGER, wxAuiManagerEvent );
@ -857,6 +858,8 @@ typedef void (wxEvtHandler::*wxAuiManagerEventFunction)(wxAuiManagerEvent&);
wx__DECLARE_EVT0(wxEVT_AUI_PANE_MAXIMIZE, wxAuiManagerEventHandler(func))
#define EVT_AUI_PANE_RESTORE(func) \
wx__DECLARE_EVT0(wxEVT_AUI_PANE_RESTORE, wxAuiManagerEventHandler(func))
#define EVT_AUI_PANE_ACTIVATED(func) \
wx__DECLARE_EVT0(wxEVT_AUI_PANE_ACTIVATED, wxAuiManagerEventHandler(func))
#define EVT_AUI_RENDER(func) \
wx__DECLARE_EVT0(wxEVT_AUI_RENDER, wxAuiManagerEventHandler(func))
#define EVT_AUI_FIND_MANAGER(func) \
@ -868,6 +871,7 @@ typedef void (wxEvtHandler::*wxAuiManagerEventFunction)(wxAuiManagerEvent&);
%constant wxEventType wxEVT_AUI_PANE_CLOSE;
%constant wxEventType wxEVT_AUI_PANE_MAXIMIZE;
%constant wxEventType wxEVT_AUI_PANE_RESTORE;
%constant wxEventType wxEVT_AUI_PANE_ACTIVATED;
%constant wxEventType wxEVT_AUI_RENDER;
%constant wxEventType wxEVT_AUI_FIND_MANAGER;
@ -876,6 +880,7 @@ typedef void (wxEvtHandler::*wxAuiManagerEventFunction)(wxAuiManagerEvent&);
EVT_AUI_PANE_CLOSE = wx.PyEventBinder( wxEVT_AUI_PANE_CLOSE )
EVT_AUI_PANE_MAXIMIZE = wx.PyEventBinder( wxEVT_AUI_PANE_MAXIMIZE )
EVT_AUI_PANE_RESTORE = wx.PyEventBinder( wxEVT_AUI_PANE_RESTORE )
EVT_AUI_PANE_ACTIVATED = wx.PyEventBinder( wxEVT_AUI_PANE_ACTIVATED )
EVT_AUI_RENDER = wx.PyEventBinder( wxEVT_AUI_RENDER )
EVT_AUI_FIND_MANAGER = wx.PyEventBinder( wxEVT_AUI_FIND_MANAGER )
}

View File

@ -158,6 +158,9 @@ enum wxAuiManagerOption
Triggered when a pane is maximized.
@event{EVT_AUI_PANE_RESTORE(func)}
Triggered when a pane is restored.
@event{EVT_AUI_PANE_ACTIVATED(func)}
Triggered when a pane is made 'active'. This event is new since
wxWidgets 2.9.4.
@event{EVT_AUI_RENDER(func)}
This event can be caught to override the default renderer in order to
custom draw your wxAuiManager window (not recommended).
@ -872,11 +875,14 @@ public:
Triggered when a pane is maximized.
@event{EVT_AUI_PANE_RESTORE(func)}
Triggered when a pane is restored.
@event{EVT_AUI_PANE_ACTIVATED(func)}
Triggered when a pane is made 'active'. This event is new since
wxWidgets 2.9.4.
@event{EVT_AUI_RENDER(func)}
This event can be caught to override the default renderer in order to
custom draw your wxAuiManager window (not recommended).
@endEventTable
@library{wxaui}
@category{events,aui}

View File

@ -554,6 +554,7 @@ static void RenumberDockRows(wxAuiDockInfoPtrArray& docks)
void wxAuiManager::SetActivePane(wxWindow* active_pane)
{
int i, pane_count;
wxAuiPaneInfo* active_paneinfo = NULL;
for (i = 0, pane_count = m_panes.GetCount(); i < pane_count; ++i)
{
wxAuiPaneInfo& pane = m_panes.Item(i);
@ -561,8 +562,18 @@ void wxAuiManager::SetActivePane(wxWindow* active_pane)
if (pane.window == active_pane)
{
pane.state |= wxAuiPaneInfo::optionActive;
active_paneinfo = &pane;
}
}
// send the 'activated' event after all panes have been updated
if ( active_paneinfo )
{
wxAuiManagerEvent evt(wxEVT_AUI_PANE_ACTIVATED);
evt.SetManager(this);
evt.SetPane(active_paneinfo);
ProcessMgrEvent(evt);
}
}