Add support for wxAuiManager and wxAuiPaneInfo to XRC

Add XRC handler for wxAuiManager and include the existing wxAuiNotebook
handler into it (but notice that wxAuiToolBar handler added by a later #15686
in f269f868d7 remains separate).

Also update the AUI dialog in the sample and stop hardcoding its size in
pixels.

See #13520.
This commit is contained in:
Andrea Zanellato
2016-03-09 01:08:42 +01:00
committed by Vadim Zeitlin
parent 6f80021950
commit cf5fa7d5f1
23 changed files with 667 additions and 286 deletions

51
include/wx/xrc/xh_aui.h Normal file
View File

@@ -0,0 +1,51 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/xrc/xh_aui.h
// Purpose: XRC resource handler for wxAUI
// Author: Andrea Zanellato, Steve Lamerton (wxAuiNotebook)
// Created: 2011-09-18
// Copyright: (c) 2011 wxWidgets Team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_XH_AUI_H_
#define _WX_XH_AUI_H_
#include "wx/xrc/xmlres.h"
#if wxUSE_XRC && wxUSE_AUI
#include "wx/vector.h"
class WXDLLIMPEXP_FWD_AUI wxAuiManager;
class WXDLLIMPEXP_FWD_AUI wxAuiNotebook;
class WXDLLIMPEXP_AUI wxAuiXmlHandler : public wxXmlResourceHandler
{
public:
wxAuiXmlHandler();
virtual wxObject *DoCreateResource() wxOVERRIDE;
virtual bool CanHandle(wxXmlNode *node) wxOVERRIDE;
// Returns the wxAuiManager for the specified window
wxAuiManager *GetAuiManager(wxWindow *managed) const;
private:
// Used to UnInit() the wxAuiManager before destroying its managed window
void OnManagedWindowClose(wxWindowDestroyEvent &event);
typedef wxVector<wxAuiManager*> Managers;
Managers m_managers; // all wxAuiManagers created in this handler
wxAuiManager *m_manager; // Current wxAuiManager
wxWindow *m_window; // Current managed wxWindow
wxAuiNotebook *m_notebook;
bool m_mgrInside; // Are we handling a wxAuiManager or panes inside it?
bool m_anbInside; // Are we handling a wxAuiNotebook or pages inside it?
wxDECLARE_DYNAMIC_CLASS(wxAuiXmlHandler);
};
#endif //wxUSE_XRC && wxUSE_AUI
#endif //_WX_XH_AUI_H_

View File

@@ -1,35 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/xrc/xh_auinotbk.h
// Purpose: XML resource handler for wxAuiNotebook
// Author: Steve Lamerton
// Created: 2009-06-12
// Copyright: (c) 2009 Steve Lamerton
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_XRC_XH_AUINOTEBOOK_H_
#define _WX_XRC_XH_AUINOTEBOOK_H_
#include "wx/xrc/xmlres.h"
class WXDLLIMPEXP_FWD_AUI wxAuiNotebook;
#if wxUSE_XRC && wxUSE_AUI
class WXDLLIMPEXP_AUI wxAuiNotebookXmlHandler : public wxXmlResourceHandler
{
public:
wxAuiNotebookXmlHandler();
virtual wxObject *DoCreateResource() wxOVERRIDE;
virtual bool CanHandle(wxXmlNode *node) wxOVERRIDE;
private:
bool m_isInside;
wxAuiNotebook *m_notebook;
wxDECLARE_DYNAMIC_CLASS(wxAuiNotebookXmlHandler);
};
#endif // wxUSE_XRC && wxUSE_AUI
#endif // _WX_XRC_XH_AUINOTEBOOK_H_