]> git.saurik.com Git - wxWidgets.git/commitdiff
Applied patch [ 1164975 ] xml handler for wxStaticPicture
authorJulian Smart <julian@anthemion.co.uk>
Wed, 30 Mar 2005 17:14:41 +0000 (17:14 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Wed, 30 Mar 2005 17:14:41 +0000 (17:14 +0000)
David Norris

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33189 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

contrib/build/gizmos/gizmos.bkl
contrib/build/gizmos/gizmos.dsp
contrib/build/gizmos/makefile.bcc
contrib/build/gizmos/makefile.gcc
contrib/build/gizmos/makefile.vc
contrib/build/gizmos/makefile.wat
contrib/include/wx/gizmos/xh_statpict.h [new file with mode: 0644]
contrib/src/gizmos/Makefile.in
contrib/src/gizmos/xh_statpict.cpp [new file with mode: 0644]

index 90752612bd2314d070f889dfeb983566229563cb..31bb831e16d73b1e5b6f9fcb1d626ff14cb0a07b 100644 (file)
@@ -12,6 +12,7 @@
         multicell.cpp
         splittree.cpp
         statpict.cpp
+        xh_statpict.cpp
     </set>
 
     <headers template="wx_contrib_headers">
@@ -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
         </files>
     </headers>
index 69a0e293f8e336bfbb4128127d86db8232e00976..97cdb925e8e1fe071917a8273e16ea67ea6a7dfd 100644 (file)
@@ -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
index 410457d4ce2b1ca1d8ee31986304c4a4cfcddf66..32863ec0d2ea977bd8e3a357924c2aa6fd317f54 100644 (file)
@@ -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) $**
+
index 7822196734d5583c80327024a6aa5f22462eb13d..0dc5e49695fbc6616b0e47890881d5f0956fd5e9 100644 (file)
@@ -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
 
 
index ef2dd91c6eff4bf564bc46419cd2fd18bf75583d..891b2c8e5f2a1e67b1d67d223fefcbc680d2355e 100644 (file)
@@ -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) $**
+
index 32aa9a8c8a4854c2688d276c6876c35bd99329fe..2eac2de6b49838c96fd40eae7b2d30201a1bf259 100644 (file)
@@ -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 (file)
index 0000000..f28606b
--- /dev/null
@@ -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
index 088c5df60e6577a5331a5105129d8c7d006049aa..a158d017e3690a203669d6761362f8645f3bc5e6 100644 (file)
@@ -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 (file)
index 0000000..1aac50c
--- /dev/null
@@ -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