+// 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_FIND_MANAGER);
+ evt.SetManager(NULL);
+ 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
+ bool can_do_transparent = false;
+
+ wxWindow* w = m_frame;
+ while (w)
+ {
+ if (w->IsKindOf(CLASSINFO(wxFrame)))
+ {
+ wxFrame* f = static_cast<wxFrame*>(w);
+ can_do_transparent = f->CanSetTransparent();
+
+ break;
+ }
+
+ w = w->GetParent();
+ }
+
+ // if there is an existing hint window, delete it
+ if (m_hint_wnd)
+ {
+ m_hint_wnd->Destroy();
+ m_hint_wnd = NULL;
+ }
+
+ m_hint_fademax = 50;
+ m_hint_wnd = NULL;
+
+ if ((m_flags & wxAUI_MGR_TRANSPARENT_HINT) && can_do_transparent)
+ {
+ // Make a window to use for a transparent hint
+ #if defined(__WXMSW__) || defined(__WXGTK__)
+ m_hint_wnd = new wxFrame(m_frame, wxID_ANY, wxEmptyString,
+ wxDefaultPosition, wxSize(1,1),
+ wxFRAME_TOOL_WINDOW |
+ wxFRAME_FLOAT_ON_PARENT |
+ wxFRAME_NO_TASKBAR |
+ wxNO_BORDER);
+
+ m_hint_wnd->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_ACTIVECAPTION));
+ #elif defined(__WXMAC__)
+ // Using a miniframe with float and tool styles keeps the parent
+ // frame activated and highlighted as such...
+ m_hint_wnd = new wxMiniFrame(m_frame, wxID_ANY, wxEmptyString,
+ wxDefaultPosition, wxSize(1,1),
+ wxFRAME_FLOAT_ON_PARENT
+ | wxFRAME_TOOL_WINDOW );
+ m_hint_wnd->Connect(wxEVT_ACTIVATE,
+ wxActivateEventHandler(wxAuiManager::OnHintActivate), NULL, this);
+
+ // Can't set the bg colour of a Frame in wxMac
+ wxPanel* p = new wxPanel(m_hint_wnd);
+
+ // The default wxSYS_COLOUR_ACTIVECAPTION colour is a light silver
+ // color that is really hard to see, especially transparent.
+ // Until a better system color is decided upon we'll just use
+ // blue.
+ p->SetBackgroundColour(*wxBLUE);
+ #endif
+
+ }
+ else
+ {
+ if ((m_flags & wxAUI_MGR_TRANSPARENT_HINT) != 0 ||
+ (m_flags & wxAUI_MGR_VENETIAN_BLINDS_HINT) != 0)
+ {
+ // system can't support transparent fade, or the venetian
+ // blinds effect was explicitly requested
+ m_hint_wnd = new wxPseudoTransparentFrame(m_frame,
+ wxID_ANY,
+ wxEmptyString,
+ wxDefaultPosition,
+ wxSize(1,1),
+ wxFRAME_TOOL_WINDOW |
+ wxFRAME_FLOAT_ON_PARENT |
+ wxFRAME_NO_TASKBAR |
+ wxNO_BORDER);
+ m_hint_fademax = 128;
+ }
+ }
+}