#if wxUSE_TOOLBAR
wxToolBarXmlHandler::wxToolBarXmlHandler()
: wxXmlResourceHandler(), m_isInside(FALSE), m_toolbar(NULL)
{
#if wxUSE_TOOLBAR
wxToolBarXmlHandler::wxToolBarXmlHandler()
: wxXmlResourceHandler(), m_isInside(FALSE), m_toolbar(NULL)
{
- ADD_STYLE(wxTB_FLAT);
- ADD_STYLE(wxTB_DOCKABLE);
- ADD_STYLE(wxTB_VERTICAL);
- ADD_STYLE(wxTB_HORIZONTAL);
+ XRC_ADD_STYLE(wxTB_FLAT);
+ XRC_ADD_STYLE(wxTB_DOCKABLE);
+ XRC_ADD_STYLE(wxTB_VERTICAL);
+ XRC_ADD_STYLE(wxTB_HORIZONTAL);
- wxCHECK_MSG(m_toolbar, NULL, wxT("Incorrect syntax of XML resource: tool not within a toolbar!"));
+ wxCHECK_MSG(m_toolbar, NULL, wxT("Incorrect syntax of XRC resource: tool not within a toolbar!"));
m_toolbar->AddTool(GetID(),
GetBitmap(wxT("bitmap")),
GetBitmap(wxT("bitmap2")),
m_toolbar->AddTool(GetID(),
GetBitmap(wxT("bitmap")),
GetBitmap(wxT("bitmap2")),
- wxCHECK_MSG(m_toolbar, NULL, wxT("Incorrect syntax of XML resource: separator not within a toolbar!"));
+ wxCHECK_MSG(m_toolbar, NULL, wxT("Incorrect syntax of XRC resource: separator not within a toolbar!"));
- wxToolBar *toolbar = new wxToolBar(m_parentAsWindow,
- GetID(),
- GetPosition(),
- GetSize(),
- style,
- GetName());
+
+ XRC_MAKE_INSTANCE(toolbar, wxToolBar)
+
+ toolbar->Create(m_parentAsWindow,
+ GetID(),
+ GetPosition(),
+ GetSize(),
+ style,
+ GetName());
{
wxObject *created = CreateResFromNode(n, toolbar, NULL);
wxControl *control = wxDynamicCast(created, wxControl);
{
wxObject *created = CreateResFromNode(n, toolbar, NULL);
wxControl *control = wxDynamicCast(created, wxControl);
- if (IsOfClass(n, wxT("tool")) &&
- IsOfClass(n, wxT("separator")) &&
+ if (!IsOfClass(n, wxT("tool")) &&
+ !IsOfClass(n, wxT("separator")) &&
bool wxToolBarXmlHandler::CanHandle(wxXmlNode *node)
{
return ((!m_isInside && IsOfClass(node, wxT("wxToolBar"))) ||
bool wxToolBarXmlHandler::CanHandle(wxXmlNode *node)
{
return ((!m_isInside && IsOfClass(node, wxT("wxToolBar"))) ||