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
This commit is contained in:
Julian Smart 2005-03-30 17:14:41 +00:00
parent 2a1f999faf
commit 92c45b12e2
9 changed files with 154 additions and 11 deletions

View 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>

View 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

View 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) $**

View 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

View 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) $**

View 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) $<

View File

@ -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

View 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

View File

@ -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