| 1 |
///////////////////////////////////////////////////////////////////////////// |
| 2 |
// Name: wx/xrc/xh_aui.h |
| 3 |
// Purpose: XRC resource handler for wxAUI |
| 4 |
// Author: Andrea Zanellato, Steve Lamerton (wxAuiNotebook) |
| 5 |
// Created: 2011-09-18 |
| 6 |
// Copyright: (c) 2011 wxWidgets Team |
| 7 |
// Licence: wxWindows licence |
| 8 |
///////////////////////////////////////////////////////////////////////////// |
| 9 |
|
| 10 |
#ifndef _WX_XH_AUI_H_ |
| 11 |
#define _WX_XH_AUI_H_ |
| 12 |
|
| 13 |
#include "wx/xrc/xmlres.h" |
| 14 |
|
| 15 |
#include "wx/vector.h" |
| 16 |
|
| 17 |
class WXDLLIMPEXP_FWD_AUI wxAuiManager; |
| 18 |
class WXDLLIMPEXP_FWD_AUI wxAuiNotebook; |
| 19 |
|
| 20 |
class MyWxAuiManagerXmlHandler : public wxXmlResourceHandler |
| 21 |
{ |
| 22 |
public: |
| 23 |
MyWxAuiManagerXmlHandler(); |
| 24 |
virtual wxObject* DoCreateResource(); |
| 25 |
virtual bool CanHandle(wxXmlNode* node); |
| 26 |
|
| 27 |
// Returns the wxAuiManager for the specified window |
| 28 |
wxAuiManager* GetAuiManager(wxWindow* managed) const; |
| 29 |
|
| 30 |
private: |
| 31 |
// Used to UnInit() the wxAuiManager before destroying its managed window |
| 32 |
void OnManagedWindowClose(wxWindowDestroyEvent& event); |
| 33 |
|
| 34 |
typedef wxVector<wxAuiManager*> Managers; |
| 35 |
Managers m_managers; // all wxAuiManagers created in this handler |
| 36 |
|
| 37 |
wxAuiManager* m_manager; // Current wxAuiManager |
| 38 |
wxWindow* m_window; // Current managed wxWindow |
| 39 |
wxAuiNotebook* m_notebook; |
| 40 |
|
| 41 |
bool m_mgrInside; // Are we handling a wxAuiManager or panes inside it? |
| 42 |
bool m_anbInside; // Are we handling a wxAuiNotebook or pages inside it? |
| 43 |
|
| 44 |
wxDECLARE_DYNAMIC_CLASS(MyWxAuiManagerXmlHandler); |
| 45 |
}; |
| 46 |
|
| 47 |
#endif //_WX_XH_AUI_H_ |