From 02b0f5f67e0da6183c608a7ebb60a5bbd7ab5917 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Fri, 18 Oct 2002 20:54:12 +0000 Subject: [PATCH] added wxScrolledWindow to XRC git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17574 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/include/wx/xrc/xh_all.h | 1 + contrib/include/wx/xrc/xh_scwin.h | 32 +++++++++++++++++++ contrib/src/xrc/Makefile.in | 4 +-- contrib/src/xrc/XrcVC.dsp | 4 +++ contrib/src/xrc/makefile.b32 | 2 +- contrib/src/xrc/makefile.g95 | 2 +- contrib/src/xrc/makefile.vc | 2 +- contrib/src/xrc/makefile.wat | 2 +- contrib/src/xrc/xh_scwin.cpp | 52 +++++++++++++++++++++++++++++++ contrib/src/xrc/xmlrsall.cpp | 1 + docs/tech/tn0014.txt | 7 +++++ include/wx/xrc/xh_all.h | 1 + include/wx/xrc/xh_scwin.h | 32 +++++++++++++++++++ src/xrc/Makefile.in | 4 +-- src/xrc/XrcVC.dsp | 4 +++ src/xrc/makefile.b32 | 2 +- src/xrc/makefile.g95 | 2 +- src/xrc/makefile.vc | 2 +- src/xrc/makefile.wat | 2 +- src/xrc/xh_scwin.cpp | 52 +++++++++++++++++++++++++++++++ src/xrc/xmlrsall.cpp | 1 + 21 files changed, 199 insertions(+), 12 deletions(-) create mode 100644 contrib/include/wx/xrc/xh_scwin.h create mode 100644 contrib/src/xrc/xh_scwin.cpp create mode 100644 include/wx/xrc/xh_scwin.h create mode 100644 src/xrc/xh_scwin.cpp diff --git a/contrib/include/wx/xrc/xh_all.h b/contrib/include/wx/xrc/xh_all.h index 5382b6ffb0..2ac1db392c 100644 --- a/contrib/include/wx/xrc/xh_all.h +++ b/contrib/include/wx/xrc/xh_all.h @@ -46,5 +46,6 @@ #include "wx/xrc/xh_unkwn.h" #include "wx/xrc/xh_gdctl.h" #include "wx/xrc/xh_frame.h" +#include "wx/xrc/xh_scwin.h" #endif // _WX_XMLRES_H_ diff --git a/contrib/include/wx/xrc/xh_scwin.h b/contrib/include/wx/xrc/xh_scwin.h new file mode 100644 index 0000000000..1befc41215 --- /dev/null +++ b/contrib/include/wx/xrc/xh_scwin.h @@ -0,0 +1,32 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: xh_scwin.h +// Purpose: XML resource handler for wxScrolledWindow +// Author: Vaclav Slavik +// Created: 2002/10/18 +// RCS-ID: $Id$ +// Copyright: (c) 2002 Vaclav Slavik +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_XH_SCWIN_H_ +#define _WX_XH_SCWIN_H_ + +#if defined(__GNUG__) && !defined(__APPLE__) +#pragma interface "xh_scwin.h" +#endif + +#include "wx/xrc/xmlres.h" +#include "wx/defs.h" + + + +class WXXMLDLLEXPORT wxScrolledWindowXmlHandler : public wxXmlResourceHandler +{ +public: + wxScrolledWindowXmlHandler(); + virtual wxObject *DoCreateResource(); + virtual bool CanHandle(wxXmlNode *node); +}; + + +#endif // _WX_XH_SCWIN_H_ diff --git a/contrib/src/xrc/Makefile.in b/contrib/src/xrc/Makefile.in index 6305285017..ca0f650ca8 100644 --- a/contrib/src/xrc/Makefile.in +++ b/contrib/src/xrc/Makefile.in @@ -24,7 +24,7 @@ HEADERS=xh_all.h xh_bttn.h xh_chckb.h xh_chckl.h xh_choic.h xh_combo.h \ xh_radbt.h xh_radbx.h xh_sizer.h xh_slidr.h xh_spin.h xh_stbmp.h \ xh_sttxt.h xh_text.h xh_listb.h xml.h xmlres.h xh_toolb.h \ xh_bmpbt.h xh_cald.h xh_listc.h xh_scrol.h xh_stbox.h xh_tree.h \ - xh_stlin.h xh_bmp.h xh_unkwn.h xh_frame.h xh_gdctl.h + xh_stlin.h xh_bmp.h xh_unkwn.h xh_frame.h xh_gdctl.h xh_scwin.h OBJECTS=$(EXPAT_OBJECTS) \ xml.o xmlres.o xmlrsall.o \ @@ -33,7 +33,7 @@ OBJECTS=$(EXPAT_OBJECTS) \ xh_radbx.o xh_sizer.o xh_slidr.o xh_spin.o xh_stbmp.o xh_sttxt.o \ xh_text.o xh_listb.o xh_toolb.o xh_stlin.o xh_bmp.o xh_unkwn.o \ xh_bmpbt.o xh_cald.o xh_listc.o xh_scrol.o xh_stbox.o xh_tree.o \ - xh_frame.o xh_gdctl.o + xh_frame.o xh_gdctl.o xh_scwin.o DEPFILES=$(OBJECTS:.o=.d) APPEXTRADEFS=-I$(top_srcdir)/contrib/include $(EXPAT_DEFS) diff --git a/contrib/src/xrc/XrcVC.dsp b/contrib/src/xrc/XrcVC.dsp index 44c9ba9a78..174c339711 100644 --- a/contrib/src/xrc/XrcVC.dsp +++ b/contrib/src/xrc/XrcVC.dsp @@ -184,6 +184,10 @@ SOURCE=.\xh_scrol.cpp # End Source File # Begin Source File +SOURCE=.\xh_scwin.cpp +# End Source File +# Begin Source File + SOURCE=.\xh_sizer.cpp # End Source File # Begin Source File diff --git a/contrib/src/xrc/makefile.b32 b/contrib/src/xrc/makefile.b32 index dc7d4fa68a..2024abb133 100644 --- a/contrib/src/xrc/makefile.b32 +++ b/contrib/src/xrc/makefile.b32 @@ -27,7 +27,7 @@ OBJECTS=$(EXPAT_OBJECTS) \ xh_radbx.obj xh_sizer.obj xh_slidr.obj xh_spin.obj xh_stbmp.obj xh_sttxt.obj \ xh_text.obj xh_listb.obj xh_toolb.obj xh_stlin.obj xh_bmp.obj \ xh_bmpbt.obj xh_cald.obj xh_listc.obj xh_scrol.obj xh_stbox.obj \ - xh_tree.obj xh_unkwn.obj xh_frame.obj xh_gdctl.obj + xh_tree.obj xh_unkwn.obj xh_frame.obj xh_gdctl.obj xh_scwin.obj !include $(WXDIR)\src\makelib.b32 diff --git a/contrib/src/xrc/makefile.g95 b/contrib/src/xrc/makefile.g95 index 8a4bfb322f..00b31580dc 100644 --- a/contrib/src/xrc/makefile.g95 +++ b/contrib/src/xrc/makefile.g95 @@ -28,7 +28,7 @@ OBJECTS= $(XMLPARSEDIR_OBJECTS) $(XMLTOKDIR_OBJECTS) \ xh_radbx.o xh_sizer.o xh_slidr.o xh_spin.o xh_stbmp.o xh_sttxt.o \ xh_text.o xh_listb.o xh_toolb.o xh_stlin.o xh_bmp.o xh_unkwn.o \ xh_bmpbt.o xh_cald.o xh_listc.o xh_scrol.o xh_stbox.o xh_tree.o \ - xh_frame.o xh_gdctl.o + xh_frame.o xh_gdctl.o xh_scwin.o include $(WXDIR)/src/makelib.g95 diff --git a/contrib/src/xrc/makefile.vc b/contrib/src/xrc/makefile.vc index 51bf90f9b4..6065d42e49 100644 --- a/contrib/src/xrc/makefile.vc +++ b/contrib/src/xrc/makefile.vc @@ -57,7 +57,7 @@ OBJECTS=$(EXPAT_OBJS) \ $(D)\xh_text.obj $(D)\xh_listb.obj $(D)\xh_toolb.obj \ $(D)\xh_bmpbt.obj $(D)\xh_cald.obj $(D)\xh_listc.obj $(D)\xh_scrol.obj \ $(D)\xh_stbox.obj $(D)\xh_tree.obj $(D)\xh_stlin.obj $(D)\xh_bmp.obj \ - $(D)\xh_unkwn.obj $(D)\xh_gdctl.obj + $(D)\xh_unkwn.obj $(D)\xh_gdctl.obj $(D)\xh_scwin.obj !include $(WXDIR)\src\makelib.vc diff --git a/contrib/src/xrc/makefile.wat b/contrib/src/xrc/makefile.wat index 43cfc46647..d4069fc0f6 100644 --- a/contrib/src/xrc/makefile.wat +++ b/contrib/src/xrc/makefile.wat @@ -18,7 +18,7 @@ OBJECTS=xml.obj xmlres.obj xmlrsall.obj & xh_radbx.obj xh_sizer.obj xh_slidr.obj xh_spin.obj xh_stbmp.obj xh_sttxt.obj & xh_text.obj xh_listb.obj xh_toolb.obj xh_stlin.obj xh_bmp.obj & xh_bmpbt.obj xh_cald.obj xh_listc.obj xh_scrol.obj xh_stbox.obj & - xh_tree.obj xh_unkwn.obj xh_frame.obj + xh_tree.obj xh_unkwn.obj xh_frame.obj xh_scwin.obj all: $(WXXMLLIB) diff --git a/contrib/src/xrc/xh_scwin.cpp b/contrib/src/xrc/xh_scwin.cpp new file mode 100644 index 0000000000..9aedfefe57 --- /dev/null +++ b/contrib/src/xrc/xh_scwin.cpp @@ -0,0 +1,52 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: xh_scwin.cpp +// Purpose: XRC resource for wxScrolledWindow +// Author: Vaclav Slavik +// Created: 2002/10/18 +// RCS-ID: $Id$ +// Copyright: (c) 2002 Vaclav Slavik +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#ifdef __GNUG__ +#pragma implementation "xh_scwin.h" +#endif + +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#include "wx/xrc/xh_scwin.h" +#include "wx/scrolwin.h" + + +wxScrolledWindowXmlHandler::wxScrolledWindowXmlHandler() +: wxXmlResourceHandler() +{ + XRC_ADD_STYLE(wxHSCROLL); + XRC_ADD_STYLE(wxVSCROLL); + AddWindowStyles(); +} + +wxObject *wxScrolledWindowXmlHandler::DoCreateResource() +{ + XRC_MAKE_INSTANCE(control, wxScrolledWindow) + + control->Create(m_parentAsWindow, + GetID(), + GetPosition(), GetSize(), + GetStyle(wxT("style"), wxHSCROLL | wxVSCROLL), + GetName()); + + SetupWindow(control); + + return control; +} + +bool wxScrolledWindowXmlHandler::CanHandle(wxXmlNode *node) +{ + return IsOfClass(node, wxT("wxScrolledWindow")); +} diff --git a/contrib/src/xrc/xmlrsall.cpp b/contrib/src/xrc/xmlrsall.cpp index b55badc9f9..5d933f9490 100644 --- a/contrib/src/xrc/xmlrsall.cpp +++ b/contrib/src/xrc/xmlrsall.cpp @@ -94,4 +94,5 @@ void wxXmlResource::InitAllHandlers() AddHandler(new wxGenericDirCtrlXmlHandler); #endif AddHandler(new wxFrameXmlHandler); + AddHandler(new wxScrolledWindowXmlHandler); } diff --git a/docs/tech/tn0014.txt b/docs/tech/tn0014.txt index 1b38bb8bdf..21783d1812 100644 --- a/docs/tech/tn0014.txt +++ b/docs/tech/tn0014.txt @@ -293,6 +293,13 @@ Example: +wxScrolledWindow +---------------- +position Position -1,-1 +size Size -1,-1 +style Style[wxScrolledWindow] wxHSCROLL | wxVSCROLL + + 5. More features ================ diff --git a/include/wx/xrc/xh_all.h b/include/wx/xrc/xh_all.h index 5382b6ffb0..2ac1db392c 100644 --- a/include/wx/xrc/xh_all.h +++ b/include/wx/xrc/xh_all.h @@ -46,5 +46,6 @@ #include "wx/xrc/xh_unkwn.h" #include "wx/xrc/xh_gdctl.h" #include "wx/xrc/xh_frame.h" +#include "wx/xrc/xh_scwin.h" #endif // _WX_XMLRES_H_ diff --git a/include/wx/xrc/xh_scwin.h b/include/wx/xrc/xh_scwin.h new file mode 100644 index 0000000000..1befc41215 --- /dev/null +++ b/include/wx/xrc/xh_scwin.h @@ -0,0 +1,32 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: xh_scwin.h +// Purpose: XML resource handler for wxScrolledWindow +// Author: Vaclav Slavik +// Created: 2002/10/18 +// RCS-ID: $Id$ +// Copyright: (c) 2002 Vaclav Slavik +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_XH_SCWIN_H_ +#define _WX_XH_SCWIN_H_ + +#if defined(__GNUG__) && !defined(__APPLE__) +#pragma interface "xh_scwin.h" +#endif + +#include "wx/xrc/xmlres.h" +#include "wx/defs.h" + + + +class WXXMLDLLEXPORT wxScrolledWindowXmlHandler : public wxXmlResourceHandler +{ +public: + wxScrolledWindowXmlHandler(); + virtual wxObject *DoCreateResource(); + virtual bool CanHandle(wxXmlNode *node); +}; + + +#endif // _WX_XH_SCWIN_H_ diff --git a/src/xrc/Makefile.in b/src/xrc/Makefile.in index 6305285017..ca0f650ca8 100644 --- a/src/xrc/Makefile.in +++ b/src/xrc/Makefile.in @@ -24,7 +24,7 @@ HEADERS=xh_all.h xh_bttn.h xh_chckb.h xh_chckl.h xh_choic.h xh_combo.h \ xh_radbt.h xh_radbx.h xh_sizer.h xh_slidr.h xh_spin.h xh_stbmp.h \ xh_sttxt.h xh_text.h xh_listb.h xml.h xmlres.h xh_toolb.h \ xh_bmpbt.h xh_cald.h xh_listc.h xh_scrol.h xh_stbox.h xh_tree.h \ - xh_stlin.h xh_bmp.h xh_unkwn.h xh_frame.h xh_gdctl.h + xh_stlin.h xh_bmp.h xh_unkwn.h xh_frame.h xh_gdctl.h xh_scwin.h OBJECTS=$(EXPAT_OBJECTS) \ xml.o xmlres.o xmlrsall.o \ @@ -33,7 +33,7 @@ OBJECTS=$(EXPAT_OBJECTS) \ xh_radbx.o xh_sizer.o xh_slidr.o xh_spin.o xh_stbmp.o xh_sttxt.o \ xh_text.o xh_listb.o xh_toolb.o xh_stlin.o xh_bmp.o xh_unkwn.o \ xh_bmpbt.o xh_cald.o xh_listc.o xh_scrol.o xh_stbox.o xh_tree.o \ - xh_frame.o xh_gdctl.o + xh_frame.o xh_gdctl.o xh_scwin.o DEPFILES=$(OBJECTS:.o=.d) APPEXTRADEFS=-I$(top_srcdir)/contrib/include $(EXPAT_DEFS) diff --git a/src/xrc/XrcVC.dsp b/src/xrc/XrcVC.dsp index 44c9ba9a78..174c339711 100644 --- a/src/xrc/XrcVC.dsp +++ b/src/xrc/XrcVC.dsp @@ -184,6 +184,10 @@ SOURCE=.\xh_scrol.cpp # End Source File # Begin Source File +SOURCE=.\xh_scwin.cpp +# End Source File +# Begin Source File + SOURCE=.\xh_sizer.cpp # End Source File # Begin Source File diff --git a/src/xrc/makefile.b32 b/src/xrc/makefile.b32 index dc7d4fa68a..2024abb133 100644 --- a/src/xrc/makefile.b32 +++ b/src/xrc/makefile.b32 @@ -27,7 +27,7 @@ OBJECTS=$(EXPAT_OBJECTS) \ xh_radbx.obj xh_sizer.obj xh_slidr.obj xh_spin.obj xh_stbmp.obj xh_sttxt.obj \ xh_text.obj xh_listb.obj xh_toolb.obj xh_stlin.obj xh_bmp.obj \ xh_bmpbt.obj xh_cald.obj xh_listc.obj xh_scrol.obj xh_stbox.obj \ - xh_tree.obj xh_unkwn.obj xh_frame.obj xh_gdctl.obj + xh_tree.obj xh_unkwn.obj xh_frame.obj xh_gdctl.obj xh_scwin.obj !include $(WXDIR)\src\makelib.b32 diff --git a/src/xrc/makefile.g95 b/src/xrc/makefile.g95 index 8a4bfb322f..00b31580dc 100644 --- a/src/xrc/makefile.g95 +++ b/src/xrc/makefile.g95 @@ -28,7 +28,7 @@ OBJECTS= $(XMLPARSEDIR_OBJECTS) $(XMLTOKDIR_OBJECTS) \ xh_radbx.o xh_sizer.o xh_slidr.o xh_spin.o xh_stbmp.o xh_sttxt.o \ xh_text.o xh_listb.o xh_toolb.o xh_stlin.o xh_bmp.o xh_unkwn.o \ xh_bmpbt.o xh_cald.o xh_listc.o xh_scrol.o xh_stbox.o xh_tree.o \ - xh_frame.o xh_gdctl.o + xh_frame.o xh_gdctl.o xh_scwin.o include $(WXDIR)/src/makelib.g95 diff --git a/src/xrc/makefile.vc b/src/xrc/makefile.vc index 51bf90f9b4..6065d42e49 100644 --- a/src/xrc/makefile.vc +++ b/src/xrc/makefile.vc @@ -57,7 +57,7 @@ OBJECTS=$(EXPAT_OBJS) \ $(D)\xh_text.obj $(D)\xh_listb.obj $(D)\xh_toolb.obj \ $(D)\xh_bmpbt.obj $(D)\xh_cald.obj $(D)\xh_listc.obj $(D)\xh_scrol.obj \ $(D)\xh_stbox.obj $(D)\xh_tree.obj $(D)\xh_stlin.obj $(D)\xh_bmp.obj \ - $(D)\xh_unkwn.obj $(D)\xh_gdctl.obj + $(D)\xh_unkwn.obj $(D)\xh_gdctl.obj $(D)\xh_scwin.obj !include $(WXDIR)\src\makelib.vc diff --git a/src/xrc/makefile.wat b/src/xrc/makefile.wat index 43cfc46647..d4069fc0f6 100644 --- a/src/xrc/makefile.wat +++ b/src/xrc/makefile.wat @@ -18,7 +18,7 @@ OBJECTS=xml.obj xmlres.obj xmlrsall.obj & xh_radbx.obj xh_sizer.obj xh_slidr.obj xh_spin.obj xh_stbmp.obj xh_sttxt.obj & xh_text.obj xh_listb.obj xh_toolb.obj xh_stlin.obj xh_bmp.obj & xh_bmpbt.obj xh_cald.obj xh_listc.obj xh_scrol.obj xh_stbox.obj & - xh_tree.obj xh_unkwn.obj xh_frame.obj + xh_tree.obj xh_unkwn.obj xh_frame.obj xh_scwin.obj all: $(WXXMLLIB) diff --git a/src/xrc/xh_scwin.cpp b/src/xrc/xh_scwin.cpp new file mode 100644 index 0000000000..9aedfefe57 --- /dev/null +++ b/src/xrc/xh_scwin.cpp @@ -0,0 +1,52 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: xh_scwin.cpp +// Purpose: XRC resource for wxScrolledWindow +// Author: Vaclav Slavik +// Created: 2002/10/18 +// RCS-ID: $Id$ +// Copyright: (c) 2002 Vaclav Slavik +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#ifdef __GNUG__ +#pragma implementation "xh_scwin.h" +#endif + +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#include "wx/xrc/xh_scwin.h" +#include "wx/scrolwin.h" + + +wxScrolledWindowXmlHandler::wxScrolledWindowXmlHandler() +: wxXmlResourceHandler() +{ + XRC_ADD_STYLE(wxHSCROLL); + XRC_ADD_STYLE(wxVSCROLL); + AddWindowStyles(); +} + +wxObject *wxScrolledWindowXmlHandler::DoCreateResource() +{ + XRC_MAKE_INSTANCE(control, wxScrolledWindow) + + control->Create(m_parentAsWindow, + GetID(), + GetPosition(), GetSize(), + GetStyle(wxT("style"), wxHSCROLL | wxVSCROLL), + GetName()); + + SetupWindow(control); + + return control; +} + +bool wxScrolledWindowXmlHandler::CanHandle(wxXmlNode *node) +{ + return IsOfClass(node, wxT("wxScrolledWindow")); +} diff --git a/src/xrc/xmlrsall.cpp b/src/xrc/xmlrsall.cpp index b55badc9f9..5d933f9490 100644 --- a/src/xrc/xmlrsall.cpp +++ b/src/xrc/xmlrsall.cpp @@ -94,4 +94,5 @@ void wxXmlResource::InitAllHandlers() AddHandler(new wxGenericDirCtrlXmlHandler); #endif AddHandler(new wxFrameXmlHandler); + AddHandler(new wxScrolledWindowXmlHandler); }