Files
wxWidgets/src/xrc/xmlreshandler.cpp
Vadim Zeitlin a3b9c43bbc Refactor wxXRC to allow defining handlers outside of xrc library.
Split wxXmlResourceHandler into an ABC and the real implementation to allow
referencing the ABC in the core library itself but without pulling in all of
the XRC into it. This also allows defining XRC handlers, which only depend on
this ABC and not the xrc library, in other libraries, such as richtext, as
demonstrated by the now enabled wxRichTextXMLHandler.

Closes #10996.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72727 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-10-23 13:51:32 +00:00

70 lines
2.1 KiB
C++

/////////////////////////////////////////////////////////////////////////////
// Name: src/xrc/xmlreshandler.cpp
// Purpose: XML resource handler
// Author: Steven Lamerton
// Created: 2011/01/26
// RCS-ID: $id$
// Copyright: (c) 2011 Steven Lamerton
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#if wxUSE_XRC
#include "wx/xrc/xmlreshandler.h"
IMPLEMENT_ABSTRACT_CLASS(wxXmlResourceHandler, wxObject)
wxXmlResourceHandlerImplBase* wxXmlResourceHandler::GetImpl() const
{
if ( !m_impl )
{
wxFAIL_MSG(wxT("SetImpl() must have been called!"));
}
return m_impl;
}
void wxXmlResourceHandler::AddStyle(const wxString& name, int value)
{
m_styleNames.Add(name);
m_styleValues.Add(value);
}
void wxXmlResourceHandler::AddWindowStyles()
{
XRC_ADD_STYLE(wxCLIP_CHILDREN);
// the border styles all have the old and new names, recognize both for now
XRC_ADD_STYLE(wxSIMPLE_BORDER); XRC_ADD_STYLE(wxBORDER_SIMPLE);
XRC_ADD_STYLE(wxSUNKEN_BORDER); XRC_ADD_STYLE(wxBORDER_SUNKEN);
XRC_ADD_STYLE(wxDOUBLE_BORDER); XRC_ADD_STYLE(wxBORDER_DOUBLE); // deprecated
XRC_ADD_STYLE(wxBORDER_THEME);
XRC_ADD_STYLE(wxRAISED_BORDER); XRC_ADD_STYLE(wxBORDER_RAISED);
XRC_ADD_STYLE(wxSTATIC_BORDER); XRC_ADD_STYLE(wxBORDER_STATIC);
XRC_ADD_STYLE(wxNO_BORDER); XRC_ADD_STYLE(wxBORDER_NONE);
XRC_ADD_STYLE(wxBORDER_DEFAULT);
XRC_ADD_STYLE(wxTRANSPARENT_WINDOW);
XRC_ADD_STYLE(wxWANTS_CHARS);
XRC_ADD_STYLE(wxTAB_TRAVERSAL);
XRC_ADD_STYLE(wxNO_FULL_REPAINT_ON_RESIZE);
XRC_ADD_STYLE(wxFULL_REPAINT_ON_RESIZE);
XRC_ADD_STYLE(wxVSCROLL);
XRC_ADD_STYLE(wxHSCROLL);
XRC_ADD_STYLE(wxALWAYS_SHOW_SB);
XRC_ADD_STYLE(wxWS_EX_BLOCK_EVENTS);
XRC_ADD_STYLE(wxWS_EX_VALIDATE_RECURSIVELY);
XRC_ADD_STYLE(wxWS_EX_TRANSIENT);
XRC_ADD_STYLE(wxWS_EX_CONTEXTHELP);
XRC_ADD_STYLE(wxWS_EX_PROCESS_IDLE);
XRC_ADD_STYLE(wxWS_EX_PROCESS_UI_UPDATES);
}
#endif // wxUSE_XRC