From 582f07c2532e6e2d7d1ccb235354548e9bada9bf Mon Sep 17 00:00:00 2001 From: =?utf8?q?W=C5=82odzimierz=20Skiba?= Date: Tue, 20 Jun 2006 12:26:09 +0000 Subject: [PATCH] [ 1487463 ] XRC handler for wxOwnerDrawnComboBox. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39803 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- Makefile.in | 29 +++++++-- build/bakefiles/files.bkl | 4 +- 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 | 16 ++--- build/msw/wx_xrc.dsp | 8 +++ include/wx/xrc/xh_all.h | 1 + include/wx/xrc/xh_odcombo.h | 32 ++++++++++ samples/xrc/rc/controls.xrc | 20 +++++- src/xrc/xh_odcombo.cpp | 119 ++++++++++++++++++++++++++++++++++++ src/xrc/xmlrsall.cpp | 3 + 13 files changed, 275 insertions(+), 21 deletions(-) create mode 100644 include/wx/xrc/xh_odcombo.h create mode 100644 src/xrc/xh_odcombo.cpp diff --git a/Makefile.in b/Makefile.in index ae99b8b2cd..0a75fd4708 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1279,6 +1279,7 @@ XRCDLL_OBJECTS = \ xrcdll_xh_listc.o \ xrcdll_xh_menu.o \ xrcdll_xh_notbk.o \ + xrcdll_xh_odcombo.o \ xrcdll_xh_panel.o \ xrcdll_xh_radbt.o \ xrcdll_xh_radbx.o \ @@ -1335,6 +1336,7 @@ XRCLIB_OBJECTS = \ xrclib_xh_listc.o \ xrclib_xh_menu.o \ xrclib_xh_notbk.o \ + xrclib_xh_odcombo.o \ xrclib_xh_panel.o \ xrclib_xh_radbt.o \ xrclib_xh_radbx.o \ @@ -2177,9 +2179,9 @@ COND_TOOLKIT_MOTIF_GUI_HDR = \ wx/motif/window.h @COND_TOOLKIT_MOTIF@GUI_HDR = $(COND_TOOLKIT_MOTIF_GUI_HDR) COND_TOOLKIT_MSW_GUI_HDR = \ - wx/generic/clrpicker.h \ - wx/generic/fontpicker.h \ - wx/generic/filepicker.h \ + wx/generic/clrpickerg.h \ + wx/generic/fontpickerg.h \ + wx/generic/filepickerg.h \ wx/msw/accel.h \ wx/msw/app.h \ wx/msw/bitmap.h \ @@ -2371,9 +2373,9 @@ COND_TOOLKIT_PM_GUI_HDR = \ wx/os2/window.h @COND_TOOLKIT_PM@GUI_HDR = $(COND_TOOLKIT_PM_GUI_HDR) COND_TOOLKIT_WINCE_GUI_HDR = \ - wx/generic/clrpicker.h \ - wx/generic/fontpicker.h \ - wx/generic/filepicker.h \ + wx/generic/clrpickerg.h \ + wx/generic/fontpickerg.h \ + wx/generic/filepickerg.h \ wx/msw/accel.h \ wx/msw/app.h \ wx/msw/bitmap.h \ @@ -2888,6 +2890,7 @@ COND_USE_GUI_1_ALL_GUI_HEADERS = \ wx/xrc/xh_listc.h \ wx/xrc/xh_menu.h \ wx/xrc/xh_notbk.h \ + wx/xrc/xh_odcombo.h \ wx/xrc/xh_panel.h \ wx/xrc/xh_radbt.h \ wx/xrc/xh_radbx.h \ @@ -3179,6 +3182,7 @@ COND_USE_GUI_1___MONOLIB_GUI_SRC_OBJECTS = \ monodll_xh_listc.o \ monodll_xh_menu.o \ monodll_xh_notbk.o \ + monodll_xh_odcombo.o \ monodll_xh_panel.o \ monodll_xh_radbt.o \ monodll_xh_radbx.o \ @@ -4843,6 +4847,7 @@ COND_USE_GUI_1___MONOLIB_GUI_SRC_OBJECTS_1 = \ monolib_xh_listc.o \ monolib_xh_menu.o \ monolib_xh_notbk.o \ + monolib_xh_odcombo.o \ monolib_xh_panel.o \ monolib_xh_radbt.o \ monolib_xh_radbx.o \ @@ -12070,6 +12075,9 @@ monodll_xh_menu.o: $(srcdir)/src/xrc/xh_menu.cpp $(MONODLL_ODEP) monodll_xh_notbk.o: $(srcdir)/src/xrc/xh_notbk.cpp $(MONODLL_ODEP) $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/xrc/xh_notbk.cpp +monodll_xh_odcombo.o: $(srcdir)/src/xrc/xh_odcombo.cpp $(MONODLL_ODEP) + $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/xrc/xh_odcombo.cpp + monodll_xh_panel.o: $(srcdir)/src/xrc/xh_panel.cpp $(MONODLL_ODEP) $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/xrc/xh_panel.cpp @@ -15943,6 +15951,9 @@ monolib_xh_menu.o: $(srcdir)/src/xrc/xh_menu.cpp $(MONOLIB_ODEP) monolib_xh_notbk.o: $(srcdir)/src/xrc/xh_notbk.cpp $(MONOLIB_ODEP) $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/xrc/xh_notbk.cpp +monolib_xh_odcombo.o: $(srcdir)/src/xrc/xh_odcombo.cpp $(MONOLIB_ODEP) + $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/xrc/xh_odcombo.cpp + monolib_xh_panel.o: $(srcdir)/src/xrc/xh_panel.cpp $(MONOLIB_ODEP) $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/xrc/xh_panel.cpp @@ -26794,6 +26805,9 @@ xrcdll_xh_menu.o: $(srcdir)/src/xrc/xh_menu.cpp $(XRCDLL_ODEP) xrcdll_xh_notbk.o: $(srcdir)/src/xrc/xh_notbk.cpp $(XRCDLL_ODEP) $(CXXC) -c -o $@ $(XRCDLL_CXXFLAGS) $(srcdir)/src/xrc/xh_notbk.cpp +xrcdll_xh_odcombo.o: $(srcdir)/src/xrc/xh_odcombo.cpp $(XRCDLL_ODEP) + $(CXXC) -c -o $@ $(XRCDLL_CXXFLAGS) $(srcdir)/src/xrc/xh_odcombo.cpp + xrcdll_xh_panel.o: $(srcdir)/src/xrc/xh_panel.cpp $(XRCDLL_ODEP) $(CXXC) -c -o $@ $(XRCDLL_CXXFLAGS) $(srcdir)/src/xrc/xh_panel.cpp @@ -26944,6 +26958,9 @@ xrclib_xh_menu.o: $(srcdir)/src/xrc/xh_menu.cpp $(XRCLIB_ODEP) xrclib_xh_notbk.o: $(srcdir)/src/xrc/xh_notbk.cpp $(XRCLIB_ODEP) $(CXXC) -c -o $@ $(XRCLIB_CXXFLAGS) $(srcdir)/src/xrc/xh_notbk.cpp +xrclib_xh_odcombo.o: $(srcdir)/src/xrc/xh_odcombo.cpp $(XRCLIB_ODEP) + $(CXXC) -c -o $@ $(XRCLIB_CXXFLAGS) $(srcdir)/src/xrc/xh_odcombo.cpp + xrclib_xh_panel.o: $(srcdir)/src/xrc/xh_panel.cpp $(XRCLIB_ODEP) $(CXXC) -c -o $@ $(XRCLIB_CXXFLAGS) $(srcdir)/src/xrc/xh_panel.cpp diff --git a/build/bakefiles/files.bkl b/build/bakefiles/files.bkl index 922c0c3f71..d94f63457d 100644 --- a/build/bakefiles/files.bkl +++ b/build/bakefiles/files.bkl @@ -815,7 +815,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! wx/pickerbase.h wx/popupwin.h wx/print.h - wx/printdlg.h + wx/printdlg.h wx/prntbase.h wx/progdlg.h wx/ptr_scpd.h @@ -2838,6 +2838,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! src/xrc/xh_listc.cpp src/xrc/xh_menu.cpp src/xrc/xh_notbk.cpp + src/xrc/xh_odcombo.cpp src/xrc/xh_panel.cpp src/xrc/xh_radbt.cpp src/xrc/xh_radbx.cpp @@ -2891,6 +2892,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! wx/xrc/xh_listc.h wx/xrc/xh_menu.h wx/xrc/xh_notbk.h + wx/xrc/xh_odcombo.h wx/xrc/xh_panel.h wx/xrc/xh_radbt.h wx/xrc/xh_radbx.h diff --git a/build/msw/makefile.bcc b/build/msw/makefile.bcc index 1de10ace89..a73532ea51 100644 --- a/build/msw/makefile.bcc +++ b/build/msw/makefile.bcc @@ -922,6 +922,7 @@ XRCDLL_OBJECTS = \ $(OBJS)\xrcdll_xh_listc.obj \ $(OBJS)\xrcdll_xh_menu.obj \ $(OBJS)\xrcdll_xh_notbk.obj \ + $(OBJS)\xrcdll_xh_odcombo.obj \ $(OBJS)\xrcdll_xh_panel.obj \ $(OBJS)\xrcdll_xh_radbt.obj \ $(OBJS)\xrcdll_xh_radbx.obj \ @@ -981,6 +982,7 @@ XRCLIB_OBJECTS = \ $(OBJS)\xrclib_xh_listc.obj \ $(OBJS)\xrclib_xh_menu.obj \ $(OBJS)\xrclib_xh_notbk.obj \ + $(OBJS)\xrclib_xh_odcombo.obj \ $(OBJS)\xrclib_xh_panel.obj \ $(OBJS)\xrclib_xh_radbt.obj \ $(OBJS)\xrclib_xh_radbx.obj \ @@ -1170,6 +1172,7 @@ ____MONOLIB_GUI_SRC_FILENAMES_OBJECTS = \ $(OBJS)\monodll_xh_listc.obj \ $(OBJS)\monodll_xh_menu.obj \ $(OBJS)\monodll_xh_notbk.obj \ + $(OBJS)\monodll_xh_odcombo.obj \ $(OBJS)\monodll_xh_panel.obj \ $(OBJS)\monodll_xh_radbt.obj \ $(OBJS)\monodll_xh_radbx.obj \ @@ -1745,6 +1748,7 @@ ____MONOLIB_GUI_SRC_FILENAMES_1_OBJECTS = \ $(OBJS)\monolib_xh_listc.obj \ $(OBJS)\monolib_xh_menu.obj \ $(OBJS)\monolib_xh_notbk.obj \ + $(OBJS)\monolib_xh_odcombo.obj \ $(OBJS)\monolib_xh_panel.obj \ $(OBJS)\monolib_xh_radbt.obj \ $(OBJS)\monolib_xh_radbx.obj \ @@ -4851,6 +4855,9 @@ $(OBJS)\monodll_xh_menu.obj: ..\..\src\xrc\xh_menu.cpp $(OBJS)\monodll_xh_notbk.obj: ..\..\src\xrc\xh_notbk.cpp $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) $** +$(OBJS)\monodll_xh_odcombo.obj: ..\..\src\xrc\xh_odcombo.cpp + $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) $** + $(OBJS)\monodll_xh_panel.obj: ..\..\src\xrc\xh_panel.cpp $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) $** @@ -6717,6 +6724,9 @@ $(OBJS)\monolib_xh_menu.obj: ..\..\src\xrc\xh_menu.cpp $(OBJS)\monolib_xh_notbk.obj: ..\..\src\xrc\xh_notbk.cpp $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) $** +$(OBJS)\monolib_xh_odcombo.obj: ..\..\src\xrc\xh_odcombo.cpp + $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) $** + $(OBJS)\monolib_xh_panel.obj: ..\..\src\xrc\xh_panel.cpp $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) $** @@ -11513,6 +11523,9 @@ $(OBJS)\xrcdll_xh_menu.obj: ..\..\src\xrc\xh_menu.cpp $(OBJS)\xrcdll_xh_notbk.obj: ..\..\src\xrc\xh_notbk.cpp $(CXX) -q -c -P -o$@ $(XRCDLL_CXXFLAGS) $** +$(OBJS)\xrcdll_xh_odcombo.obj: ..\..\src\xrc\xh_odcombo.cpp + $(CXX) -q -c -P -o$@ $(XRCDLL_CXXFLAGS) $** + $(OBJS)\xrcdll_xh_panel.obj: ..\..\src\xrc\xh_panel.cpp $(CXX) -q -c -P -o$@ $(XRCDLL_CXXFLAGS) $** @@ -11666,6 +11679,9 @@ $(OBJS)\xrclib_xh_menu.obj: ..\..\src\xrc\xh_menu.cpp $(OBJS)\xrclib_xh_notbk.obj: ..\..\src\xrc\xh_notbk.cpp $(CXX) -q -c -P -o$@ $(XRCLIB_CXXFLAGS) $** +$(OBJS)\xrclib_xh_odcombo.obj: ..\..\src\xrc\xh_odcombo.cpp + $(CXX) -q -c -P -o$@ $(XRCLIB_CXXFLAGS) $** + $(OBJS)\xrclib_xh_panel.obj: ..\..\src\xrc\xh_panel.cpp $(CXX) -q -c -P -o$@ $(XRCLIB_CXXFLAGS) $** diff --git a/build/msw/makefile.gcc b/build/msw/makefile.gcc index e1e4b214be..a0b9cd628d 100644 --- a/build/msw/makefile.gcc +++ b/build/msw/makefile.gcc @@ -923,6 +923,7 @@ XRCDLL_OBJECTS = \ $(OBJS)\xrcdll_xh_listc.o \ $(OBJS)\xrcdll_xh_menu.o \ $(OBJS)\xrcdll_xh_notbk.o \ + $(OBJS)\xrcdll_xh_odcombo.o \ $(OBJS)\xrcdll_xh_panel.o \ $(OBJS)\xrcdll_xh_radbt.o \ $(OBJS)\xrcdll_xh_radbx.o \ @@ -982,6 +983,7 @@ XRCLIB_OBJECTS = \ $(OBJS)\xrclib_xh_listc.o \ $(OBJS)\xrclib_xh_menu.o \ $(OBJS)\xrclib_xh_notbk.o \ + $(OBJS)\xrclib_xh_odcombo.o \ $(OBJS)\xrclib_xh_panel.o \ $(OBJS)\xrclib_xh_radbt.o \ $(OBJS)\xrclib_xh_radbx.o \ @@ -1180,6 +1182,7 @@ ____MONOLIB_GUI_SRC_FILENAMES_OBJECTS = \ $(OBJS)\monodll_xh_listc.o \ $(OBJS)\monodll_xh_menu.o \ $(OBJS)\monodll_xh_notbk.o \ + $(OBJS)\monodll_xh_odcombo.o \ $(OBJS)\monodll_xh_panel.o \ $(OBJS)\monodll_xh_radbt.o \ $(OBJS)\monodll_xh_radbx.o \ @@ -1761,6 +1764,7 @@ ____MONOLIB_GUI_SRC_FILENAMES_1_OBJECTS = \ $(OBJS)\monolib_xh_listc.o \ $(OBJS)\monolib_xh_menu.o \ $(OBJS)\monolib_xh_notbk.o \ + $(OBJS)\monolib_xh_odcombo.o \ $(OBJS)\monolib_xh_panel.o \ $(OBJS)\monolib_xh_radbt.o \ $(OBJS)\monolib_xh_radbx.o \ @@ -4962,6 +4966,9 @@ $(OBJS)\monodll_xh_menu.o: ../../src/xrc/xh_menu.cpp $(OBJS)\monodll_xh_notbk.o: ../../src/xrc/xh_notbk.cpp $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\monodll_xh_odcombo.o: ../../src/xrc/xh_odcombo.cpp + $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\monodll_xh_panel.o: ../../src/xrc/xh_panel.cpp $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $< @@ -6932,6 +6939,9 @@ $(OBJS)\monolib_xh_menu.o: ../../src/xrc/xh_menu.cpp $(OBJS)\monolib_xh_notbk.o: ../../src/xrc/xh_notbk.cpp $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\monolib_xh_odcombo.o: ../../src/xrc/xh_odcombo.cpp + $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\monolib_xh_panel.o: ../../src/xrc/xh_panel.cpp $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $< @@ -12040,6 +12050,9 @@ $(OBJS)\xrcdll_xh_menu.o: ../../src/xrc/xh_menu.cpp $(OBJS)\xrcdll_xh_notbk.o: ../../src/xrc/xh_notbk.cpp $(CXX) -c -o $@ $(XRCDLL_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\xrcdll_xh_odcombo.o: ../../src/xrc/xh_odcombo.cpp + $(CXX) -c -o $@ $(XRCDLL_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\xrcdll_xh_panel.o: ../../src/xrc/xh_panel.cpp $(CXX) -c -o $@ $(XRCDLL_CXXFLAGS) $(CPPDEPS) $< @@ -12193,6 +12206,9 @@ $(OBJS)\xrclib_xh_menu.o: ../../src/xrc/xh_menu.cpp $(OBJS)\xrclib_xh_notbk.o: ../../src/xrc/xh_notbk.cpp $(CXX) -c -o $@ $(XRCLIB_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\xrclib_xh_odcombo.o: ../../src/xrc/xh_odcombo.cpp + $(CXX) -c -o $@ $(XRCLIB_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\xrclib_xh_panel.o: ../../src/xrc/xh_panel.cpp $(CXX) -c -o $@ $(XRCLIB_CXXFLAGS) $(CPPDEPS) $< diff --git a/build/msw/makefile.vc b/build/msw/makefile.vc index c455537901..6c1556397a 100644 --- a/build/msw/makefile.vc +++ b/build/msw/makefile.vc @@ -1004,6 +1004,7 @@ XRCDLL_OBJECTS = \ $(OBJS)\xrcdll_xh_listc.obj \ $(OBJS)\xrcdll_xh_menu.obj \ $(OBJS)\xrcdll_xh_notbk.obj \ + $(OBJS)\xrcdll_xh_odcombo.obj \ $(OBJS)\xrcdll_xh_panel.obj \ $(OBJS)\xrcdll_xh_radbt.obj \ $(OBJS)\xrcdll_xh_radbx.obj \ @@ -1066,6 +1067,7 @@ XRCLIB_OBJECTS = \ $(OBJS)\xrclib_xh_listc.obj \ $(OBJS)\xrclib_xh_menu.obj \ $(OBJS)\xrclib_xh_notbk.obj \ + $(OBJS)\xrclib_xh_odcombo.obj \ $(OBJS)\xrclib_xh_panel.obj \ $(OBJS)\xrclib_xh_radbt.obj \ $(OBJS)\xrclib_xh_radbx.obj \ @@ -1335,6 +1337,7 @@ ____MONOLIB_GUI_SRC_FILENAMES_OBJECTS = \ $(OBJS)\monodll_xh_listc.obj \ $(OBJS)\monodll_xh_menu.obj \ $(OBJS)\monodll_xh_notbk.obj \ + $(OBJS)\monodll_xh_odcombo.obj \ $(OBJS)\monodll_xh_panel.obj \ $(OBJS)\monodll_xh_radbt.obj \ $(OBJS)\monodll_xh_radbx.obj \ @@ -1916,6 +1919,7 @@ ____MONOLIB_GUI_SRC_FILENAMES_1_OBJECTS = \ $(OBJS)\monolib_xh_listc.obj \ $(OBJS)\monolib_xh_menu.obj \ $(OBJS)\monolib_xh_notbk.obj \ + $(OBJS)\monolib_xh_odcombo.obj \ $(OBJS)\monolib_xh_panel.obj \ $(OBJS)\monolib_xh_radbt.obj \ $(OBJS)\monolib_xh_radbx.obj \ @@ -5174,6 +5178,9 @@ $(OBJS)\monodll_xh_menu.obj: ..\..\src\xrc\xh_menu.cpp $(OBJS)\monodll_xh_notbk.obj: ..\..\src\xrc\xh_notbk.cpp $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) $** +$(OBJS)\monodll_xh_odcombo.obj: ..\..\src\xrc\xh_odcombo.cpp + $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) $** + $(OBJS)\monodll_xh_panel.obj: ..\..\src\xrc\xh_panel.cpp $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) $** @@ -7040,6 +7047,9 @@ $(OBJS)\monolib_xh_menu.obj: ..\..\src\xrc\xh_menu.cpp $(OBJS)\monolib_xh_notbk.obj: ..\..\src\xrc\xh_notbk.cpp $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) $** +$(OBJS)\monolib_xh_odcombo.obj: ..\..\src\xrc\xh_odcombo.cpp + $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) $** + $(OBJS)\monolib_xh_panel.obj: ..\..\src\xrc\xh_panel.cpp $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) $** @@ -11836,6 +11846,9 @@ $(OBJS)\xrcdll_xh_menu.obj: ..\..\src\xrc\xh_menu.cpp $(OBJS)\xrcdll_xh_notbk.obj: ..\..\src\xrc\xh_notbk.cpp $(CXX) /c /nologo /TP /Fo$@ $(XRCDLL_CXXFLAGS) $** +$(OBJS)\xrcdll_xh_odcombo.obj: ..\..\src\xrc\xh_odcombo.cpp + $(CXX) /c /nologo /TP /Fo$@ $(XRCDLL_CXXFLAGS) $** + $(OBJS)\xrcdll_xh_panel.obj: ..\..\src\xrc\xh_panel.cpp $(CXX) /c /nologo /TP /Fo$@ $(XRCDLL_CXXFLAGS) $** @@ -11989,6 +12002,9 @@ $(OBJS)\xrclib_xh_menu.obj: ..\..\src\xrc\xh_menu.cpp $(OBJS)\xrclib_xh_notbk.obj: ..\..\src\xrc\xh_notbk.cpp $(CXX) /c /nologo /TP /Fo$@ $(XRCLIB_CXXFLAGS) $** +$(OBJS)\xrclib_xh_odcombo.obj: ..\..\src\xrc\xh_odcombo.cpp + $(CXX) /c /nologo /TP /Fo$@ $(XRCLIB_CXXFLAGS) $** + $(OBJS)\xrclib_xh_panel.obj: ..\..\src\xrc\xh_panel.cpp $(CXX) /c /nologo /TP /Fo$@ $(XRCLIB_CXXFLAGS) $** diff --git a/build/msw/makefile.wat b/build/msw/makefile.wat index 841eac5056..bcf3e597a4 100644 --- a/build/msw/makefile.wat +++ b/build/msw/makefile.wat @@ -160,6 +160,7 @@ ____MONOLIB_GUI_SRC_FILENAMES_OBJECTS = & $(OBJS)\monodll_xh_listc.obj & $(OBJS)\monodll_xh_menu.obj & $(OBJS)\monodll_xh_notbk.obj & + $(OBJS)\monodll_xh_odcombo.obj & $(OBJS)\monodll_xh_panel.obj & $(OBJS)\monodll_xh_radbt.obj & $(OBJS)\monodll_xh_radbx.obj & @@ -745,6 +746,7 @@ ____MONOLIB_GUI_SRC_FILENAMES_1_OBJECTS = & $(OBJS)\monolib_xh_listc.obj & $(OBJS)\monolib_xh_menu.obj & $(OBJS)\monolib_xh_notbk.obj & + $(OBJS)\monolib_xh_odcombo.obj & $(OBJS)\monolib_xh_panel.obj & $(OBJS)\monolib_xh_radbt.obj & $(OBJS)\monolib_xh_radbx.obj & @@ -3507,6 +3509,7 @@ XRCDLL_OBJECTS = & $(OBJS)\xrcdll_xh_listc.obj & $(OBJS)\xrcdll_xh_menu.obj & $(OBJS)\xrcdll_xh_notbk.obj & + $(OBJS)\xrcdll_xh_odcombo.obj & $(OBJS)\xrcdll_xh_panel.obj & $(OBJS)\xrcdll_xh_radbt.obj & $(OBJS)\xrcdll_xh_radbx.obj & @@ -3567,6 +3570,7 @@ XRCLIB_OBJECTS = & $(OBJS)\xrclib_xh_listc.obj & $(OBJS)\xrclib_xh_menu.obj & $(OBJS)\xrclib_xh_notbk.obj & + $(OBJS)\xrclib_xh_odcombo.obj & $(OBJS)\xrclib_xh_panel.obj & $(OBJS)\xrclib_xh_radbt.obj & $(OBJS)\xrclib_xh_radbx.obj & @@ -5174,6 +5178,9 @@ $(OBJS)\monodll_xh_menu.obj : .AUTODEPEND ..\..\src\xrc\xh_menu.cpp $(OBJS)\monodll_xh_notbk.obj : .AUTODEPEND ..\..\src\xrc\xh_notbk.cpp $(CXX) -bt=nt -zq -fo=$^@ $(MONODLL_CXXFLAGS) $< +$(OBJS)\monodll_xh_odcombo.obj : .AUTODEPEND ..\..\src\xrc\xh_odcombo.cpp + $(CXX) -bt=nt -zq -fo=$^@ $(MONODLL_CXXFLAGS) $< + $(OBJS)\monodll_xh_panel.obj : .AUTODEPEND ..\..\src\xrc\xh_panel.cpp $(CXX) -bt=nt -zq -fo=$^@ $(MONODLL_CXXFLAGS) $< @@ -7144,6 +7151,9 @@ $(OBJS)\monolib_xh_menu.obj : .AUTODEPEND ..\..\src\xrc\xh_menu.cpp $(OBJS)\monolib_xh_notbk.obj : .AUTODEPEND ..\..\src\xrc\xh_notbk.cpp $(CXX) -bt=nt -zq -fo=$^@ $(MONOLIB_CXXFLAGS) $< +$(OBJS)\monolib_xh_odcombo.obj : .AUTODEPEND ..\..\src\xrc\xh_odcombo.cpp + $(CXX) -bt=nt -zq -fo=$^@ $(MONOLIB_CXXFLAGS) $< + $(OBJS)\monolib_xh_panel.obj : .AUTODEPEND ..\..\src\xrc\xh_panel.cpp $(CXX) -bt=nt -zq -fo=$^@ $(MONOLIB_CXXFLAGS) $< @@ -12252,6 +12262,9 @@ $(OBJS)\xrcdll_xh_menu.obj : .AUTODEPEND ..\..\src\xrc\xh_menu.cpp $(OBJS)\xrcdll_xh_notbk.obj : .AUTODEPEND ..\..\src\xrc\xh_notbk.cpp $(CXX) -bt=nt -zq -fo=$^@ $(XRCDLL_CXXFLAGS) $< +$(OBJS)\xrcdll_xh_odcombo.obj : .AUTODEPEND ..\..\src\xrc\xh_odcombo.cpp + $(CXX) -bt=nt -zq -fo=$^@ $(XRCDLL_CXXFLAGS) $< + $(OBJS)\xrcdll_xh_panel.obj : .AUTODEPEND ..\..\src\xrc\xh_panel.cpp $(CXX) -bt=nt -zq -fo=$^@ $(XRCDLL_CXXFLAGS) $< @@ -12405,6 +12418,9 @@ $(OBJS)\xrclib_xh_menu.obj : .AUTODEPEND ..\..\src\xrc\xh_menu.cpp $(OBJS)\xrclib_xh_notbk.obj : .AUTODEPEND ..\..\src\xrc\xh_notbk.cpp $(CXX) -bt=nt -zq -fo=$^@ $(XRCLIB_CXXFLAGS) $< +$(OBJS)\xrclib_xh_odcombo.obj : .AUTODEPEND ..\..\src\xrc\xh_odcombo.cpp + $(CXX) -bt=nt -zq -fo=$^@ $(XRCLIB_CXXFLAGS) $< + $(OBJS)\xrclib_xh_panel.obj : .AUTODEPEND ..\..\src\xrc\xh_panel.cpp $(CXX) -bt=nt -zq -fo=$^@ $(XRCLIB_CXXFLAGS) $< diff --git a/build/msw/wx_core.dsp b/build/msw/wx_core.dsp index 3142ed8738..15687bf31d 100644 --- a/build/msw/wx_core.dsp +++ b/build/msw/wx_core.dsp @@ -8157,10 +8157,6 @@ SOURCE=..\..\include\wx\generic\choicdgg.h # End Source File # Begin Source File -SOURCE=..\..\include\wx\generic\clrpicker.h -# End Source File -# Begin Source File - SOURCE=..\..\include\wx\generic\clrpickerg.h # End Source File # Begin Source File @@ -8205,10 +8201,6 @@ SOURCE=..\..\include\wx\generic\filedlgg.h # End Source File # Begin Source File -SOURCE=..\..\include\wx\generic\filepicker.h -# End Source File -# Begin Source File - SOURCE=..\..\include\wx\generic\filepickerg.h # End Source File # Begin Source File @@ -8217,10 +8209,6 @@ SOURCE=..\..\include\wx\generic\fontdlgg.h # End Source File # Begin Source File -SOURCE=..\..\include\wx\generic\fontpicker.h -# End Source File -# Begin Source File - SOURCE=..\..\include\wx\generic\fontpickerg.h # End Source File # Begin Source File @@ -9401,6 +9389,10 @@ SOURCE=..\..\include\wx\xrc\xh_notbk.h # End Source File # Begin Source File +SOURCE=..\..\include\wx\xrc\xh_odcombo.h +# End Source File +# Begin Source File + SOURCE=..\..\include\wx\xrc\xh_panel.h # End Source File # Begin Source File diff --git a/build/msw/wx_xrc.dsp b/build/msw/wx_xrc.dsp index 0c46997f55..58c77965a5 100644 --- a/build/msw/wx_xrc.dsp +++ b/build/msw/wx_xrc.dsp @@ -1070,6 +1070,10 @@ SOURCE=..\..\include\wx\xrc\xh_notbk.h # End Source File # Begin Source File +SOURCE=..\..\include\wx\xrc\xh_odcombo.h +# End Source File +# Begin Source File + SOURCE=..\..\include\wx\xrc\xh_panel.h # End Source File # Begin Source File @@ -1270,6 +1274,10 @@ SOURCE=..\..\src\xrc\xh_notbk.cpp # End Source File # Begin Source File +SOURCE=..\..\src\xrc\xh_odcombo.cpp +# End Source File +# Begin Source File + SOURCE=..\..\src\xrc\xh_panel.cpp # End Source File # Begin Source File diff --git a/include/wx/xrc/xh_all.h b/include/wx/xrc/xh_all.h index 7c70ee1b65..c7ef079507 100644 --- a/include/wx/xrc/xh_all.h +++ b/include/wx/xrc/xh_all.h @@ -34,6 +34,7 @@ #include "wx/xrc/xh_sizer.h" #include "wx/xrc/xh_stbmp.h" #include "wx/xrc/xh_notbk.h" +#include "wx/xrc/xh_odcombo.h" #include "wx/xrc/xh_listbk.h" #include "wx/xrc/xh_choicbk.h" #include "wx/xrc/xh_treebk.h" diff --git a/include/wx/xrc/xh_odcombo.h b/include/wx/xrc/xh_odcombo.h new file mode 100644 index 0000000000..7febc5590c --- /dev/null +++ b/include/wx/xrc/xh_odcombo.h @@ -0,0 +1,32 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: wx/xrc/xh_odcombo.h +// Purpose: XML resource handler for wxOwnerDrawnComboBox +// Author: Alex Bligh - based on wx/xrc/xh_combo.h +// Created: 2006/06/19 +// RCS-ID: $Id$ +// Copyright: (c) 2006 Alex Bligh +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_XH_ODCOMBO_H_ +#define _WX_XH_ODCOMBO_H_ + +#include "wx/xrc/xmlres.h" + +#if wxUSE_ODCOMBOBOX + +class WXDLLIMPEXP_XRC wxOwnerDrawnComboBoxXmlHandler : public wxXmlResourceHandler +{ +DECLARE_DYNAMIC_CLASS(wxOwnerDrawnComboBoxXmlHandler) +public: + wxOwnerDrawnComboBoxXmlHandler(); + virtual wxObject *DoCreateResource(); + virtual bool CanHandle(wxXmlNode *node); +private: + bool m_insideBox; + wxArrayString strList; +}; + +#endif + +#endif // _WX_XH_ODCOMBO_H_ diff --git a/samples/xrc/rc/controls.xrc b/samples/xrc/rc/controls.xrc index f834b6a1a1..81139cb851 100644 --- a/samples/xrc/rc/controls.xrc +++ b/samples/xrc/rc/controls.xrc @@ -1,5 +1,7 @@ + + @@ -127,6 +129,13 @@ in the toolbar + + + Owner Drawn + combobox + in the toolbar + + @@ -191,13 +200,20 @@ in the toolbar + + + Owner Drawn + combobox + in the toolbar + + - + @@ -482,7 +498,7 @@ I dream things that never were, and say why not"</i> <p><pre>Fixed width for code snippets.</pre> <p>Horizontal rules to organize sections: <hr> - <p>A wxImage is worth a thousand words and can be also used. + <p>A wxImage is worth a thousand words and can be also used. diff --git a/src/xrc/xh_odcombo.cpp b/src/xrc/xh_odcombo.cpp new file mode 100644 index 0000000000..aa8707aecf --- /dev/null +++ b/src/xrc/xh_odcombo.cpp @@ -0,0 +1,119 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: src/xrc/xh_odcombo.cpp +// Purpose: XRC resource for wxRadioBox +// Author: Alex Bligh - Based on src/xrc/xh_combo.cpp +// Created: 2006/06/19 +// RCS-ID: $Id$ +// Copyright: (c) 2006 Alex Bligh +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#if wxUSE_XRC && wxUSE_ODCOMBOBOX + +#include "wx/xrc/xh_odcombo.h" + +#ifndef WX_PRECOMP + #include "wx/intl.h" +#endif + +#include "wx/odcombo.h" + +IMPLEMENT_DYNAMIC_CLASS(wxOwnerDrawnComboBoxXmlHandler, wxXmlResourceHandler) + +wxOwnerDrawnComboBoxXmlHandler::wxOwnerDrawnComboBoxXmlHandler() + :wxXmlResourceHandler() + ,m_insideBox(false) +{ + XRC_ADD_STYLE(wxCB_SIMPLE); + XRC_ADD_STYLE(wxCB_SORT); + XRC_ADD_STYLE(wxCB_READONLY); + XRC_ADD_STYLE(wxCB_DROPDOWN); + XRC_ADD_STYLE(wxODCB_STD_CONTROL_PAINT); + XRC_ADD_STYLE(wxODCB_DCLICK_CYCLES); + AddWindowStyles(); +} + +wxObject *wxOwnerDrawnComboBoxXmlHandler::DoCreateResource() +{ + if( m_class == wxT("wxOwnerDrawnComboBox")) + { + // find the selection + long selection = GetLong( wxT("selection"), -1 ); + + // need to build the list of strings from children + m_insideBox = true; + CreateChildrenPrivately(NULL, GetParamNode(wxT("content"))); + wxString *strings = (wxString *) NULL; + if (strList.GetCount() > 0) + { + strings = new wxString[strList.GetCount()]; + int count = strList.GetCount(); + for (int i = 0; i < count; i++) + strings[i]=strList[i]; + } + + XRC_MAKE_INSTANCE(control, wxOwnerDrawnComboBox) + + control->Create(m_parentAsWindow, + GetID(), + GetText(wxT("value")), + GetPosition(), GetSize(), + strList.GetCount(), + strings, + GetStyle(), + wxDefaultValidator, + GetName()); + + control->SetPopupControl(NULL); + + wxSize ButtonSize=GetSize(wxT("buttonsize")); + + if (ButtonSize != wxDefaultSize) + control->SetButtonPosition(ButtonSize.GetWidth(), ButtonSize.GetHeight()); + + if (selection != -1) + control->SetSelection(selection); + + SetupWindow(control); + + if (strings != NULL) + delete[] strings; + strList.Clear(); // dump the strings + + return control; + } + else + { + // on the inside now. + // handle Label + + // add to the list + wxString str = GetNodeContent(m_node); + if (m_resource->GetFlags() & wxXRC_USE_LOCALE) + str = wxGetTranslation(str); + strList.Add(str); + + return NULL; + } +} + +bool wxOwnerDrawnComboBoxXmlHandler::CanHandle(wxXmlNode *node) +{ +// Avoid GCC bug - this fails on certain GCC 3.x builds for an unknown reason +// return (IsOfClass(node, wxT("wxOwnerDrawnComboBox")) || +// (m_insideBox && node->GetName() == wxT("item"))); + + bool fOurClass = node->GetPropVal(wxT("class"), wxEmptyString) == wxT("wxOwnerDrawnComboBox"); + return (fOurClass || + (m_insideBox && node->GetName() == wxT("item"))); + +} + +#endif // wxUSE_XRC && wxUSE_ODCOMBOBOX diff --git a/src/xrc/xmlrsall.cpp b/src/xrc/xmlrsall.cpp index a1c027447f..bc6254ec92 100644 --- a/src/xrc/xmlrsall.cpp +++ b/src/xrc/xmlrsall.cpp @@ -77,6 +77,9 @@ void wxXmlResource::InitAllHandlers() #if wxUSE_COMBOBOX AddHandler(new wxComboBoxXmlHandler); #endif +#if wxUSE_ODCOMBOBOX + AddHandler(new wxOwnerDrawnComboBoxXmlHandler); +#endif #if wxUSE_NOTEBOOK AddHandler(new wxNotebookXmlHandler); #endif -- 2.45.2