wxWidgets/include/wx/xrc/xh_auitoolb.h
Vadim Zeitlin f269f868d7 Add XRC handler for wxAuiToolBar.
Also add the demonstration of AUI handlers (this one and the existing one for
wxAuiNotebook) to the xrc sample.

See #15686.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75271 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-11-23 00:34:55 +00:00

52 lines
1.3 KiB
C++

/////////////////////////////////////////////////////////////////////////////
// Name: wx/xrc/xh_toolb.h
// Purpose: XML resource handler for wxAuiToolBar
// Author: Kinaou Hervé
// Created: 2013-11-23
// Copyright: (c) 2013 Kinaou Hervé
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_XH_AUITOOLB_H_
#define _WX_XH_AUITOOLB_H_
#include "wx/aui/auibar.h"
#include "wx/menu.h"
#include "wx/vector.h"
#include "wx/xrc/xmlres.h"
#if wxUSE_XRC && wxUSE_AUI
class WXDLLIMPEXP_FWD_AUI wxAuiToolBar;
class WXDLLIMPEXP_AUI wxAuiToolBarXmlHandler : public wxXmlResourceHandler
{
public:
wxAuiToolBarXmlHandler();
virtual wxObject *DoCreateResource();
virtual bool CanHandle(wxXmlNode *node);
private:
bool m_isInside;
wxAuiToolBar *m_toolbar;
wxSize m_toolSize;
class MenuHandler : public wxEvtHandler
{
public:
void OnDropDown(wxAuiToolBarEvent& event);
unsigned RegisterMenu(wxAuiToolBar *toobar, int id, wxMenu *menu);
private:
wxVector<wxMenu*> m_menus;
};
MenuHandler m_menuHandler;
wxDECLARE_DYNAMIC_CLASS(wxAuiToolBarXmlHandler);
};
#endif // wxUSE_XRC && wxUSE_AUI
#endif // _WX_XH_AUITOOLB_H_