From 92c45b12e28d5c5639bfffb6bcc9e8408c253451 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Wed, 30 Mar 2005 17:14:41 +0000 Subject: [PATCH] Applied patch [ 1164975 ] xml handler for wxStaticPicture David Norris git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33189 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/build/gizmos/gizmos.bkl | 2 + contrib/build/gizmos/gizmos.dsp | 4 ++ contrib/build/gizmos/makefile.bcc | 12 +++++- contrib/build/gizmos/makefile.gcc | 12 +++++- contrib/build/gizmos/makefile.vc | 12 +++++- contrib/build/gizmos/makefile.wat | 12 +++++- contrib/include/wx/gizmos/xh_statpict.h | 41 ++++++++++++++++++ contrib/src/gizmos/Makefile.in | 14 +++++-- contrib/src/gizmos/xh_statpict.cpp | 56 +++++++++++++++++++++++++ 9 files changed, 154 insertions(+), 11 deletions(-) create mode 100644 contrib/include/wx/gizmos/xh_statpict.h create mode 100644 contrib/src/gizmos/xh_statpict.cpp diff --git a/contrib/build/gizmos/gizmos.bkl b/contrib/build/gizmos/gizmos.bkl index 90752612bd..31bb831e16 100644 --- a/contrib/build/gizmos/gizmos.bkl +++ b/contrib/build/gizmos/gizmos.bkl @@ -12,6 +12,7 @@ multicell.cpp splittree.cpp statpict.cpp + xh_statpict.cpp @@ -22,6 +23,7 @@ wx/gizmos/multicell.h wx/gizmos/splittree.h wx/gizmos/statpict.h + wx/gizmos/xh_statpict.h wx/gizmos/gizmos.h diff --git a/contrib/build/gizmos/gizmos.dsp b/contrib/build/gizmos/gizmos.dsp index 69a0e293f8..97cdb925e8 100644 --- a/contrib/build/gizmos/gizmos.dsp +++ b/contrib/build/gizmos/gizmos.dsp @@ -542,6 +542,10 @@ SOURCE=../../src/gizmos\..\..\..\src\msw\version.rc !ENDIF +# End Source File +# Begin Source File + +SOURCE=../../src/gizmos\xh_statpict.cpp # End Source File # End Group # End Target diff --git a/contrib/build/gizmos/makefile.bcc b/contrib/build/gizmos/makefile.bcc index 410457d4ce..32863ec0d2 100644 --- a/contrib/build/gizmos/makefile.bcc +++ b/contrib/build/gizmos/makefile.bcc @@ -42,7 +42,8 @@ GIZMOSDLL_OBJECTS = \ $(OBJS)\gizmosdll_ledctrl.obj \ $(OBJS)\gizmosdll_multicell.obj \ $(OBJS)\gizmosdll_splittree.obj \ - $(OBJS)\gizmosdll_statpict.obj + $(OBJS)\gizmosdll_statpict.obj \ + $(OBJS)\gizmosdll_xh_statpict.obj GIZMOSLIB_CXXFLAGS = $(__RUNTIME_LIBS) -I$(BCCDIR)\include $(__DEBUGINFO) \ $(__OPTIMIZEFLAG) $(__THREADSFLAG) -D__WXMSW__ $(__WXUNIV_DEFINE_p) \ $(__DEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) \ @@ -57,7 +58,8 @@ GIZMOSLIB_OBJECTS = \ $(OBJS)\gizmoslib_ledctrl.obj \ $(OBJS)\gizmoslib_multicell.obj \ $(OBJS)\gizmoslib_splittree.obj \ - $(OBJS)\gizmoslib_statpict.obj + $(OBJS)\gizmoslib_statpict.obj \ + $(OBJS)\gizmoslib_xh_statpict.obj ### Conditionally set variables: ### @@ -279,6 +281,9 @@ $(OBJS)\gizmosdll_splittree.obj: ../../src/gizmos\splittree.cpp $(OBJS)\gizmosdll_statpict.obj: ../../src/gizmos\statpict.cpp $(CXX) -q -c -P -o$@ $(GIZMOSDLL_CXXFLAGS) $** +$(OBJS)\gizmosdll_xh_statpict.obj: ../../src/gizmos\xh_statpict.cpp + $(CXX) -q -c -P -o$@ $(GIZMOSDLL_CXXFLAGS) $** + $(OBJS)\gizmoslib_dummy.obj: ../../src/gizmos\..\..\..\src\msw\dummy.cpp $(CXX) -q -c -P -o$@ $(GIZMOSLIB_CXXFLAGS) -H $** @@ -300,3 +305,6 @@ $(OBJS)\gizmoslib_splittree.obj: ../../src/gizmos\splittree.cpp $(OBJS)\gizmoslib_statpict.obj: ../../src/gizmos\statpict.cpp $(CXX) -q -c -P -o$@ $(GIZMOSLIB_CXXFLAGS) $** +$(OBJS)\gizmoslib_xh_statpict.obj: ../../src/gizmos\xh_statpict.cpp + $(CXX) -q -c -P -o$@ $(GIZMOSLIB_CXXFLAGS) $** + diff --git a/contrib/build/gizmos/makefile.gcc b/contrib/build/gizmos/makefile.gcc index 7822196734..0dc5e49695 100644 --- a/contrib/build/gizmos/makefile.gcc +++ b/contrib/build/gizmos/makefile.gcc @@ -35,7 +35,8 @@ GIZMOSDLL_OBJECTS = \ $(OBJS)\gizmosdll_ledctrl.o \ $(OBJS)\gizmosdll_multicell.o \ $(OBJS)\gizmosdll_splittree.o \ - $(OBJS)\gizmosdll_statpict.o + $(OBJS)\gizmosdll_statpict.o \ + $(OBJS)\gizmosdll_xh_statpict.o GIZMOSLIB_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZEFLAG) $(__THREADSFLAG) \ $(GCCFLAGS) -DHAVE_W32API_H -D__WXMSW__ $(__WXUNIV_DEFINE_p) \ $(__DEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) \ @@ -50,7 +51,8 @@ GIZMOSLIB_OBJECTS = \ $(OBJS)\gizmoslib_ledctrl.o \ $(OBJS)\gizmoslib_multicell.o \ $(OBJS)\gizmoslib_splittree.o \ - $(OBJS)\gizmoslib_statpict.o + $(OBJS)\gizmoslib_statpict.o \ + $(OBJS)\gizmoslib_xh_statpict.o ### Conditionally set variables: ### @@ -268,6 +270,9 @@ $(OBJS)\gizmosdll_splittree.o: ../../src/gizmos/splittree.cpp $(OBJS)\gizmosdll_statpict.o: ../../src/gizmos/statpict.cpp $(CXX) -c -o $@ $(GIZMOSDLL_CXXFLAGS) $< +$(OBJS)\gizmosdll_xh_statpict.o: ../../src/gizmos/xh_statpict.cpp + $(CXX) -c -o $@ $(GIZMOSDLL_CXXFLAGS) $< + $(OBJS)\gizmoslib_dummy.o: ../../src/gizmos/../../../src/msw/dummy.cpp $(CXX) -c -o $@ $(GIZMOSLIB_CXXFLAGS) $< @@ -289,6 +294,9 @@ $(OBJS)\gizmoslib_splittree.o: ../../src/gizmos/splittree.cpp $(OBJS)\gizmoslib_statpict.o: ../../src/gizmos/statpict.cpp $(CXX) -c -o $@ $(GIZMOSLIB_CXXFLAGS) $< +$(OBJS)\gizmoslib_xh_statpict.o: ../../src/gizmos/xh_statpict.cpp + $(CXX) -c -o $@ $(GIZMOSLIB_CXXFLAGS) $< + .PHONY: all clean diff --git a/contrib/build/gizmos/makefile.vc b/contrib/build/gizmos/makefile.vc index ef2dd91c6e..891b2c8e5f 100644 --- a/contrib/build/gizmos/makefile.vc +++ b/contrib/build/gizmos/makefile.vc @@ -37,7 +37,8 @@ GIZMOSDLL_OBJECTS = \ $(OBJS)\gizmosdll_ledctrl.obj \ $(OBJS)\gizmosdll_multicell.obj \ $(OBJS)\gizmosdll_splittree.obj \ - $(OBJS)\gizmosdll_statpict.obj + $(OBJS)\gizmosdll_statpict.obj \ + $(OBJS)\gizmosdll_xh_statpict.obj GIZMOSLIB_CXXFLAGS = /M$(__RUNTIME_LIBS_22)$(__DEBUGRUNTIME_17) /DWIN32 \ $(__DEBUGINFO_1) \ /Fd$(LIBDIRNAME)\wx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gizmos.pdb \ @@ -54,7 +55,8 @@ GIZMOSLIB_OBJECTS = \ $(OBJS)\gizmoslib_ledctrl.obj \ $(OBJS)\gizmoslib_multicell.obj \ $(OBJS)\gizmoslib_splittree.obj \ - $(OBJS)\gizmoslib_statpict.obj + $(OBJS)\gizmoslib_statpict.obj \ + $(OBJS)\gizmoslib_xh_statpict.obj ### Conditionally set variables: ### @@ -383,6 +385,9 @@ $(OBJS)\gizmosdll_splittree.obj: ../../src/gizmos\splittree.cpp $(OBJS)\gizmosdll_statpict.obj: ../../src/gizmos\statpict.cpp $(CXX) /c /nologo /TP /Fo$@ $(GIZMOSDLL_CXXFLAGS) $** +$(OBJS)\gizmosdll_xh_statpict.obj: ../../src/gizmos\xh_statpict.cpp + $(CXX) /c /nologo /TP /Fo$@ $(GIZMOSDLL_CXXFLAGS) $** + $(OBJS)\gizmoslib_dummy.obj: ../../src/gizmos\..\..\..\src\msw\dummy.cpp $(CXX) /c /nologo /TP /Fo$@ $(GIZMOSLIB_CXXFLAGS) /Ycwx/wxprec.h $** @@ -404,3 +409,6 @@ $(OBJS)\gizmoslib_splittree.obj: ../../src/gizmos\splittree.cpp $(OBJS)\gizmoslib_statpict.obj: ../../src/gizmos\statpict.cpp $(CXX) /c /nologo /TP /Fo$@ $(GIZMOSLIB_CXXFLAGS) $** +$(OBJS)\gizmoslib_xh_statpict.obj: ../../src/gizmos\xh_statpict.cpp + $(CXX) /c /nologo /TP /Fo$@ $(GIZMOSLIB_CXXFLAGS) $** + diff --git a/contrib/build/gizmos/makefile.wat b/contrib/build/gizmos/makefile.wat index 32aa9a8c8a..2eac2de6b4 100644 --- a/contrib/build/gizmos/makefile.wat +++ b/contrib/build/gizmos/makefile.wat @@ -235,7 +235,8 @@ GIZMOSDLL_OBJECTS = & $(OBJS)\gizmosdll_ledctrl.obj & $(OBJS)\gizmosdll_multicell.obj & $(OBJS)\gizmosdll_splittree.obj & - $(OBJS)\gizmosdll_statpict.obj + $(OBJS)\gizmosdll_statpict.obj & + $(OBJS)\gizmosdll_xh_statpict.obj GIZMOSLIB_CXXFLAGS = $(__DEBUGINFO_1) $(__OPTIMIZEFLAG) $(__THREADSFLAG) & $(__RUNTIME_LIBS) -d__WXMSW__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) & $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) & @@ -250,7 +251,8 @@ GIZMOSLIB_OBJECTS = & $(OBJS)\gizmoslib_ledctrl.obj & $(OBJS)\gizmoslib_multicell.obj & $(OBJS)\gizmoslib_splittree.obj & - $(OBJS)\gizmoslib_statpict.obj + $(OBJS)\gizmoslib_statpict.obj & + $(OBJS)\gizmoslib_xh_statpict.obj all : $(OBJS) @@ -317,6 +319,9 @@ $(OBJS)\gizmosdll_splittree.obj : .AUTODEPEND ../../src/gizmos\splittree.cpp $(OBJS)\gizmosdll_statpict.obj : .AUTODEPEND ../../src/gizmos\statpict.cpp $(CXX) -zq -fo=$^@ $(GIZMOSDLL_CXXFLAGS) $< +$(OBJS)\gizmosdll_xh_statpict.obj : .AUTODEPEND ../../src/gizmos\xh_statpict.cpp + $(CXX) -zq -fo=$^@ $(GIZMOSDLL_CXXFLAGS) $< + $(OBJS)\gizmoslib_dummy.obj : .AUTODEPEND ../../src/gizmos\..\..\..\src\msw\dummy.cpp $(CXX) -zq -fo=$^@ $(GIZMOSLIB_CXXFLAGS) $< @@ -338,3 +343,6 @@ $(OBJS)\gizmoslib_splittree.obj : .AUTODEPEND ../../src/gizmos\splittree.cpp $(OBJS)\gizmoslib_statpict.obj : .AUTODEPEND ../../src/gizmos\statpict.cpp $(CXX) -zq -fo=$^@ $(GIZMOSLIB_CXXFLAGS) $< +$(OBJS)\gizmoslib_xh_statpict.obj : .AUTODEPEND ../../src/gizmos\xh_statpict.cpp + $(CXX) -zq -fo=$^@ $(GIZMOSLIB_CXXFLAGS) $< + diff --git a/contrib/include/wx/gizmos/xh_statpict.h b/contrib/include/wx/gizmos/xh_statpict.h new file mode 100644 index 0000000000..f28606b042 --- /dev/null +++ b/contrib/include/wx/gizmos/xh_statpict.h @@ -0,0 +1,41 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: xh_statpict.h +// Purpose: XRC resource handler for wxStaticPicture +// Author: David A. Norris +// Created: 2005/03/13 +// RCS-ID: $Id$ +// Copyright: David A. Norris +// Licence: wxWindows Licence +///////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_XH_STATPICT_H +#define _WX_XH_STATPICT_H + +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) +#pragma interface "xh_statpict.h" +#endif + +#include "wx/xrc/xmlres.h" + +// +// XML resource handler for the wxStaticPicture class in wxContrib. +// + +class WXDLLIMPEXP_XRC wxStaticPictureXmlHandler : public wxXmlResourceHandler +{ +public: + + // Constructor. + wxStaticPictureXmlHandler(); + + // Creates the control and returns a pointer to it. + virtual wxObject *DoCreateResource(); + + // Returns true if we know how to create a control for the given node. + virtual bool CanHandle(wxXmlNode *node); + + // Register with wxWindows' dynamic class subsystem. + DECLARE_DYNAMIC_CLASS(wxStaticPictureXmlHandler) +}; + +#endif diff --git a/contrib/src/gizmos/Makefile.in b/contrib/src/gizmos/Makefile.in index 088c5df60e..a158d017e3 100644 --- a/contrib/src/gizmos/Makefile.in +++ b/contrib/src/gizmos/Makefile.in @@ -64,7 +64,8 @@ GIZMOSDLL_OBJECTS = \ gizmosdll_ledctrl.o \ gizmosdll_multicell.o \ gizmosdll_splittree.o \ - gizmosdll_statpict.o + gizmosdll_statpict.o \ + gizmosdll_xh_statpict.o GIZMOSDLL_ODEP = $(___pch_wxprec_gizmosdll_wx_wxprec_h_gch___depname) GIZMOSLIB_CXXFLAGS = $(__gizmoslib_PCH_INC) -D__WX$(TOOLKIT)__ \ $(__WXUNIV_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) \ @@ -75,7 +76,8 @@ GIZMOSLIB_OBJECTS = \ gizmoslib_ledctrl.o \ gizmoslib_multicell.o \ gizmoslib_splittree.o \ - gizmoslib_statpict.o + gizmoslib_statpict.o \ + gizmoslib_xh_statpict.o GIZMOSLIB_ODEP = $(___pch_wxprec_gizmoslib_wx_wxprec_h_gch___depname) ### Conditionally set variables: ### @@ -206,7 +208,7 @@ all: $(__gizmosdll___depname) $(__gizmoslib___depname) install: all $(__install_gizmosdll___depname) $(__install_gizmoslib___depname) $(INSTALL_DIR) $(DESTDIR)$(includedir)/wx-$(WX_RELEASE)$(WX_FLAVOUR) - for f in wx/gizmos/dynamicsash.h wx/gizmos/editlbox.h wx/gizmos/ledctrl.h wx/gizmos/multicell.h wx/gizmos/splittree.h wx/gizmos/statpict.h wx/gizmos/gizmos.h; do \ + for f in wx/gizmos/dynamicsash.h wx/gizmos/editlbox.h wx/gizmos/ledctrl.h wx/gizmos/multicell.h wx/gizmos/splittree.h wx/gizmos/statpict.h wx/gizmos/xh_statpict.h wx/gizmos/gizmos.h; do \ if test ! -d $(DESTDIR)$(includedir)/wx-$(WX_RELEASE)$(WX_FLAVOUR)/`dirname $$f` ; then \ $(INSTALL_DIR) $(DESTDIR)$(includedir)/wx-$(WX_RELEASE)$(WX_FLAVOUR)/`dirname $$f`; \ fi; \ @@ -276,6 +278,9 @@ gizmosdll_splittree.o: $(srcdir)/splittree.cpp $(GIZMOSDLL_ODEP) gizmosdll_statpict.o: $(srcdir)/statpict.cpp $(GIZMOSDLL_ODEP) $(CXXC) -c -o $@ $(GIZMOSDLL_CXXFLAGS) $(srcdir)/statpict.cpp +gizmosdll_xh_statpict.o: $(srcdir)/xh_statpict.cpp $(GIZMOSDLL_ODEP) + $(CXXC) -c -o $@ $(GIZMOSDLL_CXXFLAGS) $(srcdir)/xh_statpict.cpp + gizmoslib_dynamicsash.o: $(srcdir)/dynamicsash.cpp $(GIZMOSLIB_ODEP) $(CXXC) -c -o $@ $(GIZMOSLIB_CXXFLAGS) $(srcdir)/dynamicsash.cpp @@ -294,6 +299,9 @@ gizmoslib_splittree.o: $(srcdir)/splittree.cpp $(GIZMOSLIB_ODEP) gizmoslib_statpict.o: $(srcdir)/statpict.cpp $(GIZMOSLIB_ODEP) $(CXXC) -c -o $@ $(GIZMOSLIB_CXXFLAGS) $(srcdir)/statpict.cpp +gizmoslib_xh_statpict.o: $(srcdir)/xh_statpict.cpp $(GIZMOSLIB_ODEP) + $(CXXC) -c -o $@ $(GIZMOSLIB_CXXFLAGS) $(srcdir)/xh_statpict.cpp + # Include dependency info, if present: @IF_GNU_MAKE@-include .deps/*.d diff --git a/contrib/src/gizmos/xh_statpict.cpp b/contrib/src/gizmos/xh_statpict.cpp new file mode 100644 index 0000000000..1aac50c323 --- /dev/null +++ b/contrib/src/gizmos/xh_statpict.cpp @@ -0,0 +1,56 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: xh_statpict.cpp +// Purpose: XRC resource handler for wxStaticPicture +// Author: David A. Norris +// Created: 2005/03/13 +// RCS-ID: $Id$ +// Copyright: David A. Norris +// Licence: wxWindows Licence +///////////////////////////////////////////////////////////////////////////// + +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) +#pragma implementation "xh_statpict.h" +#endif + +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#if wxUSE_XRC + +#include "wx/gizmos/statpict.h" +#include "wx/gizmos/xh_statpict.h" + +// Register with wxWindows' dynamic class subsystem. +IMPLEMENT_DYNAMIC_CLASS(wxStaticPictureXmlHandler, wxXmlResourceHandler) + +// Constructor. +wxStaticPictureXmlHandler::wxStaticPictureXmlHandler() +{ + AddWindowStyles(); +} + +// Creates the control and returns a pointer to it. +wxObject *wxStaticPictureXmlHandler::DoCreateResource() +{ + XRC_MAKE_INSTANCE(control, wxStaticPicture) + + control->Create(m_parentAsWindow, GetID(), + GetBitmap(wxT("bitmap"), wxART_OTHER, GetSize()), + GetPosition(), GetSize(), GetStyle(), GetName()); + + SetupWindow(control); + + return control; +} + +// Returns true if we know how to create a control for the given node. +bool wxStaticPictureXmlHandler::CanHandle(wxXmlNode *node) +{ + return IsOfClass(node, wxT("wxStaticPicture")); +} + +#endif // wxUSE_XRC -- 2.45.2