);
virtual ~wxAuiFloatingFrame();
void SetPaneWindow(const wxAuiPaneInfo& pane);
+ wxAuiManager* GetOwnerManager() const;
protected:
virtual void OnMoveStart();
void OnIdle(wxIdleEvent& event);
void OnActivate(wxActivateEvent& event);
static bool isMouseDown();
+
private:
wxWindow* m_pane_window; // pane window being managed
bool m_solid_drag; // true if system uses solid window drag
#ifndef SWIG
DECLARE_EVENT_TABLE()
- DECLARE_CLASS(wxAuiFloatingFrameBaseClass)
+ DECLARE_CLASS(wxAuiFloatingFrame)
#endif // SWIG
};
void SetManagedWindow(wxWindow* managed_wnd);
wxWindow* GetManagedWindow() const;
+ static wxAuiManager* GetManager(wxWindow* window);
+
#ifdef SWIG
%disownarg( wxAuiDockArt* art_provider );
#endif
void Update();
-
public:
virtual wxAuiFloatingFrame* CreateFloatingFrame(wxWindow* parent, const wxAuiPaneInfo& p);
void OnLeaveWindow(wxMouseEvent& evt);
void OnChildFocus(wxChildFocusEvent& evt);
void OnHintFadeTimer(wxTimerEvent& evt);
+ void OnFindManager(wxAuiManagerEvent& evt);
protected:
#ifndef SWIG
DECLARE_EVENT_TABLE()
+ DECLARE_CLASS(wxAuiManager)
#endif // SWIG
};
public:
wxAuiManagerEvent(wxEventType type=wxEVT_NULL) : wxEvent(0, type)
{
+ manager = NULL;
pane = NULL;
button = 0;
veto_flag = false;
#ifndef SWIG
wxAuiManagerEvent(const wxAuiManagerEvent& c) : wxEvent(c)
{
+ manager = c.manager;
pane = c.pane;
button = c.button;
veto_flag = c.veto_flag;
#endif
wxEvent *Clone() const { return new wxAuiManagerEvent(*this); }
+ void SetManager(wxAuiManager* mgr) { manager = mgr; }
void SetPane(wxAuiPaneInfo* p) { pane = p; }
void SetButton(int b) { button = b; }
void SetDC(wxDC* pdc) { dc = pdc; }
- wxAuiPaneInfo* GetPane() { return pane; }
- int GetButton() { return button; }
- wxDC* GetDC() { return dc; }
+ wxAuiManager* GetManager() const { return manager; }
+ wxAuiPaneInfo* GetPane() const { return pane; }
+ int GetButton() const { return button; }
+ wxDC* GetDC() const { return dc; }
void Veto(bool veto = true) { veto_flag = veto; }
bool GetVeto() const { return veto_flag; }
bool CanVeto() const { return canveto_flag && veto_flag; }
public:
+ wxAuiManager* manager;
wxAuiPaneInfo* pane;
int button;
bool veto_flag;
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_AUI_PANEMAXIMIZE, 0)
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_AUI_PANERESTORE, 0)
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_AUI_RENDER, 0)
+ DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_AUI_FINDMANAGER, 0)
END_DECLARE_EVENT_TYPES()
typedef void (wxEvtHandler::*wxAuiManagerEventFunction)(wxAuiManagerEvent&);
wx__DECLARE_EVT0(wxEVT_AUI_PANERESTORE, wxAuiManagerEventHandler(func))
#define EVT_AUI_RENDER(func) \
wx__DECLARE_EVT0(wxEVT_AUI_RENDER, wxAuiManagerEventHandler(func))
+#define EVT_AUI_FINDMANAGER(func) \
+ wx__DECLARE_EVT0(wxEVT_AUI_FINDMANAGER, wxAuiManagerEventHandler(func))
#else
%constant wxEventType wxEVT_AUI_PANEMAXIMIZE;
%constant wxEventType wxEVT_AUI_PANERESTORE;
%constant wxEventType wxEVT_AUI_RENDER;
+%constant wxEventType wxEVT_AUI_FINDMANAGER;
%pythoncode {
EVT_AUI_PANEBUTTON = wx.PyEventBinder( wxEVT_AUI_PANEBUTTON )
EVT_AUI_PANEMAXIMIZE = wx.PyEventBinder( wxEVT_AUI_PANEMAXIMIZE )
EVT_AUI_PANERESTORE = wx.PyEventBinder( wxEVT_AUI_PANERESTORE )
EVT_AUI_RENDER = wx.PyEventBinder( wxEVT_AUI_RENDER )
+ EVT_AUI_FINDMANAGER = wx.PyEventBinder( wxEVT_AUI_FINDMANAGER )
}
#endif // SWIG
#include "wx/msw/private.h"
#endif
-IMPLEMENT_CLASS( wxAuiFloatingFrame, wxAuiFloatingFrameBaseClass )
+IMPLEMENT_CLASS(wxAuiFloatingFrame, wxAuiFloatingFrameBaseClass)
wxAuiFloatingFrame::wxAuiFloatingFrame(wxWindow* parent,
wxAuiManager* owner_mgr,
wxAuiFloatingFrame::~wxAuiFloatingFrame()
{
// if we do not do this, then we can crash...
- if(m_owner_mgr && m_owner_mgr->m_action_window == this) {
+ if(m_owner_mgr && m_owner_mgr->m_action_window == this)
+ {
m_owner_mgr->m_action_window = NULL;
}
m_mgr.UnInit();
}
}
+wxAuiManager* wxAuiFloatingFrame::GetOwnerManager() const
+{
+ return m_owner_mgr;
+}
+
+
void wxAuiFloatingFrame::OnSize(wxSizeEvent& event)
{
m_owner_mgr->OnFloatingPaneResized(m_pane_window, event.GetSize());
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
#endif
IMPLEMENT_DYNAMIC_CLASS(wxAuiManagerEvent, wxEvent)
-
+IMPLEMENT_CLASS(wxAuiManager, wxEvtHandler)
// private manager flags (not yet on the public API)
enum wxAuiPrivateManagerOption
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()
}
+// 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
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)
{