From 4689441b050787afee8b9113ca1ea574e551cb77 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 23 Oct 2010 18:56:28 +0000 Subject: [PATCH] Add XRC handler for wxToolbook. Closes #11615. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65885 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- Makefile.in | 17 ++++ build/bakefiles/files.bkl | 2 + build/msw/makefile.bcc | 16 ++++ build/msw/makefile.gcc | 16 ++++ build/msw/makefile.vc | 16 ++++ build/msw/makefile.wat | 16 ++++ build/msw/wx_core.dsp | 4 + build/msw/wx_vc7_core.vcproj | 3 + build/msw/wx_vc7_xrc.vcproj | 6 ++ build/msw/wx_vc8_core.vcproj | 4 + build/msw/wx_vc8_xrc.vcproj | 8 ++ build/msw/wx_vc9_core.vcproj | 4 + build/msw/wx_vc9_xrc.vcproj | 8 ++ build/msw/wx_xrc.dsp | 8 ++ docs/changes.txt | 1 + docs/doxygen/overviews/xrc_format.h | 23 +++++ include/wx/xrc/xh_all.h | 1 + include/wx/xrc/xh_toolbk.h | 36 +++++++ samples/xrc/rc/controls.xrc | 35 +++++++ src/xrc/xh_toolbk.cpp | 141 ++++++++++++++++++++++++++++ src/xrc/xmlrsall.cpp | 3 + 21 files changed, 368 insertions(+) create mode 100644 include/wx/xrc/xh_toolbk.h create mode 100644 src/xrc/xh_toolbk.cpp diff --git a/Makefile.in b/Makefile.in index c4609122cc..84ef0f4b25 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1695,6 +1695,7 @@ XRCDLL_OBJECTS = \ xrcdll_xh_text.o \ xrcdll_xh_tglbtn.o \ xrcdll_xh_toolb.o \ + xrcdll_xh_toolbk.o \ xrcdll_xh_tree.o \ xrcdll_xh_treebk.o \ xrcdll_xh_unkwn.o \ @@ -1764,6 +1765,7 @@ XRCLIB_OBJECTS = \ xrclib_xh_text.o \ xrclib_xh_tglbtn.o \ xrclib_xh_toolb.o \ + xrclib_xh_toolbk.o \ xrclib_xh_tree.o \ xrclib_xh_treebk.o \ xrclib_xh_unkwn.o \ @@ -4098,6 +4100,7 @@ COND_USE_GUI_1_ALL_GUI_HEADERS = \ wx/xrc/xh_text.h \ wx/xrc/xh_tglbtn.h \ wx/xrc/xh_toolb.h \ + wx/xrc/xh_toolbk.h \ wx/xrc/xh_tree.h \ wx/xrc/xh_treebk.h \ wx/xrc/xh_unkwn.h \ @@ -4393,6 +4396,7 @@ COND_USE_GUI_1___MONOLIB_GUI_SRC_OBJECTS = \ monodll_xh_text.o \ monodll_xh_tglbtn.o \ monodll_xh_toolb.o \ + monodll_xh_toolbk.o \ monodll_xh_tree.o \ monodll_xh_treebk.o \ monodll_xh_unkwn.o \ @@ -6268,6 +6272,7 @@ COND_USE_GUI_1___MONOLIB_GUI_SRC_OBJECTS_1 = \ monolib_xh_text.o \ monolib_xh_tglbtn.o \ monolib_xh_toolb.o \ + monolib_xh_toolbk.o \ monolib_xh_tree.o \ monolib_xh_treebk.o \ monolib_xh_unkwn.o \ @@ -17041,6 +17046,9 @@ monodll_xh_tglbtn.o: $(srcdir)/src/xrc/xh_tglbtn.cpp $(MONODLL_ODEP) monodll_xh_toolb.o: $(srcdir)/src/xrc/xh_toolb.cpp $(MONODLL_ODEP) $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/xrc/xh_toolb.cpp +monodll_xh_toolbk.o: $(srcdir)/src/xrc/xh_toolbk.cpp $(MONODLL_ODEP) + $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/xrc/xh_toolbk.cpp + monodll_xh_tree.o: $(srcdir)/src/xrc/xh_tree.cpp $(MONODLL_ODEP) $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/xrc/xh_tree.cpp @@ -22267,6 +22275,9 @@ monolib_xh_tglbtn.o: $(srcdir)/src/xrc/xh_tglbtn.cpp $(MONOLIB_ODEP) monolib_xh_toolb.o: $(srcdir)/src/xrc/xh_toolb.cpp $(MONOLIB_ODEP) $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/xrc/xh_toolb.cpp +monolib_xh_toolbk.o: $(srcdir)/src/xrc/xh_toolbk.cpp $(MONOLIB_ODEP) + $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/xrc/xh_toolbk.cpp + monolib_xh_tree.o: $(srcdir)/src/xrc/xh_tree.cpp $(MONOLIB_ODEP) $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/xrc/xh_tree.cpp @@ -35662,6 +35673,9 @@ xrcdll_xh_tglbtn.o: $(srcdir)/src/xrc/xh_tglbtn.cpp $(XRCDLL_ODEP) xrcdll_xh_toolb.o: $(srcdir)/src/xrc/xh_toolb.cpp $(XRCDLL_ODEP) $(CXXC) -c -o $@ $(XRCDLL_CXXFLAGS) $(srcdir)/src/xrc/xh_toolb.cpp +xrcdll_xh_toolbk.o: $(srcdir)/src/xrc/xh_toolbk.cpp $(XRCDLL_ODEP) + $(CXXC) -c -o $@ $(XRCDLL_CXXFLAGS) $(srcdir)/src/xrc/xh_toolbk.cpp + xrcdll_xh_tree.o: $(srcdir)/src/xrc/xh_tree.cpp $(XRCDLL_ODEP) $(CXXC) -c -o $@ $(XRCDLL_CXXFLAGS) $(srcdir)/src/xrc/xh_tree.cpp @@ -35848,6 +35862,9 @@ xrclib_xh_tglbtn.o: $(srcdir)/src/xrc/xh_tglbtn.cpp $(XRCLIB_ODEP) xrclib_xh_toolb.o: $(srcdir)/src/xrc/xh_toolb.cpp $(XRCLIB_ODEP) $(CXXC) -c -o $@ $(XRCLIB_CXXFLAGS) $(srcdir)/src/xrc/xh_toolb.cpp +xrclib_xh_toolbk.o: $(srcdir)/src/xrc/xh_toolbk.cpp $(XRCLIB_ODEP) + $(CXXC) -c -o $@ $(XRCLIB_CXXFLAGS) $(srcdir)/src/xrc/xh_toolbk.cpp + xrclib_xh_tree.o: $(srcdir)/src/xrc/xh_tree.cpp $(XRCLIB_ODEP) $(CXXC) -c -o $@ $(XRCLIB_CXXFLAGS) $(srcdir)/src/xrc/xh_tree.cpp diff --git a/build/bakefiles/files.bkl b/build/bakefiles/files.bkl index fd9adf79ab..3e92103acd 100644 --- a/build/bakefiles/files.bkl +++ b/build/bakefiles/files.bkl @@ -3358,6 +3358,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! src/xrc/xh_text.cpp src/xrc/xh_tglbtn.cpp src/xrc/xh_toolb.cpp + src/xrc/xh_toolbk.cpp src/xrc/xh_tree.cpp src/xrc/xh_treebk.cpp src/xrc/xh_unkwn.cpp @@ -3424,6 +3425,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! wx/xrc/xh_text.h wx/xrc/xh_tglbtn.h wx/xrc/xh_toolb.h + wx/xrc/xh_toolbk.h wx/xrc/xh_tree.h wx/xrc/xh_treebk.h wx/xrc/xh_unkwn.h diff --git a/build/msw/makefile.bcc b/build/msw/makefile.bcc index 0c5e38322b..0d0c3c8bab 100644 --- a/build/msw/makefile.bcc +++ b/build/msw/makefile.bcc @@ -1188,6 +1188,7 @@ XRCDLL_OBJECTS = \ $(OBJS)\xrcdll_xh_text.obj \ $(OBJS)\xrcdll_xh_tglbtn.obj \ $(OBJS)\xrcdll_xh_toolb.obj \ + $(OBJS)\xrcdll_xh_toolbk.obj \ $(OBJS)\xrcdll_xh_tree.obj \ $(OBJS)\xrcdll_xh_treebk.obj \ $(OBJS)\xrcdll_xh_unkwn.obj \ @@ -1261,6 +1262,7 @@ XRCLIB_OBJECTS = \ $(OBJS)\xrclib_xh_text.obj \ $(OBJS)\xrclib_xh_tglbtn.obj \ $(OBJS)\xrclib_xh_toolb.obj \ + $(OBJS)\xrclib_xh_toolbk.obj \ $(OBJS)\xrclib_xh_tree.obj \ $(OBJS)\xrclib_xh_treebk.obj \ $(OBJS)\xrclib_xh_unkwn.obj \ @@ -1628,6 +1630,7 @@ ____MONOLIB_GUI_SRC_FILENAMES_OBJECTS = \ $(OBJS)\monodll_xh_text.obj \ $(OBJS)\monodll_xh_tglbtn.obj \ $(OBJS)\monodll_xh_toolb.obj \ + $(OBJS)\monodll_xh_toolbk.obj \ $(OBJS)\monodll_xh_tree.obj \ $(OBJS)\monodll_xh_treebk.obj \ $(OBJS)\monodll_xh_unkwn.obj \ @@ -2350,6 +2353,7 @@ ____MONOLIB_GUI_SRC_FILENAMES_1_OBJECTS = \ $(OBJS)\monolib_xh_text.obj \ $(OBJS)\monolib_xh_tglbtn.obj \ $(OBJS)\monolib_xh_toolb.obj \ + $(OBJS)\monolib_xh_toolbk.obj \ $(OBJS)\monolib_xh_tree.obj \ $(OBJS)\monolib_xh_treebk.obj \ $(OBJS)\monolib_xh_unkwn.obj \ @@ -6684,6 +6688,9 @@ $(OBJS)\monodll_xh_tglbtn.obj: ..\..\src\xrc\xh_tglbtn.cpp $(OBJS)\monodll_xh_toolb.obj: ..\..\src\xrc\xh_toolb.cpp $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) ..\..\src\xrc\xh_toolb.cpp +$(OBJS)\monodll_xh_toolbk.obj: ..\..\src\xrc\xh_toolbk.cpp + $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) ..\..\src\xrc\xh_toolbk.cpp + $(OBJS)\monodll_xh_tree.obj: ..\..\src\xrc\xh_tree.cpp $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) ..\..\src\xrc\xh_tree.cpp @@ -8925,6 +8932,9 @@ $(OBJS)\monolib_xh_tglbtn.obj: ..\..\src\xrc\xh_tglbtn.cpp $(OBJS)\monolib_xh_toolb.obj: ..\..\src\xrc\xh_toolb.cpp $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) ..\..\src\xrc\xh_toolb.cpp +$(OBJS)\monolib_xh_toolbk.obj: ..\..\src\xrc\xh_toolbk.cpp + $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) ..\..\src\xrc\xh_toolbk.cpp + $(OBJS)\monolib_xh_tree.obj: ..\..\src\xrc\xh_tree.cpp $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) ..\..\src\xrc\xh_tree.cpp @@ -14245,6 +14255,9 @@ $(OBJS)\xrcdll_xh_tglbtn.obj: ..\..\src\xrc\xh_tglbtn.cpp $(OBJS)\xrcdll_xh_toolb.obj: ..\..\src\xrc\xh_toolb.cpp $(CXX) -q -c -P -o$@ $(XRCDLL_CXXFLAGS) ..\..\src\xrc\xh_toolb.cpp +$(OBJS)\xrcdll_xh_toolbk.obj: ..\..\src\xrc\xh_toolbk.cpp + $(CXX) -q -c -P -o$@ $(XRCDLL_CXXFLAGS) ..\..\src\xrc\xh_toolbk.cpp + $(OBJS)\xrcdll_xh_tree.obj: ..\..\src\xrc\xh_tree.cpp $(CXX) -q -c -P -o$@ $(XRCDLL_CXXFLAGS) ..\..\src\xrc\xh_tree.cpp @@ -14434,6 +14447,9 @@ $(OBJS)\xrclib_xh_tglbtn.obj: ..\..\src\xrc\xh_tglbtn.cpp $(OBJS)\xrclib_xh_toolb.obj: ..\..\src\xrc\xh_toolb.cpp $(CXX) -q -c -P -o$@ $(XRCLIB_CXXFLAGS) ..\..\src\xrc\xh_toolb.cpp +$(OBJS)\xrclib_xh_toolbk.obj: ..\..\src\xrc\xh_toolbk.cpp + $(CXX) -q -c -P -o$@ $(XRCLIB_CXXFLAGS) ..\..\src\xrc\xh_toolbk.cpp + $(OBJS)\xrclib_xh_tree.obj: ..\..\src\xrc\xh_tree.cpp $(CXX) -q -c -P -o$@ $(XRCLIB_CXXFLAGS) ..\..\src\xrc\xh_tree.cpp diff --git a/build/msw/makefile.gcc b/build/msw/makefile.gcc index 7b5e90e629..2474ededb4 100644 --- a/build/msw/makefile.gcc +++ b/build/msw/makefile.gcc @@ -1186,6 +1186,7 @@ XRCDLL_OBJECTS = \ $(OBJS)\xrcdll_xh_text.o \ $(OBJS)\xrcdll_xh_tglbtn.o \ $(OBJS)\xrcdll_xh_toolb.o \ + $(OBJS)\xrcdll_xh_toolbk.o \ $(OBJS)\xrcdll_xh_tree.o \ $(OBJS)\xrcdll_xh_treebk.o \ $(OBJS)\xrcdll_xh_unkwn.o \ @@ -1258,6 +1259,7 @@ XRCLIB_OBJECTS = \ $(OBJS)\xrclib_xh_text.o \ $(OBJS)\xrclib_xh_tglbtn.o \ $(OBJS)\xrclib_xh_toolb.o \ + $(OBJS)\xrclib_xh_toolbk.o \ $(OBJS)\xrclib_xh_tree.o \ $(OBJS)\xrclib_xh_treebk.o \ $(OBJS)\xrclib_xh_unkwn.o \ @@ -1638,6 +1640,7 @@ ____MONOLIB_GUI_SRC_FILENAMES_OBJECTS = \ $(OBJS)\monodll_xh_text.o \ $(OBJS)\monodll_xh_tglbtn.o \ $(OBJS)\monodll_xh_toolb.o \ + $(OBJS)\monodll_xh_toolbk.o \ $(OBJS)\monodll_xh_tree.o \ $(OBJS)\monodll_xh_treebk.o \ $(OBJS)\monodll_xh_unkwn.o \ @@ -2366,6 +2369,7 @@ ____MONOLIB_GUI_SRC_FILENAMES_1_OBJECTS = \ $(OBJS)\monolib_xh_text.o \ $(OBJS)\monolib_xh_tglbtn.o \ $(OBJS)\monolib_xh_toolb.o \ + $(OBJS)\monolib_xh_toolbk.o \ $(OBJS)\monolib_xh_tree.o \ $(OBJS)\monolib_xh_treebk.o \ $(OBJS)\monolib_xh_unkwn.o \ @@ -6834,6 +6838,9 @@ $(OBJS)\monodll_xh_tglbtn.o: ../../src/xrc/xh_tglbtn.cpp $(OBJS)\monodll_xh_toolb.o: ../../src/xrc/xh_toolb.cpp $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\monodll_xh_toolbk.o: ../../src/xrc/xh_toolbk.cpp + $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\monodll_xh_tree.o: ../../src/xrc/xh_tree.cpp $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $< @@ -9075,6 +9082,9 @@ $(OBJS)\monolib_xh_tglbtn.o: ../../src/xrc/xh_tglbtn.cpp $(OBJS)\monolib_xh_toolb.o: ../../src/xrc/xh_toolb.cpp $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\monolib_xh_toolbk.o: ../../src/xrc/xh_toolbk.cpp + $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\monolib_xh_tree.o: ../../src/xrc/xh_tree.cpp $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $< @@ -14395,6 +14405,9 @@ $(OBJS)\xrcdll_xh_tglbtn.o: ../../src/xrc/xh_tglbtn.cpp $(OBJS)\xrcdll_xh_toolb.o: ../../src/xrc/xh_toolb.cpp $(CXX) -c -o $@ $(XRCDLL_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\xrcdll_xh_toolbk.o: ../../src/xrc/xh_toolbk.cpp + $(CXX) -c -o $@ $(XRCDLL_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\xrcdll_xh_tree.o: ../../src/xrc/xh_tree.cpp $(CXX) -c -o $@ $(XRCDLL_CXXFLAGS) $(CPPDEPS) $< @@ -14584,6 +14597,9 @@ $(OBJS)\xrclib_xh_tglbtn.o: ../../src/xrc/xh_tglbtn.cpp $(OBJS)\xrclib_xh_toolb.o: ../../src/xrc/xh_toolb.cpp $(CXX) -c -o $@ $(XRCLIB_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\xrclib_xh_toolbk.o: ../../src/xrc/xh_toolbk.cpp + $(CXX) -c -o $@ $(XRCLIB_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\xrclib_xh_tree.o: ../../src/xrc/xh_tree.cpp $(CXX) -c -o $@ $(XRCLIB_CXXFLAGS) $(CPPDEPS) $< diff --git a/build/msw/makefile.vc b/build/msw/makefile.vc index 7b61305f92..4920dfe706 100644 --- a/build/msw/makefile.vc +++ b/build/msw/makefile.vc @@ -1263,6 +1263,7 @@ XRCDLL_OBJECTS = \ $(OBJS)\xrcdll_xh_text.obj \ $(OBJS)\xrcdll_xh_tglbtn.obj \ $(OBJS)\xrcdll_xh_toolb.obj \ + $(OBJS)\xrcdll_xh_toolbk.obj \ $(OBJS)\xrcdll_xh_tree.obj \ $(OBJS)\xrcdll_xh_treebk.obj \ $(OBJS)\xrcdll_xh_unkwn.obj \ @@ -1340,6 +1341,7 @@ XRCLIB_OBJECTS = \ $(OBJS)\xrclib_xh_text.obj \ $(OBJS)\xrclib_xh_tglbtn.obj \ $(OBJS)\xrclib_xh_toolb.obj \ + $(OBJS)\xrclib_xh_toolbk.obj \ $(OBJS)\xrclib_xh_tree.obj \ $(OBJS)\xrclib_xh_treebk.obj \ $(OBJS)\xrclib_xh_unkwn.obj \ @@ -1836,6 +1838,7 @@ ____MONOLIB_GUI_SRC_FILENAMES_OBJECTS = \ $(OBJS)\monodll_xh_text.obj \ $(OBJS)\monodll_xh_tglbtn.obj \ $(OBJS)\monodll_xh_toolb.obj \ + $(OBJS)\monodll_xh_toolbk.obj \ $(OBJS)\monodll_xh_tree.obj \ $(OBJS)\monodll_xh_treebk.obj \ $(OBJS)\monodll_xh_unkwn.obj \ @@ -2564,6 +2567,7 @@ ____MONOLIB_GUI_SRC_FILENAMES_1_OBJECTS = \ $(OBJS)\monolib_xh_text.obj \ $(OBJS)\monolib_xh_tglbtn.obj \ $(OBJS)\monolib_xh_toolb.obj \ + $(OBJS)\monolib_xh_toolbk.obj \ $(OBJS)\monolib_xh_tree.obj \ $(OBJS)\monolib_xh_treebk.obj \ $(OBJS)\monolib_xh_unkwn.obj \ @@ -7264,6 +7268,9 @@ $(OBJS)\monodll_xh_tglbtn.obj: ..\..\src\xrc\xh_tglbtn.cpp $(OBJS)\monodll_xh_toolb.obj: ..\..\src\xrc\xh_toolb.cpp $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\xrc\xh_toolb.cpp +$(OBJS)\monodll_xh_toolbk.obj: ..\..\src\xrc\xh_toolbk.cpp + $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\xrc\xh_toolbk.cpp + $(OBJS)\monodll_xh_tree.obj: ..\..\src\xrc\xh_tree.cpp $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\xrc\xh_tree.cpp @@ -9505,6 +9512,9 @@ $(OBJS)\monolib_xh_tglbtn.obj: ..\..\src\xrc\xh_tglbtn.cpp $(OBJS)\monolib_xh_toolb.obj: ..\..\src\xrc\xh_toolb.cpp $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\xrc\xh_toolb.cpp +$(OBJS)\monolib_xh_toolbk.obj: ..\..\src\xrc\xh_toolbk.cpp + $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\xrc\xh_toolbk.cpp + $(OBJS)\monolib_xh_tree.obj: ..\..\src\xrc\xh_tree.cpp $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\xrc\xh_tree.cpp @@ -14825,6 +14835,9 @@ $(OBJS)\xrcdll_xh_tglbtn.obj: ..\..\src\xrc\xh_tglbtn.cpp $(OBJS)\xrcdll_xh_toolb.obj: ..\..\src\xrc\xh_toolb.cpp $(CXX) /c /nologo /TP /Fo$@ $(XRCDLL_CXXFLAGS) ..\..\src\xrc\xh_toolb.cpp +$(OBJS)\xrcdll_xh_toolbk.obj: ..\..\src\xrc\xh_toolbk.cpp + $(CXX) /c /nologo /TP /Fo$@ $(XRCDLL_CXXFLAGS) ..\..\src\xrc\xh_toolbk.cpp + $(OBJS)\xrcdll_xh_tree.obj: ..\..\src\xrc\xh_tree.cpp $(CXX) /c /nologo /TP /Fo$@ $(XRCDLL_CXXFLAGS) ..\..\src\xrc\xh_tree.cpp @@ -15014,6 +15027,9 @@ $(OBJS)\xrclib_xh_tglbtn.obj: ..\..\src\xrc\xh_tglbtn.cpp $(OBJS)\xrclib_xh_toolb.obj: ..\..\src\xrc\xh_toolb.cpp $(CXX) /c /nologo /TP /Fo$@ $(XRCLIB_CXXFLAGS) ..\..\src\xrc\xh_toolb.cpp +$(OBJS)\xrclib_xh_toolbk.obj: ..\..\src\xrc\xh_toolbk.cpp + $(CXX) /c /nologo /TP /Fo$@ $(XRCLIB_CXXFLAGS) ..\..\src\xrc\xh_toolbk.cpp + $(OBJS)\xrclib_xh_tree.obj: ..\..\src\xrc\xh_tree.cpp $(CXX) /c /nologo /TP /Fo$@ $(XRCLIB_CXXFLAGS) ..\..\src\xrc\xh_tree.cpp diff --git a/build/msw/makefile.wat b/build/msw/makefile.wat index de6c794ab1..b17ef49e57 100644 --- a/build/msw/makefile.wat +++ b/build/msw/makefile.wat @@ -192,6 +192,7 @@ ____MONOLIB_GUI_SRC_FILENAMES_OBJECTS = & $(OBJS)\monodll_xh_text.obj & $(OBJS)\monodll_xh_tglbtn.obj & $(OBJS)\monodll_xh_toolb.obj & + $(OBJS)\monodll_xh_toolbk.obj & $(OBJS)\monodll_xh_tree.obj & $(OBJS)\monodll_xh_treebk.obj & $(OBJS)\monodll_xh_unkwn.obj & @@ -925,6 +926,7 @@ ____MONOLIB_GUI_SRC_FILENAMES_1_OBJECTS = & $(OBJS)\monolib_xh_text.obj & $(OBJS)\monolib_xh_tglbtn.obj & $(OBJS)\monolib_xh_toolb.obj & + $(OBJS)\monolib_xh_toolbk.obj & $(OBJS)\monolib_xh_tree.obj & $(OBJS)\monolib_xh_treebk.obj & $(OBJS)\monolib_xh_unkwn.obj & @@ -4446,6 +4448,7 @@ XRCDLL_OBJECTS = & $(OBJS)\xrcdll_xh_text.obj & $(OBJS)\xrcdll_xh_tglbtn.obj & $(OBJS)\xrcdll_xh_toolb.obj & + $(OBJS)\xrcdll_xh_toolbk.obj & $(OBJS)\xrcdll_xh_tree.obj & $(OBJS)\xrcdll_xh_treebk.obj & $(OBJS)\xrcdll_xh_unkwn.obj & @@ -4519,6 +4522,7 @@ XRCLIB_OBJECTS = & $(OBJS)\xrclib_xh_text.obj & $(OBJS)\xrclib_xh_tglbtn.obj & $(OBJS)\xrclib_xh_toolb.obj & + $(OBJS)\xrclib_xh_toolbk.obj & $(OBJS)\xrclib_xh_tree.obj & $(OBJS)\xrclib_xh_treebk.obj & $(OBJS)\xrclib_xh_unkwn.obj & @@ -7093,6 +7097,9 @@ $(OBJS)\monodll_xh_tglbtn.obj : .AUTODEPEND ..\..\src\xrc\xh_tglbtn.cpp $(OBJS)\monodll_xh_toolb.obj : .AUTODEPEND ..\..\src\xrc\xh_toolb.cpp $(CXX) -bt=nt -zq -fo=$^@ $(MONODLL_CXXFLAGS) $< +$(OBJS)\monodll_xh_toolbk.obj : .AUTODEPEND ..\..\src\xrc\xh_toolbk.cpp + $(CXX) -bt=nt -zq -fo=$^@ $(MONODLL_CXXFLAGS) $< + $(OBJS)\monodll_xh_tree.obj : .AUTODEPEND ..\..\src\xrc\xh_tree.cpp $(CXX) -bt=nt -zq -fo=$^@ $(MONODLL_CXXFLAGS) $< @@ -9334,6 +9341,9 @@ $(OBJS)\monolib_xh_tglbtn.obj : .AUTODEPEND ..\..\src\xrc\xh_tglbtn.cpp $(OBJS)\monolib_xh_toolb.obj : .AUTODEPEND ..\..\src\xrc\xh_toolb.cpp $(CXX) -bt=nt -zq -fo=$^@ $(MONOLIB_CXXFLAGS) $< +$(OBJS)\monolib_xh_toolbk.obj : .AUTODEPEND ..\..\src\xrc\xh_toolbk.cpp + $(CXX) -bt=nt -zq -fo=$^@ $(MONOLIB_CXXFLAGS) $< + $(OBJS)\monolib_xh_tree.obj : .AUTODEPEND ..\..\src\xrc\xh_tree.cpp $(CXX) -bt=nt -zq -fo=$^@ $(MONOLIB_CXXFLAGS) $< @@ -14654,6 +14664,9 @@ $(OBJS)\xrcdll_xh_tglbtn.obj : .AUTODEPEND ..\..\src\xrc\xh_tglbtn.cpp $(OBJS)\xrcdll_xh_toolb.obj : .AUTODEPEND ..\..\src\xrc\xh_toolb.cpp $(CXX) -bt=nt -zq -fo=$^@ $(XRCDLL_CXXFLAGS) $< +$(OBJS)\xrcdll_xh_toolbk.obj : .AUTODEPEND ..\..\src\xrc\xh_toolbk.cpp + $(CXX) -bt=nt -zq -fo=$^@ $(XRCDLL_CXXFLAGS) $< + $(OBJS)\xrcdll_xh_tree.obj : .AUTODEPEND ..\..\src\xrc\xh_tree.cpp $(CXX) -bt=nt -zq -fo=$^@ $(XRCDLL_CXXFLAGS) $< @@ -14843,6 +14856,9 @@ $(OBJS)\xrclib_xh_tglbtn.obj : .AUTODEPEND ..\..\src\xrc\xh_tglbtn.cpp $(OBJS)\xrclib_xh_toolb.obj : .AUTODEPEND ..\..\src\xrc\xh_toolb.cpp $(CXX) -bt=nt -zq -fo=$^@ $(XRCLIB_CXXFLAGS) $< +$(OBJS)\xrclib_xh_toolbk.obj : .AUTODEPEND ..\..\src\xrc\xh_toolbk.cpp + $(CXX) -bt=nt -zq -fo=$^@ $(XRCLIB_CXXFLAGS) $< + $(OBJS)\xrclib_xh_tree.obj : .AUTODEPEND ..\..\src\xrc\xh_tree.cpp $(CXX) -bt=nt -zq -fo=$^@ $(XRCLIB_CXXFLAGS) $< diff --git a/build/msw/wx_core.dsp b/build/msw/wx_core.dsp index 8f83352bfc..d3ca2d626e 100644 --- a/build/msw/wx_core.dsp +++ b/build/msw/wx_core.dsp @@ -6997,6 +6997,10 @@ SOURCE=..\..\include\wx\xrc\xh_toolb.h # End Source File # Begin Source File +SOURCE=..\..\include\wx\xrc\xh_toolbk.h +# End Source File +# Begin Source File + SOURCE=..\..\include\wx\xrc\xh_tree.h # End Source File # Begin Source File diff --git a/build/msw/wx_vc7_core.vcproj b/build/msw/wx_vc7_core.vcproj index 949ee780d6..03d10e80a6 100644 --- a/build/msw/wx_vc7_core.vcproj +++ b/build/msw/wx_vc7_core.vcproj @@ -5842,6 +5842,9 @@ + + diff --git a/build/msw/wx_vc7_xrc.vcproj b/build/msw/wx_vc7_xrc.vcproj index 6cc172baf9..46086d21d9 100644 --- a/build/msw/wx_vc7_xrc.vcproj +++ b/build/msw/wx_vc7_xrc.vcproj @@ -947,6 +947,9 @@ + + @@ -1132,6 +1135,9 @@ + + diff --git a/build/msw/wx_vc8_core.vcproj b/build/msw/wx_vc8_core.vcproj index de949701a2..d0f2ec79d8 100644 --- a/build/msw/wx_vc8_core.vcproj +++ b/build/msw/wx_vc8_core.vcproj @@ -7807,6 +7807,10 @@ RelativePath="..\..\include\wx\xrc\xh_toolb.h" > + + diff --git a/build/msw/wx_vc8_xrc.vcproj b/build/msw/wx_vc8_xrc.vcproj index bcc388e70d..6b260b6271 100644 --- a/build/msw/wx_vc8_xrc.vcproj +++ b/build/msw/wx_vc8_xrc.vcproj @@ -1282,6 +1282,10 @@ RelativePath="..\..\include\wx\xrc\xh_toolb.h" > + + @@ -1528,6 +1532,10 @@ RelativePath="..\..\src\xrc\xh_toolb.cpp" > + + diff --git a/build/msw/wx_vc9_core.vcproj b/build/msw/wx_vc9_core.vcproj index 0761bb0df4..66040dd3be 100644 --- a/build/msw/wx_vc9_core.vcproj +++ b/build/msw/wx_vc9_core.vcproj @@ -7803,6 +7803,10 @@ RelativePath="..\..\include\wx\xrc\xh_toolb.h" > + + diff --git a/build/msw/wx_vc9_xrc.vcproj b/build/msw/wx_vc9_xrc.vcproj index 5d64235b2c..e7170798f1 100644 --- a/build/msw/wx_vc9_xrc.vcproj +++ b/build/msw/wx_vc9_xrc.vcproj @@ -1278,6 +1278,10 @@ RelativePath="..\..\include\wx\xrc\xh_toolb.h" > + + @@ -1524,6 +1528,10 @@ RelativePath="..\..\src\xrc\xh_toolb.cpp" > + + diff --git a/build/msw/wx_xrc.dsp b/build/msw/wx_xrc.dsp index f25fce836b..4f15d1889c 100644 --- a/build/msw/wx_xrc.dsp +++ b/build/msw/wx_xrc.dsp @@ -754,6 +754,10 @@ SOURCE=..\..\include\wx\xrc\xh_toolb.h # End Source File # Begin Source File +SOURCE=..\..\include\wx\xrc\xh_toolbk.h +# End Source File +# Begin Source File + SOURCE=..\..\include\wx\xrc\xh_tree.h # End Source File # Begin Source File @@ -998,6 +1002,10 @@ SOURCE=..\..\src\xrc\xh_toolb.cpp # End Source File # Begin Source File +SOURCE=..\..\src\xrc\xh_toolbk.cpp +# End Source File +# Begin Source File + SOURCE=..\..\src\xrc\xh_tree.cpp # End Source File # Begin Source File diff --git a/docs/changes.txt b/docs/changes.txt index bc7eaae2a2..e189246df5 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -423,6 +423,7 @@ All (GUI): - Fix display of right aligned columns in wxGenericListCtrl (jl). - Restore text drag-and-drop in wxSTC broken by Scintilla 2 update (Jens Lody). - Improve wxGTK print/page setup dialog (rafravago). +- Added wxToolbook XRC handler (Andrea Zanellato). MSW: diff --git a/docs/doxygen/overviews/xrc_format.h b/docs/doxygen/overviews/xrc_format.h index 7f966cce6a..1401ef2cd6 100644 --- a/docs/doxygen/overviews/xrc_format.h +++ b/docs/doxygen/overviews/xrc_format.h @@ -1666,6 +1666,29 @@ Example: @endcode +@subsubsection xrc_wxtoolbook wxToolbook + +A toolbook can have one or more child objects of the @c toolbookpage +pseudo-class (similarly to @ref xrc_wxnotebook "wxNotebook" and its +@c notebookpage) and one child object of the @ref xrc_wximagelist class. +@c toolbookpage objects have the following properties: + +@beginTable +@hdr3col{property, type, description} +@row3col{label, @ref overview_xrcformat_type_text, + Sheet page's title (required).} +@row3col{bitmap, @ref overview_xrcformat_type_bitmap, + Bitmap shown alongside the label (default: none).} +@row3col{image, integer, + The zero-based index of the image associated with the item + into the image list.} +@row3col{selected, @ref overview_xrcformat_type_bool, + Is the page selected initially (only one page can be selected; default: 0)?} +@endTable + +Each @c toolbookpage has exactly one non-toplevel window as its child. + + @subsubsection xrc_wxtreectrl wxTreeCtrl A treectrl can have one child object of the @ref xrc_wximagelist class. diff --git a/include/wx/xrc/xh_all.h b/include/wx/xrc/xh_all.h index 8c48afb37f..21bd620de8 100644 --- a/include/wx/xrc/xh_all.h +++ b/include/wx/xrc/xh_all.h @@ -69,6 +69,7 @@ #include "wx/xrc/xh_text.h" #include "wx/xrc/xh_tglbtn.h" #include "wx/xrc/xh_toolb.h" +#include "wx/xrc/xh_toolbk.h" #include "wx/xrc/xh_tree.h" #include "wx/xrc/xh_treebk.h" #include "wx/xrc/xh_unkwn.h" diff --git a/include/wx/xrc/xh_toolbk.h b/include/wx/xrc/xh_toolbk.h new file mode 100644 index 0000000000..16aa174d67 --- /dev/null +++ b/include/wx/xrc/xh_toolbk.h @@ -0,0 +1,36 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: wx/xrc/xh_toolbk.h +// Purpose: XML resource handler for wxToolbook +// Author: Andrea Zanellato +// Created: 2009/12/12 +// Copyright: (c) 2010 wxWidgets development team +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_XH_TOOLBK_H_ +#define _WX_XH_TOOLBK_H_ + +#include "wx/xrc/xmlres.h" + +#if wxUSE_XRC && wxUSE_TOOLBOOK + +class WXDLLIMPEXP_FWD_CORE wxToolbook; + +class WXDLLIMPEXP_XRC wxToolbookXmlHandler : public wxXmlResourceHandler +{ +public: + wxToolbookXmlHandler(); + + virtual wxObject *DoCreateResource(); + virtual bool CanHandle(wxXmlNode *node); + +private: + bool m_isInside; + wxToolbook *m_toolbook; + + wxDECLARE_DYNAMIC_CLASS(wxToolbookXmlHandler); +}; + +#endif // wxUSE_XRC && wxUSE_TOOLBOOK + +#endif // _WX_XH_TOOLBK_H_ diff --git a/samples/xrc/rc/controls.xrc b/samples/xrc/rc/controls.xrc index 44979fa767..c17c340695 100644 --- a/samples/xrc/rc/controls.xrc +++ b/samples/xrc/rc/controls.xrc @@ -57,6 +57,41 @@ + + + + + + 350,280 + + + + + + + + 0 + + + + + + + 1 + + + + + + + 2 + + + + + + + diff --git a/src/xrc/xh_toolbk.cpp b/src/xrc/xh_toolbk.cpp new file mode 100644 index 0000000000..22f9b33a41 --- /dev/null +++ b/src/xrc/xh_toolbk.cpp @@ -0,0 +1,141 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: src/xrc/xh_toolbk.cpp +// Purpose: XRC resource for wxToolbook +// Author: Andrea Zanellato +// Created: 2009/12/12 +// Copyright: (c) 2010 wxWidgets development team +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#if wxUSE_XRC && wxUSE_TOOLBOOK + +#include "wx/xrc/xh_toolbk.h" + +#ifndef WX_PRECOMP + #include "wx/log.h" + #include "wx/sizer.h" +#endif + +#include "wx/toolbook.h" +#include "wx/imaglist.h" + +IMPLEMENT_DYNAMIC_CLASS(wxToolbookXmlHandler, wxXmlResourceHandler) + +wxToolbookXmlHandler::wxToolbookXmlHandler() + :wxXmlResourceHandler(), + m_isInside(false), + m_toolbook(NULL) +{ + XRC_ADD_STYLE(wxBK_DEFAULT); + XRC_ADD_STYLE(wxBK_TOP); + XRC_ADD_STYLE(wxBK_BOTTOM); + XRC_ADD_STYLE(wxBK_LEFT); + XRC_ADD_STYLE(wxBK_RIGHT); + + XRC_ADD_STYLE(wxTBK_BUTTONBAR); + XRC_ADD_STYLE(wxTBK_HORZ_LAYOUT); + + AddWindowStyles(); +} + +wxObject *wxToolbookXmlHandler::DoCreateResource() +{ + if (m_class == wxT("toolbookpage")) + { + wxXmlNode *n = GetParamNode(wxT("object")); + + if ( !n ) + n = GetParamNode(wxT("object_ref")); + + if (n) + { + bool old_ins = m_isInside; + m_isInside = false; + wxObject *item = CreateResFromNode(n, m_toolbook, NULL); + m_isInside = old_ins; + wxWindow *wnd = wxDynamicCast(item, wxWindow); + + if (wnd) + { + int imgId = -1; + + if ( HasParam(wxT("bitmap")) ) + { + wxBitmap bmp = GetBitmap(wxT("bitmap"), wxART_OTHER); + wxImageList *imgList = m_toolbook->GetImageList(); + if ( imgList == NULL ) + { + imgList = new wxImageList( bmp.GetWidth(), bmp.GetHeight() ); + m_toolbook->AssignImageList( imgList ); + } + imgId = imgList->Add(bmp); + } + else if ( HasParam(wxT("image")) ) + { + if ( m_toolbook->GetImageList() ) + { + imgId = (int)GetLong(wxT("image")); + } + else // image without image list? + { + ReportError(n, "image can only be used in conjunction " + "with imagelist"); + } + } + + m_toolbook->AddPage(wnd, GetText(wxT("label")), + GetBool(wxT("selected")), imgId ); + } + else + { + ReportError(n, "toolbookpage child must be a window"); + } + return wnd; + } + else + { + ReportError("toolbookpage must have a window child"); + return NULL; + } + } + + else + { + XRC_MAKE_INSTANCE(nb, wxToolbook) + + nb->Create( m_parentAsWindow, + GetID(), + GetPosition(), GetSize(), + GetStyle(wxT("style")), + GetName() ); + + wxImageList *imagelist = GetImageList(); + if ( imagelist ) + nb->AssignImageList(imagelist); + + wxToolbook *old_par = m_toolbook; + m_toolbook = nb; + bool old_ins = m_isInside; + m_isInside = true; + CreateChildren(m_toolbook, true/*only this handler*/); + m_isInside = old_ins; + m_toolbook = old_par; + + return nb; + } +} + +bool wxToolbookXmlHandler::CanHandle(wxXmlNode *node) +{ + return ((!m_isInside && IsOfClass(node, wxT("wxToolbook"))) || + (m_isInside && IsOfClass(node, wxT("toolbookpage")))); +} + +#endif // wxUSE_XRC && wxUSE_TOOLBOOK diff --git a/src/xrc/xmlrsall.cpp b/src/xrc/xmlrsall.cpp index a8e7ab2f2b..b116c5d994 100644 --- a/src/xrc/xmlrsall.cpp +++ b/src/xrc/xmlrsall.cpp @@ -188,6 +188,9 @@ void wxXmlResource::InitAllHandlers() #if wxUSE_TOOLBAR AddHandler(new wxToolBarXmlHandler); #endif +#if wxUSE_TOOLBOOK + AddHandler(new wxToolbookXmlHandler); +#endif #if wxUSE_TREEBOOK AddHandler(new wxTreebookXmlHandler); #endif -- 2.45.2