added wxAuiManager::GetManager() call

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43467 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Benjamin Williams
2006-11-17 13:07:01 +00:00
parent 28f9f58ca0
commit 4dc79cfb52
4 changed files with 69 additions and 8 deletions

View File

@@ -57,6 +57,7 @@ DEFINE_EVENT_TYPE(wxEVT_AUI_PANECLOSE)
DEFINE_EVENT_TYPE(wxEVT_AUI_PANEMAXIMIZE)
DEFINE_EVENT_TYPE(wxEVT_AUI_PANERESTORE)
DEFINE_EVENT_TYPE(wxEVT_AUI_RENDER)
DEFINE_EVENT_TYPE(wxEVT_AUI_FINDMANAGER)
#ifdef __WXMAC__
// a few defines to avoid nameclashes
@@ -66,7 +67,7 @@ DEFINE_EVENT_TYPE(wxEVT_AUI_RENDER)
#endif
IMPLEMENT_DYNAMIC_CLASS(wxAuiManagerEvent, wxEvent)
IMPLEMENT_CLASS(wxAuiManager, wxEvtHandler)
// private manager flags (not yet on the public API)
enum wxAuiPrivateManagerOption
@@ -485,6 +486,7 @@ BEGIN_EVENT_TABLE(wxAuiManager, wxEvtHandler)
EVT_MOTION(wxAuiManager::OnMotion)
EVT_LEAVE_WINDOW(wxAuiManager::OnLeaveWindow)
EVT_CHILD_FOCUS(wxAuiManager::OnChildFocus)
EVT_AUI_FINDMANAGER(wxAuiManager::OnFindManager)
EVT_TIMER(101, wxAuiManager::OnHintFadeTimer)
END_EVENT_TABLE()
@@ -635,6 +637,22 @@ wxFrame* wxAuiManager::GetFrame() const
}
// this function will return the aui manager for a given
// window. The |window| parameter should be any child window
// or grand-child window (and so on) of the frame/window
// managed by wxAuiManager. The |window| parameter does not
// need to be managed by the manager itself.
wxAuiManager* wxAuiManager::GetManager(wxWindow* window)
{
wxAuiManagerEvent evt(wxEVT_AUI_FINDMANAGER);
evt.ResumePropagation(wxEVENT_PROPAGATE_MAX);
if (!window->ProcessEvent(evt))
return NULL;
return evt.GetManager();
}
void wxAuiManager::UpdateHintWindowConfig()
{
// find out if the the system can do transparent frames
@@ -3535,6 +3553,27 @@ void wxAuiManager::OnSize(wxSizeEvent& event)
event.Skip();
}
void wxAuiManager::OnFindManager(wxAuiManagerEvent& evt)
{
// get the window we are managing, if none, return NULL
wxWindow* window = GetManagedWindow();
if (!window)
{
evt.SetManager(NULL);
return;
}
// if we are managing a child frame, get the 'real' manager
if (window->IsKindOf(CLASSINFO(wxAuiFloatingFrame)))
{
wxAuiFloatingFrame* float_frame = static_cast<wxAuiFloatingFrame*>(window);
evt.SetManager(float_frame->GetOwnerManager());
return;
}
// return pointer to ourself
evt.SetManager(this);
}
void wxAuiManager::OnSetCursor(wxSetCursorEvent& event)
{