diff --git a/Makefile.in b/Makefile.in index e711506614..f07501ae69 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1662,6 +1662,7 @@ XRCDLL_CXXFLAGS = $(__xrcdll_PCH_INC) -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) \ XRCDLL_OBJECTS = \ $(__xrcdll___win32rc) \ xrcdll_xh_animatctrl.o \ + xrcdll_xh_bannerwindow.o \ xrcdll_xh_bmp.o \ xrcdll_xh_bmpcbox.o \ xrcdll_xh_bmpbt.o \ @@ -1732,6 +1733,7 @@ XRCLIB_CXXFLAGS = $(__xrclib_PCH_INC) -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) \ $(__INC_EXPAT_p) $(CXXWARNINGS) $(CPPFLAGS) $(CXXFLAGS) XRCLIB_OBJECTS = \ xrclib_xh_animatctrl.o \ + xrclib_xh_bannerwindow.o \ xrclib_xh_bmp.o \ xrclib_xh_bmpcbox.o \ xrclib_xh_bmpbt.o \ @@ -3784,6 +3786,7 @@ COND_TOOLKIT_WINCE_ADVANCED_PLATFORM_NATIVE_HDR = \ COND_WXUNIV_0_ADVANCED_HDR = \ wx/aboutdlg.h \ wx/animate.h \ + wx/bannerwindow.h \ wx/bmpcbox.h \ wx/calctrl.h \ wx/commandlinkbutton.h \ @@ -3831,6 +3834,7 @@ COND_WXUNIV_0_ADVANCED_HDR = \ COND_WXUNIV_1_ADVANCED_HDR = \ wx/aboutdlg.h \ wx/animate.h \ + wx/bannerwindow.h \ wx/bmpcbox.h \ wx/calctrl.h \ wx/commandlinkbutton.h \ @@ -4013,6 +4017,7 @@ COND_USE_GUI_1_ALL_GUI_HEADERS = \ wx/helphtml.h \ wx/icon.h \ wx/infobar.h \ + wx/itemid.h \ wx/layout.h \ wx/listbox.h \ wx/mdi.h \ @@ -4054,6 +4059,7 @@ COND_USE_GUI_1_ALL_GUI_HEADERS = \ wx/valnum.h \ wx/window.h \ wx/windowid.h \ + wx/withimages.h \ wx/wrapsizer.h \ wx/wupdlock.h \ wx/accel.h \ @@ -4193,6 +4199,7 @@ COND_USE_GUI_1_ALL_GUI_HEADERS = \ wx/debugrpt.h \ wx/xrc/xh_all.h \ wx/xrc/xh_animatctrl.h \ + wx/xrc/xh_bannerwindow.h \ wx/xrc/xh_bmpbt.h \ wx/xrc/xh_bmp.h \ wx/xrc/xh_bmpcbox.h \ @@ -4500,6 +4507,7 @@ COND_USE_GUI_1___MONOLIB_GUI_SRC_OBJECTS = \ monodll_debugrpt.o \ monodll_dbgrptg.o \ monodll_xh_animatctrl.o \ + monodll_xh_bannerwindow.o \ monodll_xh_bmp.o \ monodll_xh_bmpcbox.o \ monodll_xh_bmpbt.o \ @@ -6321,6 +6329,7 @@ COND_WXUNIV_0___ADVANCED_SRC_OBJECTS = \ monodll_hyperlnkcmn.o \ monodll_odcombocmn.o \ monodll_aboutdlgg.o \ + monodll_bannerwindow.o \ monodll_bmpcboxg.o \ monodll_calctrlg.o \ monodll_commandlinkbuttong.o \ @@ -6353,6 +6362,7 @@ COND_WXUNIV_1___ADVANCED_SRC_OBJECTS = \ monodll_hyperlnkcmn.o \ monodll_odcombocmn.o \ monodll_aboutdlgg.o \ + monodll_bannerwindow.o \ monodll_bmpcboxg.o \ monodll_calctrlg.o \ monodll_commandlinkbuttong.o \ @@ -6580,6 +6590,7 @@ COND_USE_GUI_1___MONOLIB_GUI_SRC_OBJECTS_1 = \ monolib_debugrpt.o \ monolib_dbgrptg.o \ monolib_xh_animatctrl.o \ + monolib_xh_bannerwindow.o \ monolib_xh_bmp.o \ monolib_xh_bmpcbox.o \ monolib_xh_bmpbt.o \ @@ -8401,6 +8412,7 @@ COND_WXUNIV_0___ADVANCED_SRC_OBJECTS_1 = \ monolib_hyperlnkcmn.o \ monolib_odcombocmn.o \ monolib_aboutdlgg.o \ + monolib_bannerwindow.o \ monolib_bmpcboxg.o \ monolib_calctrlg.o \ monolib_commandlinkbuttong.o \ @@ -8433,6 +8445,7 @@ COND_WXUNIV_1___ADVANCED_SRC_OBJECTS_1 = \ monolib_hyperlnkcmn.o \ monolib_odcombocmn.o \ monolib_aboutdlgg.o \ + monolib_bannerwindow.o \ monolib_bmpcboxg.o \ monolib_calctrlg.o \ monolib_commandlinkbuttong.o \ @@ -12466,6 +12479,7 @@ COND_WXUNIV_0___ADVANCED_SRC_OBJECTS_2 = \ advdll_hyperlnkcmn.o \ advdll_odcombocmn.o \ advdll_aboutdlgg.o \ + advdll_bannerwindow.o \ advdll_bmpcboxg.o \ advdll_calctrlg.o \ advdll_commandlinkbuttong.o \ @@ -12498,6 +12512,7 @@ COND_WXUNIV_1___ADVANCED_SRC_OBJECTS_2 = \ advdll_hyperlnkcmn.o \ advdll_odcombocmn.o \ advdll_aboutdlgg.o \ + advdll_bannerwindow.o \ advdll_bmpcboxg.o \ advdll_calctrlg.o \ advdll_commandlinkbuttong.o \ @@ -12578,6 +12593,7 @@ COND_WXUNIV_0___ADVANCED_SRC_OBJECTS_3 = \ advlib_hyperlnkcmn.o \ advlib_odcombocmn.o \ advlib_aboutdlgg.o \ + advlib_bannerwindow.o \ advlib_bmpcboxg.o \ advlib_calctrlg.o \ advlib_commandlinkbuttong.o \ @@ -12610,6 +12626,7 @@ COND_WXUNIV_1___ADVANCED_SRC_OBJECTS_3 = \ advlib_hyperlnkcmn.o \ advlib_odcombocmn.o \ advlib_aboutdlgg.o \ + advlib_bannerwindow.o \ advlib_bmpcboxg.o \ advlib_calctrlg.o \ advlib_commandlinkbuttong.o \ @@ -17740,6 +17757,9 @@ monodll_dbgrptg.o: $(srcdir)/src/generic/dbgrptg.cpp $(MONODLL_ODEP) monodll_xh_animatctrl.o: $(srcdir)/src/xrc/xh_animatctrl.cpp $(MONODLL_ODEP) $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/xrc/xh_animatctrl.cpp +monodll_xh_bannerwindow.o: $(srcdir)/src/xrc/xh_bannerwindow.cpp $(MONODLL_ODEP) + $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/xrc/xh_bannerwindow.cpp + monodll_xh_bmp.o: $(srcdir)/src/xrc/xh_bmp.cpp $(MONODLL_ODEP) $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/xrc/xh_bmp.cpp @@ -21355,6 +21375,9 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP) @COND_USE_GUI_1@monodll_aboutdlgg.o: $(srcdir)/src/generic/aboutdlgg.cpp $(MONODLL_ODEP) @COND_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/generic/aboutdlgg.cpp +@COND_USE_GUI_1@monodll_bannerwindow.o: $(srcdir)/src/generic/bannerwindow.cpp $(MONODLL_ODEP) +@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/generic/bannerwindow.cpp + @COND_USE_GUI_1@monodll_bmpcboxg.o: $(srcdir)/src/generic/bmpcboxg.cpp $(MONODLL_ODEP) @COND_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/generic/bmpcboxg.cpp @@ -23389,6 +23412,9 @@ monolib_dbgrptg.o: $(srcdir)/src/generic/dbgrptg.cpp $(MONOLIB_ODEP) monolib_xh_animatctrl.o: $(srcdir)/src/xrc/xh_animatctrl.cpp $(MONOLIB_ODEP) $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/xrc/xh_animatctrl.cpp +monolib_xh_bannerwindow.o: $(srcdir)/src/xrc/xh_bannerwindow.cpp $(MONOLIB_ODEP) + $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/xrc/xh_bannerwindow.cpp + monolib_xh_bmp.o: $(srcdir)/src/xrc/xh_bmp.cpp $(MONOLIB_ODEP) $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/xrc/xh_bmp.cpp @@ -27004,6 +27030,9 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP) @COND_USE_GUI_1@monolib_aboutdlgg.o: $(srcdir)/src/generic/aboutdlgg.cpp $(MONOLIB_ODEP) @COND_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/generic/aboutdlgg.cpp +@COND_USE_GUI_1@monolib_bannerwindow.o: $(srcdir)/src/generic/bannerwindow.cpp $(MONOLIB_ODEP) +@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/generic/bannerwindow.cpp + @COND_USE_GUI_1@monolib_bmpcboxg.o: $(srcdir)/src/generic/bmpcboxg.cpp $(MONOLIB_ODEP) @COND_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/generic/bmpcboxg.cpp @@ -37150,6 +37179,9 @@ advdll_odcombocmn.o: $(srcdir)/src/common/odcombocmn.cpp $(ADVDLL_ODEP) advdll_aboutdlgg.o: $(srcdir)/src/generic/aboutdlgg.cpp $(ADVDLL_ODEP) $(CXXC) -c -o $@ $(ADVDLL_CXXFLAGS) $(srcdir)/src/generic/aboutdlgg.cpp +advdll_bannerwindow.o: $(srcdir)/src/generic/bannerwindow.cpp $(ADVDLL_ODEP) + $(CXXC) -c -o $@ $(ADVDLL_CXXFLAGS) $(srcdir)/src/generic/bannerwindow.cpp + advdll_bmpcboxg.o: $(srcdir)/src/generic/bmpcboxg.cpp $(ADVDLL_ODEP) $(CXXC) -c -o $@ $(ADVDLL_CXXFLAGS) $(srcdir)/src/generic/bmpcboxg.cpp @@ -37543,6 +37575,9 @@ advlib_odcombocmn.o: $(srcdir)/src/common/odcombocmn.cpp $(ADVLIB_ODEP) advlib_aboutdlgg.o: $(srcdir)/src/generic/aboutdlgg.cpp $(ADVLIB_ODEP) $(CXXC) -c -o $@ $(ADVLIB_CXXFLAGS) $(srcdir)/src/generic/aboutdlgg.cpp +advlib_bannerwindow.o: $(srcdir)/src/generic/bannerwindow.cpp $(ADVLIB_ODEP) + $(CXXC) -c -o $@ $(ADVLIB_CXXFLAGS) $(srcdir)/src/generic/bannerwindow.cpp + advlib_bmpcboxg.o: $(srcdir)/src/generic/bmpcboxg.cpp $(ADVLIB_ODEP) $(CXXC) -c -o $@ $(ADVLIB_CXXFLAGS) $(srcdir)/src/generic/bmpcboxg.cpp @@ -38191,6 +38226,9 @@ xrcdll_version_rc.o: $(srcdir)/src/msw/version.rc $(XRCDLL_ODEP) xrcdll_xh_animatctrl.o: $(srcdir)/src/xrc/xh_animatctrl.cpp $(XRCDLL_ODEP) $(CXXC) -c -o $@ $(XRCDLL_CXXFLAGS) $(srcdir)/src/xrc/xh_animatctrl.cpp +xrcdll_xh_bannerwindow.o: $(srcdir)/src/xrc/xh_bannerwindow.cpp $(XRCDLL_ODEP) + $(CXXC) -c -o $@ $(XRCDLL_CXXFLAGS) $(srcdir)/src/xrc/xh_bannerwindow.cpp + xrcdll_xh_bmp.o: $(srcdir)/src/xrc/xh_bmp.cpp $(XRCDLL_ODEP) $(CXXC) -c -o $@ $(XRCDLL_CXXFLAGS) $(srcdir)/src/xrc/xh_bmp.cpp @@ -38380,6 +38418,9 @@ xrcdll_xmlrsall.o: $(srcdir)/src/xrc/xmlrsall.cpp $(XRCDLL_ODEP) xrclib_xh_animatctrl.o: $(srcdir)/src/xrc/xh_animatctrl.cpp $(XRCLIB_ODEP) $(CXXC) -c -o $@ $(XRCLIB_CXXFLAGS) $(srcdir)/src/xrc/xh_animatctrl.cpp +xrclib_xh_bannerwindow.o: $(srcdir)/src/xrc/xh_bannerwindow.cpp $(XRCLIB_ODEP) + $(CXXC) -c -o $@ $(XRCLIB_CXXFLAGS) $(srcdir)/src/xrc/xh_bannerwindow.cpp + xrclib_xh_bmp.o: $(srcdir)/src/xrc/xh_bmp.cpp $(XRCLIB_ODEP) $(CXXC) -c -o $@ $(XRCLIB_CXXFLAGS) $(srcdir)/src/xrc/xh_bmp.cpp diff --git a/build/bakefiles/files.bkl b/build/bakefiles/files.bkl index c88c465a8c..4ceadd0f51 100644 --- a/build/bakefiles/files.bkl +++ b/build/bakefiles/files.bkl @@ -879,6 +879,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! wx/helphtml.h wx/icon.h wx/infobar.h + wx/itemid.h wx/layout.h wx/listbox.h wx/mdi.h @@ -920,6 +921,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! wx/valnum.h wx/window.h wx/windowid.h + wx/withimages.h wx/wrapsizer.h wx/wupdlock.h @@ -3138,6 +3140,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! src/common/hyperlnkcmn.cpp src/common/odcombocmn.cpp src/generic/aboutdlgg.cpp + src/generic/bannerwindow.cpp src/generic/bmpcboxg.cpp src/generic/calctrlg.cpp src/generic/commandlinkbuttong.cpp @@ -3163,6 +3166,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! wx/aboutdlg.h wx/animate.h + wx/bannerwindow.h wx/bmpcbox.h wx/calctrl.h wx/commandlinkbutton.h @@ -3540,6 +3544,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! src/xrc/xh_animatctrl.cpp + src/xrc/xh_bannerwindow.cpp src/xrc/xh_bmp.cpp src/xrc/xh_bmpcbox.cpp src/xrc/xh_bmpbt.cpp @@ -3608,6 +3613,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! wx/xrc/xh_all.h wx/xrc/xh_animatctrl.h + wx/xrc/xh_bannerwindow.h wx/xrc/xh_bmpbt.h wx/xrc/xh_bmp.h wx/xrc/xh_bmpcbox.h diff --git a/build/msw/makefile.bcc b/build/msw/makefile.bcc index 5dd84848d0..e2c36e71ff 100644 --- a/build/msw/makefile.bcc +++ b/build/msw/makefile.bcc @@ -1136,6 +1136,7 @@ XRCDLL_CXXFLAGS = $(__RUNTIME_LIBS) -I$(BCCDIR)\include $(__DEBUGINFO) \ XRCDLL_OBJECTS = \ $(OBJS)\xrcdll_dummy.obj \ $(OBJS)\xrcdll_xh_animatctrl.obj \ + $(OBJS)\xrcdll_xh_bannerwindow.obj \ $(OBJS)\xrcdll_xh_bmp.obj \ $(OBJS)\xrcdll_xh_bmpcbox.obj \ $(OBJS)\xrcdll_xh_bmpbt.obj \ @@ -1210,6 +1211,7 @@ XRCLIB_CXXFLAGS = $(__RUNTIME_LIBS) -I$(BCCDIR)\include $(__DEBUGINFO) \ XRCLIB_OBJECTS = \ $(OBJS)\xrclib_dummy.obj \ $(OBJS)\xrclib_xh_animatctrl.obj \ + $(OBJS)\xrclib_xh_bannerwindow.obj \ $(OBJS)\xrclib_xh_bmp.obj \ $(OBJS)\xrclib_xh_bmpcbox.obj \ $(OBJS)\xrclib_xh_bmpbt.obj \ @@ -1578,6 +1580,7 @@ ____MONOLIB_GUI_SRC_FILENAMES_OBJECTS = \ $(OBJS)\monodll_debugrpt.obj \ $(OBJS)\monodll_dbgrptg.obj \ $(OBJS)\monodll_xh_animatctrl.obj \ + $(OBJS)\monodll_xh_bannerwindow.obj \ $(OBJS)\monodll_xh_bmp.obj \ $(OBJS)\monodll_xh_bmpcbox.obj \ $(OBJS)\monodll_xh_bmpbt.obj \ @@ -2226,6 +2229,7 @@ ____ADVANCED_SRC_FILENAMES_OBJECTS = \ $(OBJS)\monodll_hyperlnkcmn.obj \ $(OBJS)\monodll_odcombocmn.obj \ $(OBJS)\monodll_aboutdlgg.obj \ + $(OBJS)\monodll_bannerwindow.obj \ $(OBJS)\monodll_bmpcboxg.obj \ $(OBJS)\monodll_calctrlg.obj \ $(OBJS)\monodll_commandlinkbuttong.obj \ @@ -2270,6 +2274,7 @@ ____ADVANCED_SRC_FILENAMES_OBJECTS = \ $(OBJS)\monodll_hyperlnkcmn.obj \ $(OBJS)\monodll_odcombocmn.obj \ $(OBJS)\monodll_aboutdlgg.obj \ + $(OBJS)\monodll_bannerwindow.obj \ $(OBJS)\monodll_bmpcboxg.obj \ $(OBJS)\monodll_calctrlg.obj \ $(OBJS)\monodll_commandlinkbuttong.obj \ @@ -2342,6 +2347,7 @@ ____MONOLIB_GUI_SRC_FILENAMES_1_OBJECTS = \ $(OBJS)\monolib_debugrpt.obj \ $(OBJS)\monolib_dbgrptg.obj \ $(OBJS)\monolib_xh_animatctrl.obj \ + $(OBJS)\monolib_xh_bannerwindow.obj \ $(OBJS)\monolib_xh_bmp.obj \ $(OBJS)\monolib_xh_bmpcbox.obj \ $(OBJS)\monolib_xh_bmpbt.obj \ @@ -2990,6 +2996,7 @@ ____ADVANCED_SRC_FILENAMES_1_OBJECTS = \ $(OBJS)\monolib_hyperlnkcmn.obj \ $(OBJS)\monolib_odcombocmn.obj \ $(OBJS)\monolib_aboutdlgg.obj \ + $(OBJS)\monolib_bannerwindow.obj \ $(OBJS)\monolib_bmpcboxg.obj \ $(OBJS)\monolib_calctrlg.obj \ $(OBJS)\monolib_commandlinkbuttong.obj \ @@ -3034,6 +3041,7 @@ ____ADVANCED_SRC_FILENAMES_1_OBJECTS = \ $(OBJS)\monolib_hyperlnkcmn.obj \ $(OBJS)\monolib_odcombocmn.obj \ $(OBJS)\monolib_aboutdlgg.obj \ + $(OBJS)\monolib_bannerwindow.obj \ $(OBJS)\monolib_bmpcboxg.obj \ $(OBJS)\monolib_calctrlg.obj \ $(OBJS)\monolib_commandlinkbuttong.obj \ @@ -4194,6 +4202,7 @@ ____ADVANCED_SRC_FILENAMES_2_OBJECTS = \ $(OBJS)\advdll_hyperlnkcmn.obj \ $(OBJS)\advdll_odcombocmn.obj \ $(OBJS)\advdll_aboutdlgg.obj \ + $(OBJS)\advdll_bannerwindow.obj \ $(OBJS)\advdll_bmpcboxg.obj \ $(OBJS)\advdll_calctrlg.obj \ $(OBJS)\advdll_commandlinkbuttong.obj \ @@ -4238,6 +4247,7 @@ ____ADVANCED_SRC_FILENAMES_2_OBJECTS = \ $(OBJS)\advdll_hyperlnkcmn.obj \ $(OBJS)\advdll_odcombocmn.obj \ $(OBJS)\advdll_aboutdlgg.obj \ + $(OBJS)\advdll_bannerwindow.obj \ $(OBJS)\advdll_bmpcboxg.obj \ $(OBJS)\advdll_calctrlg.obj \ $(OBJS)\advdll_commandlinkbuttong.obj \ @@ -4280,6 +4290,7 @@ ____ADVANCED_SRC_FILENAMES_3_OBJECTS = \ $(OBJS)\advlib_hyperlnkcmn.obj \ $(OBJS)\advlib_odcombocmn.obj \ $(OBJS)\advlib_aboutdlgg.obj \ + $(OBJS)\advlib_bannerwindow.obj \ $(OBJS)\advlib_bmpcboxg.obj \ $(OBJS)\advlib_calctrlg.obj \ $(OBJS)\advlib_commandlinkbuttong.obj \ @@ -4324,6 +4335,7 @@ ____ADVANCED_SRC_FILENAMES_3_OBJECTS = \ $(OBJS)\advlib_hyperlnkcmn.obj \ $(OBJS)\advlib_odcombocmn.obj \ $(OBJS)\advlib_aboutdlgg.obj \ + $(OBJS)\advlib_bannerwindow.obj \ $(OBJS)\advlib_bmpcboxg.obj \ $(OBJS)\advlib_calctrlg.obj \ $(OBJS)\advlib_commandlinkbuttong.obj \ @@ -6698,6 +6710,9 @@ $(OBJS)\monodll_dbgrptg.obj: ..\..\src\generic\dbgrptg.cpp $(OBJS)\monodll_xh_animatctrl.obj: ..\..\src\xrc\xh_animatctrl.cpp $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) ..\..\src\xrc\xh_animatctrl.cpp +$(OBJS)\monodll_xh_bannerwindow.obj: ..\..\src\xrc\xh_bannerwindow.cpp + $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) ..\..\src\xrc\xh_bannerwindow.cpp + $(OBJS)\monodll_xh_bmp.obj: ..\..\src\xrc\xh_bmp.cpp $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) ..\..\src\xrc\xh_bmp.cpp @@ -8116,6 +8131,11 @@ $(OBJS)\monodll_aboutdlgg.obj: ..\..\src\generic\aboutdlgg.cpp $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) ..\..\src\generic\aboutdlgg.cpp !endif +!if "$(USE_GUI)" == "1" +$(OBJS)\monodll_bannerwindow.obj: ..\..\src\generic\bannerwindow.cpp + $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) ..\..\src\generic\bannerwindow.cpp +!endif + !if "$(USE_GUI)" == "1" $(OBJS)\monodll_bmpcboxg.obj: ..\..\src\generic\bmpcboxg.cpp $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) ..\..\src\generic\bmpcboxg.cpp @@ -9049,6 +9069,9 @@ $(OBJS)\monolib_dbgrptg.obj: ..\..\src\generic\dbgrptg.cpp $(OBJS)\monolib_xh_animatctrl.obj: ..\..\src\xrc\xh_animatctrl.cpp $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) ..\..\src\xrc\xh_animatctrl.cpp +$(OBJS)\monolib_xh_bannerwindow.obj: ..\..\src\xrc\xh_bannerwindow.cpp + $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) ..\..\src\xrc\xh_bannerwindow.cpp + $(OBJS)\monolib_xh_bmp.obj: ..\..\src\xrc\xh_bmp.cpp $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) ..\..\src\xrc\xh_bmp.cpp @@ -10467,6 +10490,11 @@ $(OBJS)\monolib_aboutdlgg.obj: ..\..\src\generic\aboutdlgg.cpp $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) ..\..\src\generic\aboutdlgg.cpp !endif +!if "$(USE_GUI)" == "1" +$(OBJS)\monolib_bannerwindow.obj: ..\..\src\generic\bannerwindow.cpp + $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) ..\..\src\generic\bannerwindow.cpp +!endif + !if "$(USE_GUI)" == "1" $(OBJS)\monolib_bmpcboxg.obj: ..\..\src\generic\bmpcboxg.cpp $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) ..\..\src\generic\bmpcboxg.cpp @@ -14225,6 +14253,9 @@ $(OBJS)\advdll_odcombocmn.obj: ..\..\src\common\odcombocmn.cpp $(OBJS)\advdll_aboutdlgg.obj: ..\..\src\generic\aboutdlgg.cpp $(CXX) -q -c -P -o$@ $(ADVDLL_CXXFLAGS) ..\..\src\generic\aboutdlgg.cpp +$(OBJS)\advdll_bannerwindow.obj: ..\..\src\generic\bannerwindow.cpp + $(CXX) -q -c -P -o$@ $(ADVDLL_CXXFLAGS) ..\..\src\generic\bannerwindow.cpp + $(OBJS)\advdll_bmpcboxg.obj: ..\..\src\generic\bmpcboxg.cpp $(CXX) -q -c -P -o$@ $(ADVDLL_CXXFLAGS) ..\..\src\generic\bmpcboxg.cpp @@ -14351,6 +14382,9 @@ $(OBJS)\advlib_odcombocmn.obj: ..\..\src\common\odcombocmn.cpp $(OBJS)\advlib_aboutdlgg.obj: ..\..\src\generic\aboutdlgg.cpp $(CXX) -q -c -P -o$@ $(ADVLIB_CXXFLAGS) ..\..\src\generic\aboutdlgg.cpp +$(OBJS)\advlib_bannerwindow.obj: ..\..\src\generic\bannerwindow.cpp + $(CXX) -q -c -P -o$@ $(ADVLIB_CXXFLAGS) ..\..\src\generic\bannerwindow.cpp + $(OBJS)\advlib_bmpcboxg.obj: ..\..\src\generic\bmpcboxg.cpp $(CXX) -q -c -P -o$@ $(ADVLIB_CXXFLAGS) ..\..\src\generic\bmpcboxg.cpp @@ -14681,6 +14715,9 @@ $(OBJS)\xrcdll_version.res: ..\..\src\msw\version.rc $(OBJS)\xrcdll_xh_animatctrl.obj: ..\..\src\xrc\xh_animatctrl.cpp $(CXX) -q -c -P -o$@ $(XRCDLL_CXXFLAGS) ..\..\src\xrc\xh_animatctrl.cpp +$(OBJS)\xrcdll_xh_bannerwindow.obj: ..\..\src\xrc\xh_bannerwindow.cpp + $(CXX) -q -c -P -o$@ $(XRCDLL_CXXFLAGS) ..\..\src\xrc\xh_bannerwindow.cpp + $(OBJS)\xrcdll_xh_bmp.obj: ..\..\src\xrc\xh_bmp.cpp $(CXX) -q -c -P -o$@ $(XRCDLL_CXXFLAGS) ..\..\src\xrc\xh_bmp.cpp @@ -14873,6 +14910,9 @@ $(OBJS)\xrclib_dummy.obj: ..\..\src\common\dummy.cpp $(OBJS)\xrclib_xh_animatctrl.obj: ..\..\src\xrc\xh_animatctrl.cpp $(CXX) -q -c -P -o$@ $(XRCLIB_CXXFLAGS) ..\..\src\xrc\xh_animatctrl.cpp +$(OBJS)\xrclib_xh_bannerwindow.obj: ..\..\src\xrc\xh_bannerwindow.cpp + $(CXX) -q -c -P -o$@ $(XRCLIB_CXXFLAGS) ..\..\src\xrc\xh_bannerwindow.cpp + $(OBJS)\xrclib_xh_bmp.obj: ..\..\src\xrc\xh_bmp.cpp $(CXX) -q -c -P -o$@ $(XRCLIB_CXXFLAGS) ..\..\src\xrc\xh_bmp.cpp diff --git a/build/msw/makefile.gcc b/build/msw/makefile.gcc index 7b65f91e43..9eeb616487 100644 --- a/build/msw/makefile.gcc +++ b/build/msw/makefile.gcc @@ -1134,6 +1134,7 @@ XRCDLL_OBJECTS = \ $(OBJS)\xrcdll_dummy.o \ $(OBJS)\xrcdll_version_rc.o \ $(OBJS)\xrcdll_xh_animatctrl.o \ + $(OBJS)\xrcdll_xh_bannerwindow.o \ $(OBJS)\xrcdll_xh_bmp.o \ $(OBJS)\xrcdll_xh_bmpcbox.o \ $(OBJS)\xrcdll_xh_bmpbt.o \ @@ -1207,6 +1208,7 @@ XRCLIB_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZEFLAG) $(__THREADSFLAG) $(GCCFLAGS) XRCLIB_OBJECTS = \ $(OBJS)\xrclib_dummy.o \ $(OBJS)\xrclib_xh_animatctrl.o \ + $(OBJS)\xrclib_xh_bannerwindow.o \ $(OBJS)\xrclib_xh_bmp.o \ $(OBJS)\xrclib_xh_bmpcbox.o \ $(OBJS)\xrclib_xh_bmpbt.o \ @@ -1588,6 +1590,7 @@ ____MONOLIB_GUI_SRC_FILENAMES_OBJECTS = \ $(OBJS)\monodll_debugrpt.o \ $(OBJS)\monodll_dbgrptg.o \ $(OBJS)\monodll_xh_animatctrl.o \ + $(OBJS)\monodll_xh_bannerwindow.o \ $(OBJS)\monodll_xh_bmp.o \ $(OBJS)\monodll_xh_bmpcbox.o \ $(OBJS)\monodll_xh_bmpbt.o \ @@ -2240,6 +2243,7 @@ ____ADVANCED_SRC_FILENAMES_OBJECTS = \ $(OBJS)\monodll_hyperlnkcmn.o \ $(OBJS)\monodll_odcombocmn.o \ $(OBJS)\monodll_aboutdlgg.o \ + $(OBJS)\monodll_bannerwindow.o \ $(OBJS)\monodll_bmpcboxg.o \ $(OBJS)\monodll_calctrlg.o \ $(OBJS)\monodll_commandlinkbuttong.o \ @@ -2284,6 +2288,7 @@ ____ADVANCED_SRC_FILENAMES_OBJECTS = \ $(OBJS)\monodll_hyperlnkcmn.o \ $(OBJS)\monodll_odcombocmn.o \ $(OBJS)\monodll_aboutdlgg.o \ + $(OBJS)\monodll_bannerwindow.o \ $(OBJS)\monodll_bmpcboxg.o \ $(OBJS)\monodll_calctrlg.o \ $(OBJS)\monodll_commandlinkbuttong.o \ @@ -2358,6 +2363,7 @@ ____MONOLIB_GUI_SRC_FILENAMES_1_OBJECTS = \ $(OBJS)\monolib_debugrpt.o \ $(OBJS)\monolib_dbgrptg.o \ $(OBJS)\monolib_xh_animatctrl.o \ + $(OBJS)\monolib_xh_bannerwindow.o \ $(OBJS)\monolib_xh_bmp.o \ $(OBJS)\monolib_xh_bmpcbox.o \ $(OBJS)\monolib_xh_bmpbt.o \ @@ -3010,6 +3016,7 @@ ____ADVANCED_SRC_FILENAMES_1_OBJECTS = \ $(OBJS)\monolib_hyperlnkcmn.o \ $(OBJS)\monolib_odcombocmn.o \ $(OBJS)\monolib_aboutdlgg.o \ + $(OBJS)\monolib_bannerwindow.o \ $(OBJS)\monolib_bmpcboxg.o \ $(OBJS)\monolib_calctrlg.o \ $(OBJS)\monolib_commandlinkbuttong.o \ @@ -3054,6 +3061,7 @@ ____ADVANCED_SRC_FILENAMES_1_OBJECTS = \ $(OBJS)\monolib_hyperlnkcmn.o \ $(OBJS)\monolib_odcombocmn.o \ $(OBJS)\monolib_aboutdlgg.o \ + $(OBJS)\monolib_bannerwindow.o \ $(OBJS)\monolib_bmpcboxg.o \ $(OBJS)\monolib_calctrlg.o \ $(OBJS)\monolib_commandlinkbuttong.o \ @@ -4242,6 +4250,7 @@ ____ADVANCED_SRC_FILENAMES_2_OBJECTS = \ $(OBJS)\advdll_hyperlnkcmn.o \ $(OBJS)\advdll_odcombocmn.o \ $(OBJS)\advdll_aboutdlgg.o \ + $(OBJS)\advdll_bannerwindow.o \ $(OBJS)\advdll_bmpcboxg.o \ $(OBJS)\advdll_calctrlg.o \ $(OBJS)\advdll_commandlinkbuttong.o \ @@ -4286,6 +4295,7 @@ ____ADVANCED_SRC_FILENAMES_2_OBJECTS = \ $(OBJS)\advdll_hyperlnkcmn.o \ $(OBJS)\advdll_odcombocmn.o \ $(OBJS)\advdll_aboutdlgg.o \ + $(OBJS)\advdll_bannerwindow.o \ $(OBJS)\advdll_bmpcboxg.o \ $(OBJS)\advdll_calctrlg.o \ $(OBJS)\advdll_commandlinkbuttong.o \ @@ -4332,6 +4342,7 @@ ____ADVANCED_SRC_FILENAMES_3_OBJECTS = \ $(OBJS)\advlib_hyperlnkcmn.o \ $(OBJS)\advlib_odcombocmn.o \ $(OBJS)\advlib_aboutdlgg.o \ + $(OBJS)\advlib_bannerwindow.o \ $(OBJS)\advlib_bmpcboxg.o \ $(OBJS)\advlib_calctrlg.o \ $(OBJS)\advlib_commandlinkbuttong.o \ @@ -4376,6 +4387,7 @@ ____ADVANCED_SRC_FILENAMES_3_OBJECTS = \ $(OBJS)\advlib_hyperlnkcmn.o \ $(OBJS)\advlib_odcombocmn.o \ $(OBJS)\advlib_aboutdlgg.o \ + $(OBJS)\advlib_bannerwindow.o \ $(OBJS)\advlib_bmpcboxg.o \ $(OBJS)\advlib_calctrlg.o \ $(OBJS)\advlib_commandlinkbuttong.o \ @@ -6848,6 +6860,9 @@ $(OBJS)\monodll_dbgrptg.o: ../../src/generic/dbgrptg.cpp $(OBJS)\monodll_xh_animatctrl.o: ../../src/xrc/xh_animatctrl.cpp $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\monodll_xh_bannerwindow.o: ../../src/xrc/xh_bannerwindow.cpp + $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\monodll_xh_bmp.o: ../../src/xrc/xh_bmp.cpp $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $< @@ -8266,6 +8281,11 @@ $(OBJS)\monodll_aboutdlgg.o: ../../src/generic/aboutdlgg.cpp $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $< endif +ifeq ($(USE_GUI),1) +$(OBJS)\monodll_bannerwindow.o: ../../src/generic/bannerwindow.cpp + $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $< +endif + ifeq ($(USE_GUI),1) $(OBJS)\monodll_bmpcboxg.o: ../../src/generic/bmpcboxg.cpp $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $< @@ -9199,6 +9219,9 @@ $(OBJS)\monolib_dbgrptg.o: ../../src/generic/dbgrptg.cpp $(OBJS)\monolib_xh_animatctrl.o: ../../src/xrc/xh_animatctrl.cpp $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\monolib_xh_bannerwindow.o: ../../src/xrc/xh_bannerwindow.cpp + $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\monolib_xh_bmp.o: ../../src/xrc/xh_bmp.cpp $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $< @@ -10617,6 +10640,11 @@ $(OBJS)\monolib_aboutdlgg.o: ../../src/generic/aboutdlgg.cpp $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $< endif +ifeq ($(USE_GUI),1) +$(OBJS)\monolib_bannerwindow.o: ../../src/generic/bannerwindow.cpp + $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $< +endif + ifeq ($(USE_GUI),1) $(OBJS)\monolib_bmpcboxg.o: ../../src/generic/bmpcboxg.cpp $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $< @@ -14375,6 +14403,9 @@ $(OBJS)\advdll_odcombocmn.o: ../../src/common/odcombocmn.cpp $(OBJS)\advdll_aboutdlgg.o: ../../src/generic/aboutdlgg.cpp $(CXX) -c -o $@ $(ADVDLL_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\advdll_bannerwindow.o: ../../src/generic/bannerwindow.cpp + $(CXX) -c -o $@ $(ADVDLL_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\advdll_bmpcboxg.o: ../../src/generic/bmpcboxg.cpp $(CXX) -c -o $@ $(ADVDLL_CXXFLAGS) $(CPPDEPS) $< @@ -14501,6 +14532,9 @@ $(OBJS)\advlib_odcombocmn.o: ../../src/common/odcombocmn.cpp $(OBJS)\advlib_aboutdlgg.o: ../../src/generic/aboutdlgg.cpp $(CXX) -c -o $@ $(ADVLIB_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\advlib_bannerwindow.o: ../../src/generic/bannerwindow.cpp + $(CXX) -c -o $@ $(ADVLIB_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\advlib_bmpcboxg.o: ../../src/generic/bmpcboxg.cpp $(CXX) -c -o $@ $(ADVLIB_CXXFLAGS) $(CPPDEPS) $< @@ -14831,6 +14865,9 @@ $(OBJS)\xrcdll_version_rc.o: ../../src/msw/version.rc $(OBJS)\xrcdll_xh_animatctrl.o: ../../src/xrc/xh_animatctrl.cpp $(CXX) -c -o $@ $(XRCDLL_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\xrcdll_xh_bannerwindow.o: ../../src/xrc/xh_bannerwindow.cpp + $(CXX) -c -o $@ $(XRCDLL_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\xrcdll_xh_bmp.o: ../../src/xrc/xh_bmp.cpp $(CXX) -c -o $@ $(XRCDLL_CXXFLAGS) $(CPPDEPS) $< @@ -15023,6 +15060,9 @@ $(OBJS)\xrclib_dummy.o: ../../src/common/dummy.cpp $(OBJS)\xrclib_xh_animatctrl.o: ../../src/xrc/xh_animatctrl.cpp $(CXX) -c -o $@ $(XRCLIB_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\xrclib_xh_bannerwindow.o: ../../src/xrc/xh_bannerwindow.cpp + $(CXX) -c -o $@ $(XRCLIB_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\xrclib_xh_bmp.o: ../../src/xrc/xh_bmp.cpp $(CXX) -c -o $@ $(XRCLIB_CXXFLAGS) $(CPPDEPS) $< diff --git a/build/msw/makefile.vc b/build/msw/makefile.vc index fea35eea34..9d70915657 100644 --- a/build/msw/makefile.vc +++ b/build/msw/makefile.vc @@ -1211,6 +1211,7 @@ XRCDLL_CXXFLAGS = /M$(__RUNTIME_LIBS_395)$(__DEBUGRUNTIME) /DWIN32 \ XRCDLL_OBJECTS = \ $(OBJS)\xrcdll_dummy.obj \ $(OBJS)\xrcdll_xh_animatctrl.obj \ + $(OBJS)\xrcdll_xh_bannerwindow.obj \ $(OBJS)\xrcdll_xh_bmp.obj \ $(OBJS)\xrcdll_xh_bmpcbox.obj \ $(OBJS)\xrcdll_xh_bmpbt.obj \ @@ -1289,6 +1290,7 @@ XRCLIB_CXXFLAGS = /M$(__RUNTIME_LIBS_410)$(__DEBUGRUNTIME) /DWIN32 \ XRCLIB_OBJECTS = \ $(OBJS)\xrclib_dummy.obj \ $(OBJS)\xrclib_xh_animatctrl.obj \ + $(OBJS)\xrclib_xh_bannerwindow.obj \ $(OBJS)\xrclib_xh_bmp.obj \ $(OBJS)\xrclib_xh_bmpcbox.obj \ $(OBJS)\xrclib_xh_bmpbt.obj \ @@ -1786,6 +1788,7 @@ ____MONOLIB_GUI_SRC_FILENAMES_OBJECTS = \ $(OBJS)\monodll_debugrpt.obj \ $(OBJS)\monodll_dbgrptg.obj \ $(OBJS)\monodll_xh_animatctrl.obj \ + $(OBJS)\monodll_xh_bannerwindow.obj \ $(OBJS)\monodll_xh_bmp.obj \ $(OBJS)\monodll_xh_bmpcbox.obj \ $(OBJS)\monodll_xh_bmpbt.obj \ @@ -2434,6 +2437,7 @@ ____ADVANCED_SRC_FILENAMES_OBJECTS = \ $(OBJS)\monodll_hyperlnkcmn.obj \ $(OBJS)\monodll_odcombocmn.obj \ $(OBJS)\monodll_aboutdlgg.obj \ + $(OBJS)\monodll_bannerwindow.obj \ $(OBJS)\monodll_bmpcboxg.obj \ $(OBJS)\monodll_calctrlg.obj \ $(OBJS)\monodll_commandlinkbuttong.obj \ @@ -2478,6 +2482,7 @@ ____ADVANCED_SRC_FILENAMES_OBJECTS = \ $(OBJS)\monodll_hyperlnkcmn.obj \ $(OBJS)\monodll_odcombocmn.obj \ $(OBJS)\monodll_aboutdlgg.obj \ + $(OBJS)\monodll_bannerwindow.obj \ $(OBJS)\monodll_bmpcboxg.obj \ $(OBJS)\monodll_calctrlg.obj \ $(OBJS)\monodll_commandlinkbuttong.obj \ @@ -2556,6 +2561,7 @@ ____MONOLIB_GUI_SRC_FILENAMES_1_OBJECTS = \ $(OBJS)\monolib_debugrpt.obj \ $(OBJS)\monolib_dbgrptg.obj \ $(OBJS)\monolib_xh_animatctrl.obj \ + $(OBJS)\monolib_xh_bannerwindow.obj \ $(OBJS)\monolib_xh_bmp.obj \ $(OBJS)\monolib_xh_bmpcbox.obj \ $(OBJS)\monolib_xh_bmpbt.obj \ @@ -3204,6 +3210,7 @@ ____ADVANCED_SRC_FILENAMES_1_OBJECTS = \ $(OBJS)\monolib_hyperlnkcmn.obj \ $(OBJS)\monolib_odcombocmn.obj \ $(OBJS)\monolib_aboutdlgg.obj \ + $(OBJS)\monolib_bannerwindow.obj \ $(OBJS)\monolib_bmpcboxg.obj \ $(OBJS)\monolib_calctrlg.obj \ $(OBJS)\monolib_commandlinkbuttong.obj \ @@ -3248,6 +3255,7 @@ ____ADVANCED_SRC_FILENAMES_1_OBJECTS = \ $(OBJS)\monolib_hyperlnkcmn.obj \ $(OBJS)\monolib_odcombocmn.obj \ $(OBJS)\monolib_aboutdlgg.obj \ + $(OBJS)\monolib_bannerwindow.obj \ $(OBJS)\monolib_bmpcboxg.obj \ $(OBJS)\monolib_calctrlg.obj \ $(OBJS)\monolib_commandlinkbuttong.obj \ @@ -4498,6 +4506,7 @@ ____ADVANCED_SRC_FILENAMES_2_OBJECTS = \ $(OBJS)\advdll_hyperlnkcmn.obj \ $(OBJS)\advdll_odcombocmn.obj \ $(OBJS)\advdll_aboutdlgg.obj \ + $(OBJS)\advdll_bannerwindow.obj \ $(OBJS)\advdll_bmpcboxg.obj \ $(OBJS)\advdll_calctrlg.obj \ $(OBJS)\advdll_commandlinkbuttong.obj \ @@ -4542,6 +4551,7 @@ ____ADVANCED_SRC_FILENAMES_2_OBJECTS = \ $(OBJS)\advdll_hyperlnkcmn.obj \ $(OBJS)\advdll_odcombocmn.obj \ $(OBJS)\advdll_aboutdlgg.obj \ + $(OBJS)\advdll_bannerwindow.obj \ $(OBJS)\advdll_bmpcboxg.obj \ $(OBJS)\advdll_calctrlg.obj \ $(OBJS)\advdll_commandlinkbuttong.obj \ @@ -4590,6 +4600,7 @@ ____ADVANCED_SRC_FILENAMES_3_OBJECTS = \ $(OBJS)\advlib_hyperlnkcmn.obj \ $(OBJS)\advlib_odcombocmn.obj \ $(OBJS)\advlib_aboutdlgg.obj \ + $(OBJS)\advlib_bannerwindow.obj \ $(OBJS)\advlib_bmpcboxg.obj \ $(OBJS)\advlib_calctrlg.obj \ $(OBJS)\advlib_commandlinkbuttong.obj \ @@ -4634,6 +4645,7 @@ ____ADVANCED_SRC_FILENAMES_3_OBJECTS = \ $(OBJS)\advlib_hyperlnkcmn.obj \ $(OBJS)\advlib_odcombocmn.obj \ $(OBJS)\advlib_aboutdlgg.obj \ + $(OBJS)\advlib_bannerwindow.obj \ $(OBJS)\advlib_bmpcboxg.obj \ $(OBJS)\advlib_calctrlg.obj \ $(OBJS)\advlib_commandlinkbuttong.obj \ @@ -7278,6 +7290,9 @@ $(OBJS)\monodll_dbgrptg.obj: ..\..\src\generic\dbgrptg.cpp $(OBJS)\monodll_xh_animatctrl.obj: ..\..\src\xrc\xh_animatctrl.cpp $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\xrc\xh_animatctrl.cpp +$(OBJS)\monodll_xh_bannerwindow.obj: ..\..\src\xrc\xh_bannerwindow.cpp + $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\xrc\xh_bannerwindow.cpp + $(OBJS)\monodll_xh_bmp.obj: ..\..\src\xrc\xh_bmp.cpp $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\xrc\xh_bmp.cpp @@ -8696,6 +8711,11 @@ $(OBJS)\monodll_aboutdlgg.obj: ..\..\src\generic\aboutdlgg.cpp $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\generic\aboutdlgg.cpp !endif +!if "$(USE_GUI)" == "1" +$(OBJS)\monodll_bannerwindow.obj: ..\..\src\generic\bannerwindow.cpp + $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\generic\bannerwindow.cpp +!endif + !if "$(USE_GUI)" == "1" $(OBJS)\monodll_bmpcboxg.obj: ..\..\src\generic\bmpcboxg.cpp $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\generic\bmpcboxg.cpp @@ -9629,6 +9649,9 @@ $(OBJS)\monolib_dbgrptg.obj: ..\..\src\generic\dbgrptg.cpp $(OBJS)\monolib_xh_animatctrl.obj: ..\..\src\xrc\xh_animatctrl.cpp $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\xrc\xh_animatctrl.cpp +$(OBJS)\monolib_xh_bannerwindow.obj: ..\..\src\xrc\xh_bannerwindow.cpp + $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\xrc\xh_bannerwindow.cpp + $(OBJS)\monolib_xh_bmp.obj: ..\..\src\xrc\xh_bmp.cpp $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\xrc\xh_bmp.cpp @@ -11047,6 +11070,11 @@ $(OBJS)\monolib_aboutdlgg.obj: ..\..\src\generic\aboutdlgg.cpp $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\generic\aboutdlgg.cpp !endif +!if "$(USE_GUI)" == "1" +$(OBJS)\monolib_bannerwindow.obj: ..\..\src\generic\bannerwindow.cpp + $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\generic\bannerwindow.cpp +!endif + !if "$(USE_GUI)" == "1" $(OBJS)\monolib_bmpcboxg.obj: ..\..\src\generic\bmpcboxg.cpp $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\generic\bmpcboxg.cpp @@ -14805,6 +14833,9 @@ $(OBJS)\advdll_odcombocmn.obj: ..\..\src\common\odcombocmn.cpp $(OBJS)\advdll_aboutdlgg.obj: ..\..\src\generic\aboutdlgg.cpp $(CXX) /c /nologo /TP /Fo$@ $(ADVDLL_CXXFLAGS) ..\..\src\generic\aboutdlgg.cpp +$(OBJS)\advdll_bannerwindow.obj: ..\..\src\generic\bannerwindow.cpp + $(CXX) /c /nologo /TP /Fo$@ $(ADVDLL_CXXFLAGS) ..\..\src\generic\bannerwindow.cpp + $(OBJS)\advdll_bmpcboxg.obj: ..\..\src\generic\bmpcboxg.cpp $(CXX) /c /nologo /TP /Fo$@ $(ADVDLL_CXXFLAGS) ..\..\src\generic\bmpcboxg.cpp @@ -14931,6 +14962,9 @@ $(OBJS)\advlib_odcombocmn.obj: ..\..\src\common\odcombocmn.cpp $(OBJS)\advlib_aboutdlgg.obj: ..\..\src\generic\aboutdlgg.cpp $(CXX) /c /nologo /TP /Fo$@ $(ADVLIB_CXXFLAGS) ..\..\src\generic\aboutdlgg.cpp +$(OBJS)\advlib_bannerwindow.obj: ..\..\src\generic\bannerwindow.cpp + $(CXX) /c /nologo /TP /Fo$@ $(ADVLIB_CXXFLAGS) ..\..\src\generic\bannerwindow.cpp + $(OBJS)\advlib_bmpcboxg.obj: ..\..\src\generic\bmpcboxg.cpp $(CXX) /c /nologo /TP /Fo$@ $(ADVLIB_CXXFLAGS) ..\..\src\generic\bmpcboxg.cpp @@ -15261,6 +15295,9 @@ $(OBJS)\xrcdll_version.res: ..\..\src\msw\version.rc $(OBJS)\xrcdll_xh_animatctrl.obj: ..\..\src\xrc\xh_animatctrl.cpp $(CXX) /c /nologo /TP /Fo$@ $(XRCDLL_CXXFLAGS) ..\..\src\xrc\xh_animatctrl.cpp +$(OBJS)\xrcdll_xh_bannerwindow.obj: ..\..\src\xrc\xh_bannerwindow.cpp + $(CXX) /c /nologo /TP /Fo$@ $(XRCDLL_CXXFLAGS) ..\..\src\xrc\xh_bannerwindow.cpp + $(OBJS)\xrcdll_xh_bmp.obj: ..\..\src\xrc\xh_bmp.cpp $(CXX) /c /nologo /TP /Fo$@ $(XRCDLL_CXXFLAGS) ..\..\src\xrc\xh_bmp.cpp @@ -15453,6 +15490,9 @@ $(OBJS)\xrclib_dummy.obj: ..\..\src\common\dummy.cpp $(OBJS)\xrclib_xh_animatctrl.obj: ..\..\src\xrc\xh_animatctrl.cpp $(CXX) /c /nologo /TP /Fo$@ $(XRCLIB_CXXFLAGS) ..\..\src\xrc\xh_animatctrl.cpp +$(OBJS)\xrclib_xh_bannerwindow.obj: ..\..\src\xrc\xh_bannerwindow.cpp + $(CXX) /c /nologo /TP /Fo$@ $(XRCLIB_CXXFLAGS) ..\..\src\xrc\xh_bannerwindow.cpp + $(OBJS)\xrclib_xh_bmp.obj: ..\..\src\xrc\xh_bmp.cpp $(CXX) /c /nologo /TP /Fo$@ $(XRCLIB_CXXFLAGS) ..\..\src\xrc\xh_bmp.cpp diff --git a/build/msw/makefile.wat b/build/msw/makefile.wat index bdaeb130e2..498b704f5c 100644 --- a/build/msw/makefile.wat +++ b/build/msw/makefile.wat @@ -138,6 +138,7 @@ ____MONOLIB_GUI_SRC_FILENAMES_OBJECTS = & $(OBJS)\monodll_debugrpt.obj & $(OBJS)\monodll_dbgrptg.obj & $(OBJS)\monodll_xh_animatctrl.obj & + $(OBJS)\monodll_xh_bannerwindow.obj & $(OBJS)\monodll_xh_bmp.obj & $(OBJS)\monodll_xh_bmpcbox.obj & $(OBJS)\monodll_xh_bmpbt.obj & @@ -792,6 +793,7 @@ ____ADVANCED_SRC_FILENAMES_OBJECTS = & $(OBJS)\monodll_hyperlnkcmn.obj & $(OBJS)\monodll_odcombocmn.obj & $(OBJS)\monodll_aboutdlgg.obj & + $(OBJS)\monodll_bannerwindow.obj & $(OBJS)\monodll_bmpcboxg.obj & $(OBJS)\monodll_calctrlg.obj & $(OBJS)\monodll_commandlinkbuttong.obj & @@ -836,6 +838,7 @@ ____ADVANCED_SRC_FILENAMES_OBJECTS = & $(OBJS)\monodll_hyperlnkcmn.obj & $(OBJS)\monodll_odcombocmn.obj & $(OBJS)\monodll_aboutdlgg.obj & + $(OBJS)\monodll_bannerwindow.obj & $(OBJS)\monodll_bmpcboxg.obj & $(OBJS)\monodll_calctrlg.obj & $(OBJS)\monodll_commandlinkbuttong.obj & @@ -913,6 +916,7 @@ ____MONOLIB_GUI_SRC_FILENAMES_1_OBJECTS = & $(OBJS)\monolib_debugrpt.obj & $(OBJS)\monolib_dbgrptg.obj & $(OBJS)\monolib_xh_animatctrl.obj & + $(OBJS)\monolib_xh_bannerwindow.obj & $(OBJS)\monolib_xh_bmp.obj & $(OBJS)\monolib_xh_bmpcbox.obj & $(OBJS)\monolib_xh_bmpbt.obj & @@ -1567,6 +1571,7 @@ ____ADVANCED_SRC_FILENAMES_1_OBJECTS = & $(OBJS)\monolib_hyperlnkcmn.obj & $(OBJS)\monolib_odcombocmn.obj & $(OBJS)\monolib_aboutdlgg.obj & + $(OBJS)\monolib_bannerwindow.obj & $(OBJS)\monolib_bmpcboxg.obj & $(OBJS)\monolib_calctrlg.obj & $(OBJS)\monolib_commandlinkbuttong.obj & @@ -1611,6 +1616,7 @@ ____ADVANCED_SRC_FILENAMES_1_OBJECTS = & $(OBJS)\monolib_hyperlnkcmn.obj & $(OBJS)\monolib_odcombocmn.obj & $(OBJS)\monolib_aboutdlgg.obj & + $(OBJS)\monolib_bannerwindow.obj & $(OBJS)\monolib_bmpcboxg.obj & $(OBJS)\monolib_calctrlg.obj & $(OBJS)\monolib_commandlinkbuttong.obj & @@ -2815,6 +2821,7 @@ ____ADVANCED_SRC_FILENAMES_2_OBJECTS = & $(OBJS)\advdll_hyperlnkcmn.obj & $(OBJS)\advdll_odcombocmn.obj & $(OBJS)\advdll_aboutdlgg.obj & + $(OBJS)\advdll_bannerwindow.obj & $(OBJS)\advdll_bmpcboxg.obj & $(OBJS)\advdll_calctrlg.obj & $(OBJS)\advdll_commandlinkbuttong.obj & @@ -2859,6 +2866,7 @@ ____ADVANCED_SRC_FILENAMES_2_OBJECTS = & $(OBJS)\advdll_hyperlnkcmn.obj & $(OBJS)\advdll_odcombocmn.obj & $(OBJS)\advdll_aboutdlgg.obj & + $(OBJS)\advdll_bannerwindow.obj & $(OBJS)\advdll_bmpcboxg.obj & $(OBJS)\advdll_calctrlg.obj & $(OBJS)\advdll_commandlinkbuttong.obj & @@ -2907,6 +2915,7 @@ ____ADVANCED_SRC_FILENAMES_3_OBJECTS = & $(OBJS)\advlib_hyperlnkcmn.obj & $(OBJS)\advlib_odcombocmn.obj & $(OBJS)\advlib_aboutdlgg.obj & + $(OBJS)\advlib_bannerwindow.obj & $(OBJS)\advlib_bmpcboxg.obj & $(OBJS)\advlib_calctrlg.obj & $(OBJS)\advlib_commandlinkbuttong.obj & @@ -2951,6 +2960,7 @@ ____ADVANCED_SRC_FILENAMES_3_OBJECTS = & $(OBJS)\advlib_hyperlnkcmn.obj & $(OBJS)\advlib_odcombocmn.obj & $(OBJS)\advlib_aboutdlgg.obj & + $(OBJS)\advlib_bannerwindow.obj & $(OBJS)\advlib_bmpcboxg.obj & $(OBJS)\advlib_calctrlg.obj & $(OBJS)\advlib_commandlinkbuttong.obj & @@ -4560,6 +4570,7 @@ XRCDLL_CXXFLAGS = -bd $(__DEBUGINFO) $(__OPTIMIZEFLAG) $(__THREADSFLAG) & XRCDLL_OBJECTS = & $(OBJS)\xrcdll_dummy.obj & $(OBJS)\xrcdll_xh_animatctrl.obj & + $(OBJS)\xrcdll_xh_bannerwindow.obj & $(OBJS)\xrcdll_xh_bmp.obj & $(OBJS)\xrcdll_xh_bmpcbox.obj & $(OBJS)\xrcdll_xh_bmpbt.obj & @@ -4634,6 +4645,7 @@ XRCLIB_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZEFLAG) $(__THREADSFLAG) & XRCLIB_OBJECTS = & $(OBJS)\xrclib_dummy.obj & $(OBJS)\xrclib_xh_animatctrl.obj & + $(OBJS)\xrclib_xh_bannerwindow.obj & $(OBJS)\xrclib_xh_bmp.obj & $(OBJS)\xrclib_xh_bmpcbox.obj & $(OBJS)\xrclib_xh_bmpbt.obj & @@ -7107,6 +7119,9 @@ $(OBJS)\monodll_dbgrptg.obj : .AUTODEPEND ..\..\src\generic\dbgrptg.cpp $(OBJS)\monodll_xh_animatctrl.obj : .AUTODEPEND ..\..\src\xrc\xh_animatctrl.cpp $(CXX) -bt=nt -zq -fo=$^@ $(MONODLL_CXXFLAGS) $< +$(OBJS)\monodll_xh_bannerwindow.obj : .AUTODEPEND ..\..\src\xrc\xh_bannerwindow.cpp + $(CXX) -bt=nt -zq -fo=$^@ $(MONODLL_CXXFLAGS) $< + $(OBJS)\monodll_xh_bmp.obj : .AUTODEPEND ..\..\src\xrc\xh_bmp.cpp $(CXX) -bt=nt -zq -fo=$^@ $(MONODLL_CXXFLAGS) $< @@ -8525,6 +8540,11 @@ $(OBJS)\monodll_aboutdlgg.obj : .AUTODEPEND ..\..\src\generic\aboutdlgg.cpp $(CXX) -bt=nt -zq -fo=$^@ $(MONODLL_CXXFLAGS) $< !endif +!ifeq USE_GUI 1 +$(OBJS)\monodll_bannerwindow.obj : .AUTODEPEND ..\..\src\generic\bannerwindow.cpp + $(CXX) -bt=nt -zq -fo=$^@ $(MONODLL_CXXFLAGS) $< +!endif + !ifeq USE_GUI 1 $(OBJS)\monodll_bmpcboxg.obj : .AUTODEPEND ..\..\src\generic\bmpcboxg.cpp $(CXX) -bt=nt -zq -fo=$^@ $(MONODLL_CXXFLAGS) $< @@ -9458,6 +9478,9 @@ $(OBJS)\monolib_dbgrptg.obj : .AUTODEPEND ..\..\src\generic\dbgrptg.cpp $(OBJS)\monolib_xh_animatctrl.obj : .AUTODEPEND ..\..\src\xrc\xh_animatctrl.cpp $(CXX) -bt=nt -zq -fo=$^@ $(MONOLIB_CXXFLAGS) $< +$(OBJS)\monolib_xh_bannerwindow.obj : .AUTODEPEND ..\..\src\xrc\xh_bannerwindow.cpp + $(CXX) -bt=nt -zq -fo=$^@ $(MONOLIB_CXXFLAGS) $< + $(OBJS)\monolib_xh_bmp.obj : .AUTODEPEND ..\..\src\xrc\xh_bmp.cpp $(CXX) -bt=nt -zq -fo=$^@ $(MONOLIB_CXXFLAGS) $< @@ -10876,6 +10899,11 @@ $(OBJS)\monolib_aboutdlgg.obj : .AUTODEPEND ..\..\src\generic\aboutdlgg.cpp $(CXX) -bt=nt -zq -fo=$^@ $(MONOLIB_CXXFLAGS) $< !endif +!ifeq USE_GUI 1 +$(OBJS)\monolib_bannerwindow.obj : .AUTODEPEND ..\..\src\generic\bannerwindow.cpp + $(CXX) -bt=nt -zq -fo=$^@ $(MONOLIB_CXXFLAGS) $< +!endif + !ifeq USE_GUI 1 $(OBJS)\monolib_bmpcboxg.obj : .AUTODEPEND ..\..\src\generic\bmpcboxg.cpp $(CXX) -bt=nt -zq -fo=$^@ $(MONOLIB_CXXFLAGS) $< @@ -14634,6 +14662,9 @@ $(OBJS)\advdll_odcombocmn.obj : .AUTODEPEND ..\..\src\common\odcombocmn.cpp $(OBJS)\advdll_aboutdlgg.obj : .AUTODEPEND ..\..\src\generic\aboutdlgg.cpp $(CXX) -bt=nt -zq -fo=$^@ $(ADVDLL_CXXFLAGS) $< +$(OBJS)\advdll_bannerwindow.obj : .AUTODEPEND ..\..\src\generic\bannerwindow.cpp + $(CXX) -bt=nt -zq -fo=$^@ $(ADVDLL_CXXFLAGS) $< + $(OBJS)\advdll_bmpcboxg.obj : .AUTODEPEND ..\..\src\generic\bmpcboxg.cpp $(CXX) -bt=nt -zq -fo=$^@ $(ADVDLL_CXXFLAGS) $< @@ -14760,6 +14791,9 @@ $(OBJS)\advlib_odcombocmn.obj : .AUTODEPEND ..\..\src\common\odcombocmn.cpp $(OBJS)\advlib_aboutdlgg.obj : .AUTODEPEND ..\..\src\generic\aboutdlgg.cpp $(CXX) -bt=nt -zq -fo=$^@ $(ADVLIB_CXXFLAGS) $< +$(OBJS)\advlib_bannerwindow.obj : .AUTODEPEND ..\..\src\generic\bannerwindow.cpp + $(CXX) -bt=nt -zq -fo=$^@ $(ADVLIB_CXXFLAGS) $< + $(OBJS)\advlib_bmpcboxg.obj : .AUTODEPEND ..\..\src\generic\bmpcboxg.cpp $(CXX) -bt=nt -zq -fo=$^@ $(ADVLIB_CXXFLAGS) $< @@ -15090,6 +15124,9 @@ $(OBJS)\xrcdll_version.res : .AUTODEPEND ..\..\src\msw\version.rc $(OBJS)\xrcdll_xh_animatctrl.obj : .AUTODEPEND ..\..\src\xrc\xh_animatctrl.cpp $(CXX) -bt=nt -zq -fo=$^@ $(XRCDLL_CXXFLAGS) $< +$(OBJS)\xrcdll_xh_bannerwindow.obj : .AUTODEPEND ..\..\src\xrc\xh_bannerwindow.cpp + $(CXX) -bt=nt -zq -fo=$^@ $(XRCDLL_CXXFLAGS) $< + $(OBJS)\xrcdll_xh_bmp.obj : .AUTODEPEND ..\..\src\xrc\xh_bmp.cpp $(CXX) -bt=nt -zq -fo=$^@ $(XRCDLL_CXXFLAGS) $< @@ -15282,6 +15319,9 @@ $(OBJS)\xrclib_dummy.obj : .AUTODEPEND ..\..\src\common\dummy.cpp $(OBJS)\xrclib_xh_animatctrl.obj : .AUTODEPEND ..\..\src\xrc\xh_animatctrl.cpp $(CXX) -bt=nt -zq -fo=$^@ $(XRCLIB_CXXFLAGS) $< +$(OBJS)\xrclib_xh_bannerwindow.obj : .AUTODEPEND ..\..\src\xrc\xh_bannerwindow.cpp + $(CXX) -bt=nt -zq -fo=$^@ $(XRCLIB_CXXFLAGS) $< + $(OBJS)\xrclib_xh_bmp.obj : .AUTODEPEND ..\..\src\xrc\xh_bmp.cpp $(CXX) -bt=nt -zq -fo=$^@ $(XRCLIB_CXXFLAGS) $< diff --git a/build/msw/wx_adv.dsp b/build/msw/wx_adv.dsp index 142a143e04..b99da08989 100644 --- a/build/msw/wx_adv.dsp +++ b/build/msw/wx_adv.dsp @@ -563,6 +563,10 @@ SOURCE=..\..\src\generic\animateg.cpp # End Source File # Begin Source File +SOURCE=..\..\src\generic\bannerwindow.cpp +# End Source File +# Begin Source File + SOURCE=..\..\src\generic\bmpcboxg.cpp # End Source File # Begin Source File @@ -1012,6 +1016,10 @@ SOURCE=..\..\include\wx\animate.h # End Source File # Begin Source File +SOURCE=..\..\include\wx\bannerwindow.h +# End Source File +# Begin Source File + SOURCE=..\..\include\wx\bmpcbox.h # End Source File # Begin Source File diff --git a/build/msw/wx_core.dsp b/build/msw/wx_core.dsp index 5b6ecf620f..c7d9c185da 100644 --- a/build/msw/wx_core.dsp +++ b/build/msw/wx_core.dsp @@ -5984,6 +5984,10 @@ SOURCE=..\..\include\wx\aui\auibook.h # End Source File # Begin Source File +SOURCE=..\..\include\wx\bannerwindow.h +# End Source File +# Begin Source File + SOURCE=..\..\include\wx\ribbon\bar.h # End Source File # Begin Source File @@ -6444,6 +6448,10 @@ SOURCE=..\..\include\wx\infobar.h # End Source File # Begin Source File +SOURCE=..\..\include\wx\itemid.h +# End Source File +# Begin Source File + SOURCE=..\..\include\wx\joystick.h # End Source File # Begin Source File @@ -6960,6 +6968,10 @@ SOURCE=..\..\include\wx\windowid.h # End Source File # Begin Source File +SOURCE=..\..\include\wx\withimages.h +# End Source File +# Begin Source File + SOURCE=..\..\include\wx\wizard.h # End Source File # Begin Source File @@ -6984,6 +6996,10 @@ SOURCE=..\..\include\wx\xrc\xh_animatctrl.h # End Source File # Begin Source File +SOURCE=..\..\include\wx\xrc\xh_bannerwindow.h +# End Source File +# Begin Source File + SOURCE=..\..\include\wx\xrc\xh_bmp.h # End Source File # Begin Source File diff --git a/build/msw/wx_vc7_adv.vcproj b/build/msw/wx_vc7_adv.vcproj index fd8c6ffbfe..54bc592f46 100644 --- a/build/msw/wx_vc7_adv.vcproj +++ b/build/msw/wx_vc7_adv.vcproj @@ -737,6 +737,9 @@ + + @@ -1067,6 +1070,9 @@ + + diff --git a/build/msw/wx_vc7_core.vcproj b/build/msw/wx_vc7_core.vcproj index 94a0489a2c..9a1afc4ac8 100644 --- a/build/msw/wx_vc7_core.vcproj +++ b/build/msw/wx_vc7_core.vcproj @@ -5063,6 +5063,9 @@ + + @@ -5408,6 +5411,9 @@ + + @@ -5795,6 +5801,9 @@ + + @@ -5813,6 +5822,9 @@ + + diff --git a/build/msw/wx_vc7_xrc.vcproj b/build/msw/wx_vc7_xrc.vcproj index 883d3a8e1c..fcf7133e0a 100644 --- a/build/msw/wx_vc7_xrc.vcproj +++ b/build/msw/wx_vc7_xrc.vcproj @@ -777,6 +777,9 @@ + + @@ -965,6 +968,9 @@ + + diff --git a/build/msw/wx_vc8_adv.vcproj b/build/msw/wx_vc8_adv.vcproj index 21b9aa3cb2..8ac474ec99 100644 --- a/build/msw/wx_vc8_adv.vcproj +++ b/build/msw/wx_vc8_adv.vcproj @@ -1016,6 +1016,10 @@ RelativePath="..\..\src\generic\animateg.cpp" > + + @@ -1444,6 +1448,10 @@ RelativePath="..\..\include\wx\animate.h" > + + diff --git a/build/msw/wx_vc8_core.vcproj b/build/msw/wx_vc8_core.vcproj index 274e331681..a971654fcc 100644 --- a/build/msw/wx_vc8_core.vcproj +++ b/build/msw/wx_vc8_core.vcproj @@ -6771,6 +6771,10 @@ RelativePath="..\..\include\wx\aui\auibook.h" > + + @@ -7231,6 +7235,10 @@ RelativePath="..\..\include\wx\infobar.h" > + + @@ -7747,6 +7755,10 @@ RelativePath="..\..\include\wx\windowid.h" > + + @@ -7771,6 +7783,10 @@ RelativePath="..\..\include\wx\xrc\xh_animatctrl.h" > + + diff --git a/build/msw/wx_vc8_xrc.vcproj b/build/msw/wx_vc8_xrc.vcproj index 08681c2d25..c39718f689 100644 --- a/build/msw/wx_vc8_xrc.vcproj +++ b/build/msw/wx_vc8_xrc.vcproj @@ -1058,6 +1058,10 @@ RelativePath="..\..\include\wx\xrc\xh_animatctrl.h" > + + @@ -1308,6 +1312,10 @@ RelativePath="..\..\src\xrc\xh_animatctrl.cpp" > + + diff --git a/build/msw/wx_vc9_adv.vcproj b/build/msw/wx_vc9_adv.vcproj index 174463f822..1b8d84da3e 100644 --- a/build/msw/wx_vc9_adv.vcproj +++ b/build/msw/wx_vc9_adv.vcproj @@ -1012,6 +1012,10 @@ RelativePath="..\..\src\generic\animateg.cpp" > + + @@ -1440,6 +1444,10 @@ RelativePath="..\..\include\wx\animate.h" > + + diff --git a/build/msw/wx_vc9_core.vcproj b/build/msw/wx_vc9_core.vcproj index 7dbebad098..f74002f342 100644 --- a/build/msw/wx_vc9_core.vcproj +++ b/build/msw/wx_vc9_core.vcproj @@ -6767,6 +6767,10 @@ RelativePath="..\..\include\wx\aui\auibook.h" > + + @@ -7227,6 +7231,10 @@ RelativePath="..\..\include\wx\infobar.h" > + + @@ -7743,6 +7751,10 @@ RelativePath="..\..\include\wx\windowid.h" > + + @@ -7767,6 +7779,10 @@ RelativePath="..\..\include\wx\xrc\xh_animatctrl.h" > + + diff --git a/build/msw/wx_vc9_xrc.vcproj b/build/msw/wx_vc9_xrc.vcproj index 293c02e231..dc51f76e83 100644 --- a/build/msw/wx_vc9_xrc.vcproj +++ b/build/msw/wx_vc9_xrc.vcproj @@ -1054,6 +1054,10 @@ RelativePath="..\..\include\wx\xrc\xh_animatctrl.h" > + + @@ -1304,6 +1308,10 @@ RelativePath="..\..\src\xrc\xh_animatctrl.cpp" > + + diff --git a/build/msw/wx_xrc.dsp b/build/msw/wx_xrc.dsp index f231d43d1b..0ccabeb54a 100644 --- a/build/msw/wx_xrc.dsp +++ b/build/msw/wx_xrc.dsp @@ -538,6 +538,10 @@ SOURCE=..\..\include\wx\xrc\xh_animatctrl.h # End Source File # Begin Source File +SOURCE=..\..\include\wx\xrc\xh_bannerwindow.h +# End Source File +# Begin Source File + SOURCE=..\..\include\wx\xrc\xh_bmp.h # End Source File # Begin Source File @@ -786,6 +790,10 @@ SOURCE=..\..\src\xrc\xh_animatctrl.cpp # End Source File # Begin Source File +SOURCE=..\..\src\xrc\xh_bannerwindow.cpp +# End Source File +# Begin Source File + SOURCE=..\..\src\xrc\xh_bmp.cpp # End Source File # Begin Source File diff --git a/configure b/configure index 5e2119e12d..059f599a89 100755 --- a/configure +++ b/configure @@ -1196,6 +1196,7 @@ enable_controls enable_markup enable_accel enable_animatectrl +enable_bannerwindow enable_artstd enable_arttango enable_bmpbutton @@ -2108,6 +2109,7 @@ Optional Features: --enable-markup support wxControl::SetLabelMarkup --enable-accel use accelerators --enable-animatectrl use wxAnimationCtrl class + --enable-bannerwindow use wxBannerWindow class --enable-artstd use standard XPM icons in wxArtProvider --enable-arttango use Tango icons in wxArtProvider --enable-bmpbutton use wxBitmapButton class @@ -10853,6 +10855,7 @@ $as_echo "$result" >&6; } if test "$wxUSE_CONTROLS" = "no"; then DEFAULT_wxUSE_ACCEL=no DEFAULT_wxUSE_ANIMATIONCTRL=no + DEFAULT_wxUSE_BANNERWINDOW=no DEFAULT_wxUSE_BMPBUTTON=no DEFAULT_wxUSE_BUTTON=no DEFAULT_wxUSE_CALCTRL=no @@ -11044,6 +11047,50 @@ fi $as_echo "$result" >&6; } + enablestring= + defaultval=$wxUSE_ALL_FEATURES + if test -z "$defaultval"; then + if test x"$enablestring" = xdisable; then + defaultval=yes + else + defaultval=no + fi + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --${enablestring:-enable}-bannerwindow" >&5 +$as_echo_n "checking for --${enablestring:-enable}-bannerwindow... " >&6; } + # Check whether --enable-bannerwindow was given. +if test "${enable_bannerwindow+set}" = set; then : + enableval=$enable_bannerwindow; + if test "$enableval" = yes; then + wx_cv_use_bannerwindow='wxUSE_BANNERWINDOW=yes' + else + wx_cv_use_bannerwindow='wxUSE_BANNERWINDOW=no' + fi + +else + + wx_cv_use_bannerwindow='wxUSE_BANNERWINDOW=${'DEFAULT_wxUSE_BANNERWINDOW":-$defaultval}" + +fi + + + eval "$wx_cv_use_bannerwindow" + + if test x"$enablestring" = xdisable; then + if test $wxUSE_BANNERWINDOW = no; then + result=yes + else + result=no + fi + else + result=$wxUSE_BANNERWINDOW + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $result" >&5 +$as_echo "$result" >&6; } + + enablestring= defaultval=$wxUSE_ALL_FEATURES if test -z "$defaultval"; then @@ -33424,6 +33471,11 @@ if test "$wxUSE_ANIMATIONCTRL" = "yes"; then SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS animate" fi +if test "$wxUSE_BANNERWINDOW" = "yes"; then + $as_echo "#define wxUSE_BANNERWINDOW 1" >>confdefs.h + +fi + if test "$wxUSE_BUTTON" = "yes"; then $as_echo "#define wxUSE_BUTTON 1" >>confdefs.h diff --git a/configure.in b/configure.in index 2ba29db53f..d38dd1851d 100644 --- a/configure.in +++ b/configure.in @@ -877,6 +877,7 @@ dnl disabled if test "$wxUSE_CONTROLS" = "no"; then DEFAULT_wxUSE_ACCEL=no DEFAULT_wxUSE_ANIMATIONCTRL=no + DEFAULT_wxUSE_BANNERWINDOW=no DEFAULT_wxUSE_BMPBUTTON=no DEFAULT_wxUSE_BUTTON=no DEFAULT_wxUSE_CALCTRL=no @@ -940,6 +941,7 @@ WX_ARG_FEATURE(markup, [ --enable-markup support wxControl::SetLab dnl please keep the settings below in alphabetical order WX_ARG_FEATURE(accel, [ --enable-accel use accelerators], wxUSE_ACCEL) WX_ARG_FEATURE(animatectrl, [ --enable-animatectrl use wxAnimationCtrl class], wxUSE_ANIMATIONCTRL) +WX_ARG_FEATURE(bannerwindow,[ --enable-bannerwindow use wxBannerWindow class], wxUSE_BANNERWINDOW) WX_ARG_FEATURE(artstd, [ --enable-artstd use standard XPM icons in wxArtProvider], wxUSE_ARTPROVIDER_STD) WX_ARG_FEATURE(arttango, [ --enable-arttango use Tango icons in wxArtProvider], wxUSE_ARTPROVIDER_TANGO) WX_ARG_FEATURE(bmpbutton, [ --enable-bmpbutton use wxBitmapButton class], wxUSE_BMPBUTTON) @@ -6830,6 +6832,10 @@ if test "$wxUSE_ANIMATIONCTRL" = "yes"; then SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS animate" fi +if test "$wxUSE_BANNERWINDOW" = "yes"; then + AC_DEFINE(wxUSE_BANNERWINDOW) +fi + if test "$wxUSE_BUTTON" = "yes"; then AC_DEFINE(wxUSE_BUTTON) USES_CONTROLS=1 diff --git a/docs/changes.txt b/docs/changes.txt index 2b53227ba1..0e560db278 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -199,6 +199,10 @@ Changes in behaviour not resulting in compilation errors, please read this! prevent the parent wxTopLevelWindow from interfering with the keyboard handling of the window that captured the mouse. +- wxDataViewCtrl::GetSelection() now returns invalid item in all ports (this + behaved differently in wxMSW and wxGTK/wxOSX before) if more than one item + is selected in a control with wxDV_MULTIPLE style. + Changes in behaviour which may result in compilation errors ----------------------------------------------------------- @@ -333,6 +337,9 @@ Changes in behaviour which may result in compilation errors - wxST_MARKUP doesn't exist any more, use wxControl::SetLabelMarkup() instead. +- wxComboBox::IsEmpty(), which was previously available in some ports (but not + wxMSW), doesn't exist any more, use either IsListEmpty() or IsTextEmpty(). + Deprecated methods and their replacements ----------------------------------------- @@ -447,12 +454,15 @@ All (GUI): - Added documented, public wxNavigationEnabled<> class. - Added wxTextCtrl::PositionToCoords() (Navaneeth). - Added support for wxHELP button to wxMessageDialog. +- Added wxBannerWindow class. - Support float, double and file name values in wxGenericValidator (troelsk). - Fix keyboard navigation in wxGrid with hidden columns (ivan_14_32). - Add wxDataViewEvent::IsEditCancelled() (Allonii). - Allow marking wxTreeBook nodes to expand initially in XRC (RedTide). - Added customizable wxDocManager::OnMRUFileNotExist() virtual method. - Fix stock labels when not using mnemonics for Chinese (cw.ahbong). +- Added wxComboBox::IsListEmpty() and IsTextEmpty(). +- Added wxDataViewCtrl::GetSelectedItemsCount() and HasSelection(). OSX: diff --git a/docs/doxygen/Doxyfile_inc b/docs/doxygen/Doxyfile_inc index 40a0163643..5d57344c6f 100644 --- a/docs/doxygen/Doxyfile_inc +++ b/docs/doxygen/Doxyfile_inc @@ -83,7 +83,10 @@ ALIASES += flag{1}="\li \1:
\n" # creates appearance section: this should be used for all main GUI controls +# that look different in different ports. genericAppearance can be used for the +# controls that always look the same. ALIASES += appearance{1}="\htmlonly
Appearance:
wxMSW appearancewxGTK appearancewxMac appearance
wxMSW appearancewxGTK appearancewxMac appearance
\endhtmlonly" +ALIASES += genericAppearance{1}="\htmlonly
Appearance:
Generic appearance
\endhtmlonly" # aliases for the creation of "named member groups" # USAGE: the first argument must not contain spaces and be a unique identifier diff --git a/docs/doxygen/images/generic/bannerwindow.png b/docs/doxygen/images/generic/bannerwindow.png new file mode 100644 index 0000000000..e8a9a482ca Binary files /dev/null and b/docs/doxygen/images/generic/bannerwindow.png differ diff --git a/docs/doxygen/overviews/bitmap.h b/docs/doxygen/overviews/bitmap.h index 680facc5a2..2a375ca777 100644 --- a/docs/doxygen/overviews/bitmap.h +++ b/docs/doxygen/overviews/bitmap.h @@ -70,7 +70,7 @@ wxBitmap bmp(wxBITMAP(bmpname)); // which is roughly equivalent to the following #if defined(__WXMSW__) || defined(__WXPM__) - wxBitmap bmp("bmpname", wxBITMAP_TYPE_RESOURCE); + wxBitmap bmp("bmpname", wxBITMAP_TYPE_BMP_RESOURCE); #else // Unix wxBitmap bmp(bmpname_xpm, wxBITMAP_TYPE_XPM); #endif diff --git a/docs/doxygen/overviews/xrc_format.h b/docs/doxygen/overviews/xrc_format.h index 88e32f791c..72d5405f4a 100644 --- a/docs/doxygen/overviews/xrc_format.h +++ b/docs/doxygen/overviews/xrc_format.h @@ -526,6 +526,27 @@ controls cannot have children. @endTable +@subsubsection xrc_wxanimationctrl wxBannerWindow + +@beginTable +@hdr3col{property, type, description} +@row3col{direction, @c wxLEFT|wxRIGHT|wxTOP|wxBOTTOM, + The side along which the banner will be positioned.} +@row3col{bitmap, @ref overview_xrcformat_type_bitmap, + Bitmap to use as the banner background.} +@row3col{title, @ref overview_xrcformat_type_text, + Banner title, should be single line.} +@row3col{message, @ref overview_xrcformat_type_text, + Possibly multi-line banner message.} +@row3col{gradient-start, @ref overview_xrcformat_type_colour, + Starting colour of the gradient used as banner background. Can't be used if + a valid bitmap is specified.} +@row3col{gradient-end, @ref overview_xrcformat_type_colour, + End colour of the gradient used as banner background. Can't be used if + a valid bitmap is specified.} +@endTable + + @subsubsection xrc_wxbitmapbutton wxBitmapButton @beginTable diff --git a/include/wx/anybutton.h b/include/wx/anybutton.h index bc5519bcfb..f5a6cb7c3a 100644 --- a/include/wx/anybutton.h +++ b/include/wx/anybutton.h @@ -3,7 +3,7 @@ // Purpose: wxAnyButtonBase class // Author: Vadim Zetlin // Created: 2000-08-15 (extracted from button.h) -// RCS-ID: $Id: anybutton.h 65680 2010-09-30 11:44:45Z VZ $ +// RCS-ID: $Id$ // Copyright: (c) Vadim Zetlin // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -175,9 +175,9 @@ protected: wxDECLARE_NO_COPY_CLASS(wxAnyButtonBase); }; -//#if defined(__WXUNIVERSAL__) -// #include "wx/univ/anybutton.h" -#if defined(__WXMSW__) +#if defined(__WXUNIVERSAL__) + typedef wxAnyButtonBase wxAnyButton; +#elif defined(__WXMSW__) #include "wx/msw/anybutton.h" //#elif defined(__WXMOTIF__) // #include "wx/motif/anybutton.h" diff --git a/include/wx/bannerwindow.h b/include/wx/bannerwindow.h new file mode 100644 index 0000000000..eca396c5b8 --- /dev/null +++ b/include/wx/bannerwindow.h @@ -0,0 +1,137 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: wx/bannerwindow.h +// Purpose: wxBannerWindow class declaration +// Author: Vadim Zeitlin +// Created: 2011-08-16 +// RCS-ID: $Id$ +// Copyright: (c) 2011 Vadim Zeitlin +// Licence: wxWindows licence +/////////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_BANNERWINDOW_H_ +#define _WX_BANNERWINDOW_H_ + +#include "wx/defs.h" + +#if wxUSE_BANNERWINDOW + +#include "wx/bitmap.h" +#include "wx/event.h" +#include "wx/window.h" + +class WXDLLIMPEXP_FWD_CORE wxBitmap; +class WXDLLIMPEXP_FWD_CORE wxColour; +class WXDLLIMPEXP_FWD_CORE wxDC; + +extern WXDLLIMPEXP_DATA_CORE(const char) wxBannerWindowNameStr[]; + +// ---------------------------------------------------------------------------- +// A simple banner window showing either a bitmap or text. +// ---------------------------------------------------------------------------- + +class WXDLLIMPEXP_ADV wxBannerWindow : public wxWindow +{ +public: + // Default constructor, use Create() later. + wxBannerWindow() { Init(); } + + // Convenient constructor that should be used in the majority of cases. + // + // The banner orientation changes how the text in it is displayed and also + // defines where is the bitmap truncated if it's too big to fit but doesn't + // do anything for the banner position, this is supposed to be taken care + // of in the usual way, e.g. using sizers. + wxBannerWindow(wxWindow* parent, wxDirection dir = wxLEFT) + { + Init(); + + Create(parent, wxID_ANY, dir); + } + + // Full constructor provided for consistency with the other classes only. + wxBannerWindow(wxWindow* parent, + wxWindowID winid, + wxDirection dir = wxLEFT, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = 0, + const wxString& name = wxBannerWindowNameStr) + { + Init(); + + Create(parent, winid, dir, pos, size, style, name); + } + + // Can be only called on objects created with the default constructor. + bool Create(wxWindow* parent, + wxWindowID winid, + wxDirection dir = wxLEFT, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = 0, + const wxString& name = wxBannerWindowNameStr); + + + // Provide an existing bitmap to show. For wxLEFT orientation the bitmap is + // truncated from the top, for wxTOP and wxBOTTOM -- from the right and for + // wxRIGHT -- from the bottom, so put the most important part of the bitmap + // information in the opposite direction. + void SetBitmap(const wxBitmap& bmp); + + // Set the text to display. This is mutually exclusive with SetBitmap(). + // Title is rendered in bold and should be single line, message can have + // multiple lines but is not wrapped automatically. + void SetText(const wxString& title, const wxString& message); + + // Set the colours between which the gradient runs. This can be combined + // with SetText() but not SetBitmap(). + void SetGradient(const wxColour& start, const wxColour& end); + +protected: + virtual wxSize DoGetBestClientSize() const; + +private: + // Common part of all constructors. + void Init(); + + // Fully invalidates the window. + void OnSize(wxSizeEvent& event); + + // Redraws the window using either m_bitmap or m_title/m_message. + void OnPaint(wxPaintEvent& event); + + // Helper of OnPaint(): draw the bitmap at the correct position depending + // on our orientation. + void DrawBitmapBackground(wxDC& dc); + + // Helper of OnPaint(): draw the text in the appropriate direction. + void DrawBannerTextLine(wxDC& dc, const wxString& str, const wxPoint& pos); + + // Return the font to use for the title. Currently this is hardcoded as a + // larger bold version of the standard window font but could be made + // configurable in the future. + wxFont GetTitleFont() const; + + + // The window side along which the banner is laid out. + wxDirection m_direction; + + // If valid, this bitmap is drawn as is. + wxBitmap m_bitmap; + + // The title and main message to draw, used if m_bitmap is invalid. + wxString m_title, + m_message; + + // Start and stop gradient colours, only used when drawing text. + wxColour m_colStart, + m_colEnd; + + wxDECLARE_EVENT_TABLE(); + + wxDECLARE_NO_COPY_CLASS(wxBannerWindow); +}; + +#endif // wxUSE_BANNERWINDOW + +#endif // _WX_BANNERWINDOW_H_ diff --git a/include/wx/bitmap.h b/include/wx/bitmap.h index 174304e9a7..7cf93bf9ae 100644 --- a/include/wx/bitmap.h +++ b/include/wx/bitmap.h @@ -259,10 +259,10 @@ protected: #define wxBITMAP_DEFAULT_TYPE wxBITMAP_TYPE_XPM #include "wx/x11/bitmap.h" #elif defined(__WXMGL__) - #define wxBITMAP_DEFAULT_TYPE wxBITMAP_TYPE_RESOURCE + #define wxBITMAP_DEFAULT_TYPE wxBITMAP_TYPE_BMP_RESOURCE #include "wx/mgl/bitmap.h" #elif defined(__WXDFB__) - #define wxBITMAP_DEFAULT_TYPE wxBITMAP_TYPE_RESOURCE + #define wxBITMAP_DEFAULT_TYPE wxBITMAP_TYPE_BMP_RESOURCE #include "wx/dfb/bitmap.h" #elif defined(__WXMAC__) #define wxBITMAP_DEFAULT_TYPE wxBITMAP_TYPE_PICT_RESOURCE diff --git a/include/wx/bookctrl.h b/include/wx/bookctrl.h index 86a89acfd1..e42d904871 100644 --- a/include/wx/bookctrl.h +++ b/include/wx/bookctrl.h @@ -22,6 +22,7 @@ #include "wx/control.h" #include "wx/dynarray.h" +#include "wx/withimages.h" WX_DEFINE_EXPORTED_ARRAY_PTR(wxWindow *, wxArrayPages); @@ -54,7 +55,8 @@ enum // wxBookCtrlBase // ---------------------------------------------------------------------------- -class WXDLLIMPEXP_CORE wxBookCtrlBase : public wxControl +class WXDLLIMPEXP_CORE wxBookCtrlBase : public wxControl, + public wxWithImages { public: // construction @@ -85,9 +87,6 @@ public: long style = 0, const wxString& name = wxEmptyString); - // dtor - virtual ~wxBookCtrlBase(); - // accessors // --------- @@ -117,15 +116,6 @@ public: // images belong to the same image list) // --------------------------------------------------------------------- - // sets the image list to use, it is *not* deleted by the control - virtual void SetImageList(wxImageList *imageList); - - // as SetImageList() but we will delete the image list ourselves - void AssignImageList(wxImageList *imageList); - - // get pointer (may be NULL) to the associated image list - wxImageList* GetImageList() const { return m_imageList; } - // sets/returns item's image index in the current image list virtual int GetPageImage(size_t n) const = 0; virtual bool SetPageImage(size_t n, int imageId) = 0; @@ -191,7 +181,7 @@ public: virtual bool AddPage(wxWindow *page, const wxString& text, bool bSelect = false, - int imageId = -1) + int imageId = NO_IMAGE) { DoInvalidateBestSize(); return InsertPage(GetPageCount(), page, text, bSelect, imageId); @@ -202,7 +192,7 @@ public: wxWindow *page, const wxString& text, bool bSelect = false, - int imageId = -1) = 0; + int imageId = NO_IMAGE) = 0; // set the currently selected page, return the index of the previously // selected one (or wxNOT_FOUND on error) @@ -320,12 +310,6 @@ protected: // the array of all pages of this control wxArrayPages m_pages; - // the associated image list or NULL - wxImageList *m_imageList; - - // true if we must delete m_imageList - bool m_ownsImageList; - // get the page area virtual wxRect GetPageRect() const; diff --git a/include/wx/checkbox.h b/include/wx/checkbox.h index d565c4d1f6..34de754f91 100644 --- a/include/wx/checkbox.h +++ b/include/wx/checkbox.h @@ -41,18 +41,6 @@ */ #define wxCHK_ALLOW_3RD_STATE_FOR_USER 0x2000 -/* - * The possible states of a 3-state checkbox (Compatible - * with the 2-state checkbox). - */ -enum wxCheckBoxState -{ - wxCHK_UNCHECKED, - wxCHK_CHECKED, - wxCHK_UNDETERMINED /* 3-state checkbox only */ -}; - - extern WXDLLIMPEXP_DATA_CORE(const char) wxCheckBoxNameStr[]; // ---------------------------------------------------------------------------- diff --git a/include/wx/choicebk.h b/include/wx/choicebk.h index 5dbbecc104..0539b353dd 100644 --- a/include/wx/choicebk.h +++ b/include/wx/choicebk.h @@ -68,7 +68,7 @@ public: wxWindow *page, const wxString& text, bool bSelect = false, - int imageId = -1); + int imageId = NO_IMAGE); virtual int SetSelection(size_t n) { return DoSetSelection(n, SetSelection_SendEvent); } virtual int ChangeSelection(size_t n) { return DoSetSelection(n); } diff --git a/include/wx/cocoa/notebook.h b/include/wx/cocoa/notebook.h index 6cc8161ff0..e158a18fdd 100644 --- a/include/wx/cocoa/notebook.h +++ b/include/wx/cocoa/notebook.h @@ -97,7 +97,7 @@ public: wxNotebookPage *win, const wxString& strText, bool bSelect = false, - int imageId = -1 ); + int imageId = NO_IMAGE ); protected: }; diff --git a/include/wx/combobox.h b/include/wx/combobox.h index 1bcca52514..6355ed3ebd 100644 --- a/include/wx/combobox.h +++ b/include/wx/combobox.h @@ -36,7 +36,13 @@ public: wxItemContainer::Clear(); } - bool IsEmpty() const { return wxItemContainer::IsEmpty(); } + // IsEmpty() is ambiguous because we inherit it from both wxItemContainer + // and wxTextEntry, and even if defined it here to help the compiler with + // choosing one of them, it would still be confusing for the human users of + // this class. So instead define the clearly named methods below and leave + // IsEmpty() ambiguous to trigger a compilation error if it's used. + bool IsListEmpty() const { return wxItemContainer::IsEmpty(); } + bool IsTextEmpty() const { return wxTextEntry::IsEmpty(); } // also bring in GetSelection() versions of both base classes in scope // diff --git a/include/wx/dataview.h b/include/wx/dataview.h index 3dff6cde68..5e0d070118 100644 --- a/include/wx/dataview.h +++ b/include/wx/dataview.h @@ -21,9 +21,11 @@ #include "wx/variant.h" #include "wx/dynarray.h" #include "wx/icon.h" +#include "wx/itemid.h" #include "wx/weakref.h" #include "wx/vector.h" #include "wx/dataobj.h" +#include "wx/withimages.h" class WXDLLIMPEXP_FWD_CORE wxImageList; @@ -44,7 +46,6 @@ class WXDLLIMPEXP_FWD_CORE wxImageList; // wxDataViewCtrl globals // ---------------------------------------------------------------------------- -class WXDLLIMPEXP_FWD_ADV wxDataViewItem; class WXDLLIMPEXP_FWD_ADV wxDataViewModel; class WXDLLIMPEXP_FWD_ADV wxDataViewCtrl; class WXDLLIMPEXP_FWD_ADV wxDataViewColumn; @@ -78,34 +79,14 @@ extern WXDLLIMPEXP_DATA_ADV(const char) wxDataViewCtrlNameStr[]; // wxDataViewItem // --------------------------------------------------------- -class WXDLLIMPEXP_ADV wxDataViewItem +// Make it a class and not a typedef to allow forward declaring it. +class wxDataViewItem : public wxItemId { public: - wxDataViewItem() : m_id(NULL) {} - wxDataViewItem(const wxDataViewItem &item) : m_id(item.m_id) {} - - wxEXPLICIT wxDataViewItem(void* id) : m_id(id) {} - - bool IsOk() const { return m_id != NULL; } - void* GetID() const { return m_id; } - operator const void* () const { return m_id; } - -private: - void* m_id; + wxDataViewItem() : wxItemId() { } + wxEXPLICIT wxDataViewItem(void* pItem) : wxItemId(pItem) { } }; -inline -bool operator==(const wxDataViewItem& left, const wxDataViewItem& right) -{ - return left.GetID() == right.GetID(); -} - -inline -bool operator!=(const wxDataViewItem& left, const wxDataViewItem& right) -{ - return !(left == right); -} - WX_DEFINE_ARRAY(wxDataViewItem, wxDataViewItemArray); // --------------------------------------------------------- @@ -682,7 +663,15 @@ public: wxDataViewItem GetCurrentItem() const; void SetCurrentItem(const wxDataViewItem& item); - virtual wxDataViewItem GetSelection() const = 0; + // Selection: both GetSelection() and GetSelections() can be used for the + // controls both with and without wxDV_MULTIPLE style. For single selection + // controls GetSelections() is not very useful however. And for multi + // selection controls GetSelection() returns an invalid item if more than + // one item is selected. Use GetSelectedItemsCount() or HasSelection() to + // check if any items are selected at all. + virtual int GetSelectedItemsCount() const = 0; + bool HasSelection() const { return GetSelectedItemsCount() != 0; } + wxDataViewItem GetSelection() const; virtual int GetSelections( wxDataViewItemArray & sel ) const = 0; virtual void SetSelections( const wxDataViewItemArray & sel ) = 0; virtual void Select( const wxDataViewItem & item ) = 0; @@ -1232,10 +1221,11 @@ public: //----------------------------------------------------------------------------- -class WXDLLIMPEXP_ADV wxDataViewTreeCtrl: public wxDataViewCtrl +class WXDLLIMPEXP_ADV wxDataViewTreeCtrl: public wxDataViewCtrl, + public wxWithImages { public: - wxDataViewTreeCtrl() { Init(); } + wxDataViewTreeCtrl() { } wxDataViewTreeCtrl(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, @@ -1243,13 +1233,9 @@ public: long style = wxDV_NO_HEADER | wxDV_ROW_LINES, const wxValidator& validator = wxDefaultValidator) { - Init(); - Create(parent, id, pos, size, style, validator); } - virtual ~wxDataViewTreeCtrl(); - bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, @@ -1265,24 +1251,21 @@ public: bool IsContainer( const wxDataViewItem& item ) const { return GetStore()->IsContainer(item); } - void SetImageList( wxImageList *imagelist ); - wxImageList* GetImageList() { return m_imageList; } - wxDataViewItem AppendItem( const wxDataViewItem& parent, - const wxString &text, int icon = -1, wxClientData *data = NULL ); + const wxString &text, int icon = NO_IMAGE, wxClientData *data = NULL ); wxDataViewItem PrependItem( const wxDataViewItem& parent, - const wxString &text, int icon = -1, wxClientData *data = NULL ); + const wxString &text, int icon = NO_IMAGE, wxClientData *data = NULL ); wxDataViewItem InsertItem( const wxDataViewItem& parent, const wxDataViewItem& previous, - const wxString &text, int icon = -1, wxClientData *data = NULL ); + const wxString &text, int icon = NO_IMAGE, wxClientData *data = NULL ); wxDataViewItem PrependContainer( const wxDataViewItem& parent, - const wxString &text, int icon = -1, int expanded = -1, + const wxString &text, int icon = NO_IMAGE, int expanded = NO_IMAGE, wxClientData *data = NULL ); wxDataViewItem AppendContainer( const wxDataViewItem& parent, - const wxString &text, int icon = -1, int expanded = -1, + const wxString &text, int icon = NO_IMAGE, int expanded = NO_IMAGE, wxClientData *data = NULL ); wxDataViewItem InsertContainer( const wxDataViewItem& parent, const wxDataViewItem& previous, - const wxString &text, int icon = -1, int expanded = -1, + const wxString &text, int icon = NO_IMAGE, int expanded = NO_IMAGE, wxClientData *data = NULL ); wxDataViewItem GetNthChild( const wxDataViewItem& parent, unsigned int pos ) const @@ -1312,14 +1295,6 @@ public: void OnCollapsed( wxDataViewEvent &event ); void OnSize( wxSizeEvent &event ); -private: - void Init() - { - m_imageList = NULL; - } - - wxImageList *m_imageList; - private: DECLARE_EVENT_TABLE() DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxDataViewTreeCtrl) diff --git a/include/wx/dc.h b/include/wx/dc.h index f6346888ac..9f32103d85 100644 --- a/include/wx/dc.h +++ b/include/wx/dc.h @@ -43,6 +43,10 @@ class WXDLLIMPEXP_FWD_CORE wxMemoryDC; class WXDLLIMPEXP_FWD_CORE wxPrinterDC; class WXDLLIMPEXP_FWD_CORE wxPrintData; +#if wxUSE_GRAPHICS_CONTEXT +class WXDLLIMPEXP_FWD_CORE wxGraphicsContext; +#endif + // Logical ops enum wxRasterOperationMode { @@ -640,6 +644,13 @@ public: virtual int GetResolution() const { return -1; } +#if wxUSE_GRAPHICS_CONTEXT + virtual wxGraphicsContext* GetGraphicsContext() const + { return NULL; } + virtual void SetGraphicsContext( wxGraphicsContext* WXUNUSED(ctx) ) + {} +#endif + private: wxDC *m_owner; @@ -1329,6 +1340,17 @@ public: TempHDC GetTempHDC() { return TempHDC(*this); } #endif // __WXMSW__ +#if wxUSE_GRAPHICS_CONTEXT + virtual wxGraphicsContext* GetGraphicsContext() const + { + return m_pimpl->GetGraphicsContext(); + } + virtual void SetGraphicsContext( wxGraphicsContext* ctx ) + { + m_pimpl->SetGraphicsContext(ctx); + } +#endif + protected: // ctor takes ownership of the pointer wxDC(wxDCImpl *pimpl) : m_pimpl(pimpl) { } diff --git a/include/wx/defs.h b/include/wx/defs.h index c97092ce82..4815e65ca6 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -2235,6 +2235,18 @@ enum wxItemKind wxITEM_MAX }; +/* + * The possible states of a 3-state checkbox (Compatible + * with the 2-state checkbox). + */ +enum wxCheckBoxState +{ + wxCHK_UNCHECKED, + wxCHK_CHECKED, + wxCHK_UNDETERMINED /* 3-state checkbox only */ +}; + + /* hit test results */ enum wxHitTest { @@ -2572,7 +2584,7 @@ enum wxKeyModifier wxMOD_META = 0x0008, wxMOD_WIN = wxMOD_META, #if defined(__WXMAC__) || defined(__WXCOCOA__) - wxMOD_RAW_CONTROL = wxMOD_META, + wxMOD_RAW_CONTROL = 0x0010, #else wxMOD_RAW_CONTROL = wxMOD_CONTROL, #endif diff --git a/include/wx/dvrenderers.h b/include/wx/dvrenderers.h index 3418838f8a..f830582b9f 100644 --- a/include/wx/dvrenderers.h +++ b/include/wx/dvrenderers.h @@ -54,6 +54,21 @@ public: void SetIcon( const wxIcon &icon ) { m_icon = icon; } const wxIcon &GetIcon() const { return m_icon; } + bool IsSameAs(const wxDataViewIconText& other) const + { + return m_text == other.m_text && m_icon.IsSameAs(other.m_icon); + } + + bool operator==(const wxDataViewIconText& other) const + { + return IsSameAs(other); + } + + bool operator!=(const wxDataViewIconText& other) const + { + return !IsSameAs(other); + } + private: wxString m_text; wxIcon m_icon; @@ -61,19 +76,6 @@ private: DECLARE_DYNAMIC_CLASS(wxDataViewIconText) }; -inline -bool operator==(const wxDataViewIconText& left, const wxDataViewIconText& right) -{ - return left.GetText() == right.GetText() && - left.GetIcon().IsSameAs(right.GetIcon()); -} - -inline -bool operator!=(const wxDataViewIconText& left, const wxDataViewIconText& right) -{ - return !(left == right); -} - DECLARE_VARIANT_OBJECT_EXPORTED(wxDataViewIconText, WXDLLIMPEXP_ADV) // ---------------------------------------------------------------------------- @@ -171,8 +173,9 @@ protected: wxWeakRef m_editorCtrl; wxDataViewItem m_item; // for m_editorCtrl - // internal utility: - const wxDataViewCtrl* GetView() const; + // internal utility, may be used anywhere the window associated with the + // renderer is required + wxDataViewCtrl* GetView() const; protected: DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewRendererBase) diff --git a/include/wx/gdicmn.h b/include/wx/gdicmn.h index 5b6282d4b2..bf7fa60792 100644 --- a/include/wx/gdicmn.h +++ b/include/wx/gdicmn.h @@ -59,8 +59,10 @@ enum wxBitmapType wxBITMAP_TYPE_XBM_DATA, wxBITMAP_TYPE_XPM, wxBITMAP_TYPE_XPM_DATA, - wxBITMAP_TYPE_TIF, - wxBITMAP_TYPE_TIF_RESOURCE, + wxBITMAP_TYPE_TIFF, + wxBITMAP_TYPE_TIF = wxBITMAP_TYPE_TIFF, + wxBITMAP_TYPE_TIFF_RESOURCE, + wxBITMAP_TYPE_TIF_RESOURCE = wxBITMAP_TYPE_TIFF_RESOURCE, wxBITMAP_TYPE_GIF, wxBITMAP_TYPE_GIF_RESOURCE, wxBITMAP_TYPE_PNG, @@ -202,7 +204,7 @@ enum wxStockCursor */ #if defined(__WXMSW__) || defined(__WXPM__) - #define wxBITMAP(name) wxBitmap(wxT(#name), wxBITMAP_TYPE_RESOURCE) + #define wxBITMAP(name) wxBitmap(wxT(#name), wxBITMAP_TYPE_BMP_RESOURCE) #elif defined(__WXGTK__) || \ defined(__WXMOTIF__) || \ defined(__WXX11__) || \ diff --git a/include/wx/generic/dataview.h b/include/wx/generic/dataview.h index 6e728635de..ce3540749d 100644 --- a/include/wx/generic/dataview.h +++ b/include/wx/generic/dataview.h @@ -155,7 +155,7 @@ public: virtual wxDataViewColumn *GetSortingColumn() const; - virtual wxDataViewItem GetSelection() const; + virtual int GetSelectedItemsCount() const; virtual int GetSelections( wxDataViewItemArray & sel ) const; virtual void SetSelections( const wxDataViewItemArray & sel ); virtual void Select( const wxDataViewItem & item ); @@ -224,8 +224,8 @@ private: virtual wxDataViewItem DoGetCurrentItem() const; virtual void DoSetCurrentItem(const wxDataViewItem& item); - void InvalidateColBestWidths(); - void InvalidateColBestWidth(int idx); + void UpdateColBestWidths(); + void UpdateColBestWidth(int idx); wxDataViewColumnList m_cols; // cached column best widths or 0 if not computed, values are for diff --git a/include/wx/generic/notebook.h b/include/wx/generic/notebook.h index 32deb7564d..1bd34877be 100644 --- a/include/wx/generic/notebook.h +++ b/include/wx/generic/notebook.h @@ -107,7 +107,7 @@ public: wxNotebookPage *pPage, const wxString& strText, bool bSelect = false, - int imageId = -1); + int imageId = NO_IMAGE); // callbacks // --------- diff --git a/include/wx/graphics.h b/include/wx/graphics.h index 0d472b5bca..6e7cf27fe3 100644 --- a/include/wx/graphics.h +++ b/include/wx/graphics.h @@ -24,7 +24,7 @@ enum wxAntialiasMode { wxANTIALIAS_NONE, // should be 0 - wxANTIALIAS_DEFAULT, + wxANTIALIAS_DEFAULT }; enum wxInterpolationQuality diff --git a/include/wx/gtk/combobox.h b/include/wx/gtk/combobox.h index fb718013c5..02ae7e481a 100644 --- a/include/wx/gtk/combobox.h +++ b/include/wx/gtk/combobox.h @@ -97,7 +97,9 @@ public: wxItemContainer::Clear(); } - bool IsEmpty() const { return wxItemContainer::IsEmpty(); } + // See wxComboBoxBase discussion of IsEmpty(). + bool IsListEmpty() const { return wxItemContainer::IsEmpty(); } + bool IsTextEmpty() const { return wxTextEntry::IsEmpty(); } void OnChar( wxKeyEvent &event ); diff --git a/include/wx/gtk/dataview.h b/include/wx/gtk/dataview.h index 55beb85d48..8a4e12c354 100644 --- a/include/wx/gtk/dataview.h +++ b/include/wx/gtk/dataview.h @@ -142,7 +142,7 @@ public: virtual wxDataViewColumn *GetSortingColumn() const; - virtual wxDataViewItem GetSelection() const; + virtual int GetSelectedItemsCount() const; virtual int GetSelections( wxDataViewItemArray & sel ) const; virtual void SetSelections( const wxDataViewItemArray & sel ); virtual void Select( const wxDataViewItem & item ); diff --git a/include/wx/gtk/notebook.h b/include/wx/gtk/notebook.h index bad2b59524..aeb5399ea2 100644 --- a/include/wx/gtk/notebook.h +++ b/include/wx/gtk/notebook.h @@ -89,7 +89,7 @@ public: wxNotebookPage *win, const wxString& strText, bool bSelect = false, - int imageId = -1 ); + int imageId = NO_IMAGE ); // handler for tab navigation // -------------------------- diff --git a/include/wx/gtk/private/list.h b/include/wx/gtk/private/list.h new file mode 100644 index 0000000000..b4e50ab428 --- /dev/null +++ b/include/wx/gtk/private/list.h @@ -0,0 +1,33 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: wx/gtk/private/list.h +// Purpose: wxGtkList class. +// Author: Vadim Zeitlin +// Created: 2011-08-21 +// RCS-ID: $Id$ +// Copyright: (c) 2011 Vadim Zeitlin +// Licence: wxWindows licence +/////////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_GTK_PRIVATE_LIST_H_ +#define _WX_GTK_PRIVATE_LIST_H_ + +// ---------------------------------------------------------------------------- +// Convenience class for calling g_list_free() automatically +// ---------------------------------------------------------------------------- + +class wxGtkList +{ +public: + explicit wxGtkList(GList* list) : m_list(list) { } + ~wxGtkList() { g_list_free(m_list); } + + operator GList *() const { return m_list; } + GList * operator->() const { return m_list; } + +protected: + GList* const m_list; + + wxDECLARE_NO_COPY_CLASS(wxGtkList); +}; + +#endif // _WX_GTK_PRIVATE_LIST_H_ diff --git a/include/wx/gtk1/notebook.h b/include/wx/gtk1/notebook.h index 78c7ce5125..5be3df0b5b 100644 --- a/include/wx/gtk1/notebook.h +++ b/include/wx/gtk1/notebook.h @@ -89,7 +89,7 @@ public: wxNotebookPage *win, const wxString& strText, bool bSelect = false, - int imageId = -1 ); + int imageId = NO_IMAGE ); // handler for tab navigation // -------------------------- diff --git a/include/wx/itemid.h b/include/wx/itemid.h new file mode 100644 index 0000000000..fa61195fe8 --- /dev/null +++ b/include/wx/itemid.h @@ -0,0 +1,59 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: wx/itemid.h +// Purpose: wxItemId class declaration. +// Author: Vadim Zeitlin +// Created: 2011-08-17 +// RCS-ID: $Id: wxhead.h,v 1.12 2010-04-22 12:44:51 zeitlin Exp $ +// Copyright: (c) 2011 Vadim Zeitlin +// Licence: wxWindows licence +/////////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_ITEMID_H_ +#define _WX_ITEMID_H_ + +// ---------------------------------------------------------------------------- +// wxItemId: an opaque item identifier used with wx{Tree,TreeList,DataView}Ctrl. +// ---------------------------------------------------------------------------- + +// The template argument T is typically a pointer to some opaque type. While +// wxTreeItemId and wxDataViewItem use a pointer to void, this is dangerous and +// not recommended for the new item id classes. +template +class wxItemId +{ +public: + typedef T Type; + + // This ctor is implicit which is fine for non-void* types, but if you use + // this class with void* you're strongly advised to make the derived class + // ctor explicit as implicitly converting from any pointer is simply too + // dangerous. + wxItemId(Type item = NULL) : m_pItem(item) { } + + // Default copy ctor, assignment operator and dtor are ok. + + bool IsOk() const { return m_pItem != NULL; } + Type GetID() const { return m_pItem; } + operator const Type() const { return m_pItem; } + + void Unset() { m_pItem = NULL; } + + // This field is public *only* for compatibility with the old wxTreeItemId + // implementation and must not be used in any new code. +//private: + Type m_pItem; +}; + +template +bool operator==(const wxItemId& left, const wxItemId& right) +{ + return left.GetID() == right.GetID(); +} + +template +bool operator!=(const wxItemId& left, const wxItemId& right) +{ + return !(left == right); +} + +#endif // _WX_ITEMID_H_ diff --git a/include/wx/kbdstate.h b/include/wx/kbdstate.h index d2055a0c09..b50c2a4fce 100644 --- a/include/wx/kbdstate.h +++ b/include/wx/kbdstate.h @@ -45,6 +45,9 @@ public: return (m_controlDown ? wxMOD_CONTROL : 0) | (m_shiftDown ? wxMOD_SHIFT : 0) | (m_metaDown ? wxMOD_META : 0) | +#ifdef __WXOSX__ + (m_rawControlDown ? wxMOD_RAW_CONTROL : 0) | +#endif (m_altDown ? wxMOD_ALT : 0); } @@ -53,6 +56,14 @@ public: // accessors for individual modifier keys bool ControlDown() const { return m_controlDown; } + bool RawControlDown() const + { +#ifdef __WXOSX__ + return m_rawControlDown; +#else + return m_controlDown; +#endif + } bool ShiftDown() const { return m_shiftDown; } bool MetaDown() const { return m_metaDown; } bool AltDown() const { return m_altDown; } @@ -64,17 +75,21 @@ public: // purpose under Mac) bool CmdDown() const { -#if defined(__WXMAC__) || defined(__WXCOCOA__) - return MetaDown(); -#else return ControlDown(); -#endif } // these functions are mostly used by wxWidgets itself // --------------------------------------------------- void SetControlDown(bool down) { m_controlDown = down; } + void SetRawControlDown(bool down) + { +#ifdef __WXOSX__ + m_rawControlDown = down; +#else + m_controlDown = down; +#endif + } void SetShiftDown(bool down) { m_shiftDown = down; } void SetAltDown(bool down) { m_altDown = down; } void SetMetaDown(bool down) { m_metaDown = down; } @@ -84,10 +99,13 @@ public: // members of wxKeyEvent directly, these variables are public, however you // should not use them in any new code, please use the accessors instead public: - bool m_controlDown : 1; - bool m_shiftDown : 1; - bool m_altDown : 1; - bool m_metaDown : 1; + bool m_controlDown : 1; + bool m_shiftDown : 1; + bool m_altDown : 1; + bool m_metaDown : 1; +#ifdef __WXOSX__ + bool m_rawControlDown : 1; +#endif }; #endif // _WX_KBDSTATE_H_ diff --git a/include/wx/listbook.h b/include/wx/listbook.h index 052b463024..48140dc0bb 100644 --- a/include/wx/listbook.h +++ b/include/wx/listbook.h @@ -69,7 +69,7 @@ public: wxWindow *page, const wxString& text, bool bSelect = false, - int imageId = -1); + int imageId = NO_IMAGE); virtual int SetSelection(size_t n) { return DoSetSelection(n, SetSelection_SendEvent); } virtual int ChangeSelection(size_t n) { return DoSetSelection(n); } virtual int HitTest(const wxPoint& pt, long *flags = NULL) const; diff --git a/include/wx/motif/combobox.h b/include/wx/motif/combobox.h index e7e3598ed6..94ca4efb1c 100644 --- a/include/wx/motif/combobox.h +++ b/include/wx/motif/combobox.h @@ -69,6 +69,10 @@ public: const wxValidator& validator = wxDefaultValidator, const wxString& name = wxComboBoxNameStr); + // See wxComboBoxBase discussion of IsEmpty(). + bool IsListEmpty() const { return wxItemContainer::IsEmpty(); } + bool IsTextEmpty() const { return wxTextEntry::IsEmpty(); } + // resolve ambiguities among virtual functions inherited from both base // classes virtual void Clear(); diff --git a/include/wx/motif/setup0.h b/include/wx/motif/setup0.h index 4e1a836115..a111fd3e32 100644 --- a/include/wx/motif/setup0.h +++ b/include/wx/motif/setup0.h @@ -803,6 +803,7 @@ // // Recommended setting: 1 #define wxUSE_ANIMATIONCTRL 1 // wxAnimationCtrl +#define wxUSE_BANNERWINDOW 1 // wxBannerWindow #define wxUSE_BUTTON 1 // wxButton #define wxUSE_BMPBUTTON 1 // wxBitmapButton #define wxUSE_CALENDARCTRL 1 // wxCalendarCtrl diff --git a/include/wx/msw/combobox.h b/include/wx/msw/combobox.h index f656e081e8..4f4a99458b 100644 --- a/include/wx/msw/combobox.h +++ b/include/wx/msw/combobox.h @@ -75,6 +75,10 @@ public: const wxValidator& validator = wxDefaultValidator, const wxString& name = wxComboBoxNameStr); + // See wxComboBoxBase discussion of IsEmpty(). + bool IsListEmpty() const { return wxItemContainer::IsEmpty(); } + bool IsTextEmpty() const { return wxTextEntry::IsEmpty(); } + // resolve ambiguities among virtual functions inherited from both base // classes virtual void Clear(); diff --git a/include/wx/msw/notebook.h b/include/wx/msw/notebook.h index 70993e4d61..bb8ca64cc2 100644 --- a/include/wx/msw/notebook.h +++ b/include/wx/msw/notebook.h @@ -96,7 +96,7 @@ public: wxNotebookPage *pPage, const wxString& strText, bool bSelect = false, - int imageId = -1); + int imageId = NO_IMAGE); // Windows-only at present. Also, you must use the wxNB_FIXEDWIDTH // style. diff --git a/include/wx/msw/setup0.h b/include/wx/msw/setup0.h index 04a5c132b7..75770ea0e9 100644 --- a/include/wx/msw/setup0.h +++ b/include/wx/msw/setup0.h @@ -803,6 +803,7 @@ // // Recommended setting: 1 #define wxUSE_ANIMATIONCTRL 1 // wxAnimationCtrl +#define wxUSE_BANNERWINDOW 1 // wxBannerWindow #define wxUSE_BUTTON 1 // wxButton #define wxUSE_BMPBUTTON 1 // wxBitmapButton #define wxUSE_CALENDARCTRL 1 // wxCalendarCtrl diff --git a/include/wx/msw/wince/setup.h b/include/wx/msw/wince/setup.h index ce854d68cd..f0c50f6861 100644 --- a/include/wx/msw/wince/setup.h +++ b/include/wx/msw/wince/setup.h @@ -803,6 +803,7 @@ // // Recommended setting: 1 #define wxUSE_ANIMATIONCTRL 1 // wxAnimationCtrl +#define wxUSE_BANNERWINDOW 1 // wxBannerWindow #define wxUSE_BUTTON 1 // wxButton #define wxUSE_BMPBUTTON 1 // wxBitmapButton #define wxUSE_CALENDARCTRL 1 // wxCalendarCtrl diff --git a/include/wx/os2/combobox.h b/include/wx/os2/combobox.h index 92039b8a37..233d0f0d02 100644 --- a/include/wx/os2/combobox.h +++ b/include/wx/os2/combobox.h @@ -96,6 +96,10 @@ class WXDLLIMPEXP_CORE wxComboBox : public wxChoice, ,const wxString& rsName = wxComboBoxNameStr ); + // See wxComboBoxBase discussion of IsEmpty(). + bool IsListEmpty() const { return wxItemContainer::IsEmpty(); } + bool IsTextEmpty() const { return wxTextEntry::IsEmpty(); } + // resolve ambiguities among virtual functions inherited from both base // classes virtual void Clear(); diff --git a/include/wx/os2/setup0.h b/include/wx/os2/setup0.h index 267647d251..dae9cb5c3c 100644 --- a/include/wx/os2/setup0.h +++ b/include/wx/os2/setup0.h @@ -803,6 +803,7 @@ // // Recommended setting: 1 #define wxUSE_ANIMATIONCTRL 1 // wxAnimationCtrl +#define wxUSE_BANNERWINDOW 1 // wxBannerWindow #define wxUSE_BUTTON 1 // wxButton #define wxUSE_BMPBUTTON 1 // wxBitmapButton #define wxUSE_CALENDARCTRL 1 // wxCalendarCtrl diff --git a/include/wx/osx/carbon/dataview.h b/include/wx/osx/carbon/dataview.h index b6d88a2661..ca6a5e5ea4 100644 --- a/include/wx/osx/carbon/dataview.h +++ b/include/wx/osx/carbon/dataview.h @@ -406,6 +406,7 @@ public: // virtual wxDataViewItem GetCurrentItem() const; virtual void SetCurrentItem(const wxDataViewItem& item); + virtual int GetSelectedItemsCount() const; virtual int GetSelections(wxDataViewItemArray& sel) const; virtual bool IsSelected (wxDataViewItem const& item) const; virtual void Select (wxDataViewItem const& item); diff --git a/include/wx/osx/cocoa/dataview.h b/include/wx/osx/cocoa/dataview.h index 624c2cb3f7..e4c5ef65d4 100644 --- a/include/wx/osx/cocoa/dataview.h +++ b/include/wx/osx/cocoa/dataview.h @@ -474,6 +474,7 @@ public: // virtual wxDataViewItem GetCurrentItem() const; virtual void SetCurrentItem(const wxDataViewItem& item); + virtual int GetSelectedItemsCount() const; virtual int GetSelections(wxDataViewItemArray& sel) const; virtual bool IsSelected(const wxDataViewItem& item) const; virtual void Select(const wxDataViewItem& item); diff --git a/include/wx/osx/cocoa/private.h b/include/wx/osx/cocoa/private.h index a9d77d1fc5..a0a929df8d 100644 --- a/include/wx/osx/cocoa/private.h +++ b/include/wx/osx/cocoa/private.h @@ -352,7 +352,22 @@ protected : - (void)sheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo; @end - WXEXPORT @interface wxNSAppController : NSObject wxOSX_10_6_AND_LATER() + // This interface must be exported in shared 64 bit multilib build but + // using WXEXPORT with Objective C interfaces doesn't work with old (4.0.1) + // gcc when using 10.4 SDK. It does work with newer gcc even in 32 bit + // builds but seems to be unnecessary there so to avoid the expense of a + // configure check verifying if this does work or not with the current + // compiler we just only use it for 64 bit builds where this is always + // supported. + // + // NB: Currently this is the only place where we need to export an + // interface but if we need to do it elsewhere we should define a + // WXEXPORT_OBJC macro once and reuse it in all places it's needed + // instead of duplicating this preprocessor check. +#ifdef __LP64__ + WXEXPORT +#endif // 64 bit builds + @interface wxNSAppController : NSObject wxOSX_10_6_AND_LATER() { } diff --git a/include/wx/osx/core/dataview.h b/include/wx/osx/core/dataview.h index 1a554d704b..20b0fe9bdd 100644 --- a/include/wx/osx/core/dataview.h +++ b/include/wx/osx/core/dataview.h @@ -89,6 +89,7 @@ public: virtual wxDataViewItem GetCurrentItem() const = 0; virtual void SetCurrentItem(const wxDataViewItem& item) = 0; + virtual int GetSelectedItemsCount() const = 0; virtual int GetSelections(wxDataViewItemArray& sel) const = 0; // returns all selected items in the native control virtual bool IsSelected (wxDataViewItem const& item) const = 0; // checks if the passed item is selected in the native control virtual void Select (wxDataViewItem const& item) = 0; // selects the passed item in the native control diff --git a/include/wx/osx/dataview.h b/include/wx/osx/dataview.h index e585fa01d3..883438001f 100644 --- a/include/wx/osx/dataview.h +++ b/include/wx/osx/dataview.h @@ -176,7 +176,7 @@ public: virtual unsigned int GetCount() const; virtual wxRect GetItemRect(const wxDataViewItem& item, const wxDataViewColumn* columnPtr) const; - virtual wxDataViewItem GetSelection() const; + virtual int GetSelectedItemsCount() const; virtual int GetSelections(wxDataViewItemArray& sel) const; virtual void HitTest(const wxPoint& point, wxDataViewItem& item, wxDataViewColumn*& columnPtr) const; diff --git a/include/wx/osx/notebook.h b/include/wx/osx/notebook.h index 3447388f95..1affba34a9 100644 --- a/include/wx/osx/notebook.h +++ b/include/wx/osx/notebook.h @@ -95,7 +95,7 @@ public: wxNotebookPage *pPage, const wxString& strText, bool bSelect = false, - int imageId = -1); + int imageId = NO_IMAGE); // callbacks // --------- diff --git a/include/wx/osx/setup0.h b/include/wx/osx/setup0.h index 57192429e2..ab17bb42f0 100644 --- a/include/wx/osx/setup0.h +++ b/include/wx/osx/setup0.h @@ -804,6 +804,7 @@ // // Recommended setting: 1 #define wxUSE_ANIMATIONCTRL 1 // wxAnimationCtrl +#define wxUSE_BANNERWINDOW 1 // wxBannerWindow #define wxUSE_BUTTON 1 // wxButton #define wxUSE_BMPBUTTON 1 // wxBitmapButton #define wxUSE_CALENDARCTRL 1 // wxCalendarCtrl diff --git a/include/wx/palmos/notebook.h b/include/wx/palmos/notebook.h index 5e85e4259d..3c603a8169 100644 --- a/include/wx/palmos/notebook.h +++ b/include/wx/palmos/notebook.h @@ -127,7 +127,7 @@ public: wxNotebookPage *pPage, const wxString& strText, bool bSelect = false, - int imageId = -1); + int imageId = NO_IMAGE); void AddPageInfo( wxNotebookPageInfo* info ) { AddPage( info->GetPage() , info->GetText() , info->GetSelected() , info->GetImageId() ) ; } const wxNotebookPageInfoList& GetPageInfos() const ; diff --git a/include/wx/palmos/setup0.h b/include/wx/palmos/setup0.h index 96b03fa46d..aad15675d2 100644 --- a/include/wx/palmos/setup0.h +++ b/include/wx/palmos/setup0.h @@ -803,6 +803,7 @@ // // Recommended setting: 1 #define wxUSE_ANIMATIONCTRL 1 // wxAnimationCtrl +#define wxUSE_BANNERWINDOW 1 // wxBannerWindow #define wxUSE_BUTTON 1 // wxButton #define wxUSE_BMPBUTTON 1 // wxBitmapButton #define wxUSE_CALENDARCTRL 1 // wxCalendarCtrl diff --git a/include/wx/richtext/richtextformatdlg.h b/include/wx/richtext/richtextformatdlg.h index 9b0898e491..53abf8ac7d 100644 --- a/include/wx/richtext/richtextformatdlg.h +++ b/include/wx/richtext/richtextformatdlg.h @@ -22,6 +22,7 @@ #include "wx/propdlg.h" #include "wx/bookctrl.h" +#include "wx/withimages.h" #if wxUSE_HTML #include "wx/htmllbox.h" @@ -32,7 +33,6 @@ #include "wx/richtext/richtextuicustomization.h" class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextFormattingDialog; -class WXDLLIMPEXP_FWD_CORE wxImageList; class WXDLLIMPEXP_FWD_CORE wxComboBox; class WXDLLIMPEXP_FWD_CORE wxCheckBox; @@ -119,7 +119,8 @@ public: * Formatting dialog for a wxRichTextCtrl */ -class WXDLLIMPEXP_RICHTEXT wxRichTextFormattingDialog: public wxPropertySheetDialog +class WXDLLIMPEXP_RICHTEXT wxRichTextFormattingDialog: public wxPropertySheetDialog, + public wxWithImages { DECLARE_CLASS(wxRichTextFormattingDialog) DECLARE_HELP_PROVISION() @@ -194,10 +195,6 @@ public: void OnHelp(wxCommandEvent& event); void OnUpdateHelp(wxUpdateUIEvent& event); - /// Set/get image list - void SetImageList(wxImageList* imageList) { m_imageList = imageList; } - wxImageList* GetImageList() const { return m_imageList; } - /// Get/set formatting factory object static void SetFormattingDialogFactory(wxRichTextFormattingDialogFactory* factory); static wxRichTextFormattingDialogFactory* GetFormattingDialogFactory() { return ms_FormattingDialogFactory; } @@ -237,7 +234,6 @@ public: protected: - wxImageList* m_imageList; wxRichTextAttr m_attributes; //wxRichTextAttr m_resetAttributes; wxRichTextStyleDefinition* m_styleDefinition; diff --git a/include/wx/setup_inc.h b/include/wx/setup_inc.h index e85a56bf4c..48a5a85155 100644 --- a/include/wx/setup_inc.h +++ b/include/wx/setup_inc.h @@ -799,6 +799,7 @@ // // Recommended setting: 1 #define wxUSE_ANIMATIONCTRL 1 // wxAnimationCtrl +#define wxUSE_BANNERWINDOW 1 // wxBannerWindow #define wxUSE_BUTTON 1 // wxButton #define wxUSE_BMPBUTTON 1 // wxBitmapButton #define wxUSE_CALENDARCTRL 1 // wxCalendarCtrl diff --git a/include/wx/toolbook.h b/include/wx/toolbook.h index d39df2e99f..bfe6211e8f 100644 --- a/include/wx/toolbook.h +++ b/include/wx/toolbook.h @@ -78,7 +78,7 @@ public: wxWindow *page, const wxString& text, bool bSelect = false, - int imageId = -1); + int imageId = NO_IMAGE); virtual int SetSelection(size_t n) { return DoSetSelection(n, SetSelection_SendEvent); } virtual int ChangeSelection(size_t n) { return DoSetSelection(n); } virtual void SetImageList(wxImageList *imageList); diff --git a/include/wx/treebase.h b/include/wx/treebase.h index 3a4e6657f1..2027ceda4f 100644 --- a/include/wx/treebase.h +++ b/include/wx/treebase.h @@ -23,6 +23,7 @@ #include "wx/window.h" // for wxClientData #include "wx/event.h" #include "wx/dynarray.h" +#include "wx/itemid.h" #if WXWIN_COMPATIBILITY_2_6 @@ -38,53 +39,19 @@ enum #endif // WXWIN_COMPATIBILITY_2_6 // ---------------------------------------------------------------------------- -// wxTreeItemId identifies an element of the tree. In this implementation, it's -// just a trivial wrapper around Win32 HTREEITEM or a pointer to some private -// data structure in the generic version. It's opaque for the application and -// the only method which can be used by user code is IsOk(). +// wxTreeItemId identifies an element of the tree. It's opaque for the +// application and the only method which can be used by user code is IsOk(). // ---------------------------------------------------------------------------- -// Using this typedef removes an ambiguity when calling Remove() -typedef void *wxTreeItemIdValue; - -class WXDLLIMPEXP_CORE wxTreeItemId +// This is a class and not a typedef because existing code may forward declare +// wxTreeItemId as a class and we don't want to break it without good reason. +class wxTreeItemId : public wxItemId { - friend bool operator==(const wxTreeItemId&, const wxTreeItemId&); public: - // ctors - // 0 is invalid value for HTREEITEM - wxTreeItemId() { m_pItem = 0; } - - // construct wxTreeItemId from the native item id - wxTreeItemId(void *pItem) { m_pItem = pItem; } - - // default copy ctor/assignment operator are ok for us - - // accessors - // is this a valid tree item? - bool IsOk() const { return m_pItem != 0; } - // return true if this item is not valid - bool operator!() const { return !IsOk(); } - - // operations - // invalidate the item - void Unset() { m_pItem = 0; } - - operator bool() const { return IsOk(); } - - wxTreeItemIdValue m_pItem; + wxTreeItemId() : wxItemId() { } + wxTreeItemId(void* pItem) : wxItemId(pItem) { } }; -inline bool operator==(const wxTreeItemId& i1, const wxTreeItemId& i2) -{ - return i1.m_pItem == i2.m_pItem; -} - -inline bool operator!=(const wxTreeItemId& i1, const wxTreeItemId& i2) -{ - return i1.m_pItem != i2.m_pItem; -} - // ---------------------------------------------------------------------------- // wxTreeItemData is some (arbitrary) user class associated with some item. The // main advantage of having this class (compared to old untyped interface) is @@ -119,10 +86,12 @@ protected: wxTreeItemId m_pItem; }; +typedef void *wxTreeItemIdValue; + WX_DEFINE_EXPORTED_ARRAY_PTR(wxTreeItemIdValue, wxArrayTreeItemIdsBase); // this is a wrapper around the array class defined above which allow to wok -// with vaue of natural wxTreeItemId type instead of using wxTreeItemIdValue +// with values of natural wxTreeItemId type instead of using wxTreeItemIdValue // and does it without any loss of efficiency class WXDLLIMPEXP_CORE wxArrayTreeItemIds : public wxArrayTreeItemIdsBase { diff --git a/include/wx/treebook.h b/include/wx/treebook.h index 86aa0acabc..30bc563e0d 100644 --- a/include/wx/treebook.h +++ b/include/wx/treebook.h @@ -74,27 +74,27 @@ public: wxWindow *page, const wxString& text, bool bSelect = false, - int imageId = wxNOT_FOUND); + int imageId = NO_IMAGE); // Inserts a new sub-page to the end of children of the page at given pos. virtual bool InsertSubPage(size_t pos, wxWindow *page, const wxString& text, bool bSelect = false, - int imageId = wxNOT_FOUND); + int imageId = NO_IMAGE); // Adds a new page at top level after all other pages. virtual bool AddPage(wxWindow *page, const wxString& text, bool bSelect = false, - int imageId = wxNOT_FOUND); + int imageId = NO_IMAGE); // Adds a new child-page to the last top-level page inserted. // Useful when constructing 1 level tree structure. virtual bool AddSubPage(wxWindow *page, const wxString& text, bool bSelect = false, - int imageId = wxNOT_FOUND); + int imageId = NO_IMAGE); // Deletes the page and ALL its children. Could trigger page selection // change in a case when selected page is removed. In that case its parent @@ -169,16 +169,16 @@ private: wxWindow *page, const wxString& text, bool bSelect = false, - int imageId = wxNOT_FOUND); + int imageId = NO_IMAGE); bool DoInsertSubPage(size_t pos, wxWindow *page, const wxString& text, bool bSelect = false, - int imageId = wxNOT_FOUND); + int imageId = NO_IMAGE); bool DoAddSubPage(wxWindow *page, const wxString& text, bool bSelect = false, - int imageId = wxNOT_FOUND); + int imageId = NO_IMAGE); // Sets selection in the tree control and updates the page being shown. int DoSetSelection(size_t pos, int flags = 0); diff --git a/include/wx/univ/combobox.h b/include/wx/univ/combobox.h index 04343ac4fe..ac63fd63c3 100644 --- a/include/wx/univ/combobox.h +++ b/include/wx/univ/combobox.h @@ -129,7 +129,9 @@ public: wxItemContainer::Clear(); } - bool IsEmpty() const { return wxItemContainer::IsEmpty(); } + // See wxComboBoxBase discussion of IsEmpty(). + bool IsListEmpty() const { return wxItemContainer::IsEmpty(); } + bool IsTextEmpty() const { return wxTextEntry::IsEmpty(); } // wxControlWithItems methods virtual void DoClear(); diff --git a/include/wx/univ/notebook.h b/include/wx/univ/notebook.h index 7fa65423be..81fa7bf3a0 100644 --- a/include/wx/univ/notebook.h +++ b/include/wx/univ/notebook.h @@ -86,7 +86,7 @@ public: wxNotebookPage *pPage, const wxString& strText, bool bSelect = false, - int imageId = -1); + int imageId = NO_IMAGE); // style tests // ----------- @@ -188,7 +188,7 @@ protected: // return true if the tab has an associated image bool HasImage(int page) const - { return m_imageList && m_images[page] != -1; } + { return HasImageList() && m_images[page] != -1; } // get the part of the notebook reserved for the pages (slightly larger // than GetPageRect() as we draw a border and leave marginin between) diff --git a/include/wx/univ/setup0.h b/include/wx/univ/setup0.h index ee5870c5c9..4407173b17 100644 --- a/include/wx/univ/setup0.h +++ b/include/wx/univ/setup0.h @@ -802,6 +802,7 @@ // // Recommended setting: 1 #define wxUSE_ANIMATIONCTRL 1 // wxAnimationCtrl +#define wxUSE_BANNERWINDOW 1 // wxBannerWindow #define wxUSE_BUTTON 1 // wxButton #define wxUSE_BMPBUTTON 1 // wxBitmapButton #define wxUSE_CALENDARCTRL 1 // wxCalendarCtrl diff --git a/include/wx/withimages.h b/include/wx/withimages.h new file mode 100644 index 0000000000..5d38ce410d --- /dev/null +++ b/include/wx/withimages.h @@ -0,0 +1,97 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: wx/withimages.h +// Purpose: Declaration of a simple wxWithImages class. +// Author: Vadim Zeitlin +// Created: 2011-08-17 +// RCS-ID: $Id: wxhead.h,v 1.12 2010-04-22 12:44:51 zeitlin Exp $ +// Copyright: (c) 2011 Vadim Zeitlin +// Licence: wxWindows licence +/////////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_WITHIMAGES_H_ +#define _WX_WITHIMAGES_H_ + +#include "wx/defs.h" +#include "wx/icon.h" +#include "wx/imaglist.h" + +// ---------------------------------------------------------------------------- +// wxWithImages: mix-in class providing access to wxImageList. +// ---------------------------------------------------------------------------- + +class WXDLLIMPEXP_CORE wxWithImages +{ +public: + enum + { + NO_IMAGE = -1 + }; + + wxWithImages() + { + m_imageList = NULL; + m_ownsImageList = false; + } + + virtual ~wxWithImages() + { + FreeIfNeeded(); + } + + // Sets the image list to use, it is *not* deleted by the control. + virtual void SetImageList(wxImageList* imageList) + { + FreeIfNeeded(); + m_imageList = imageList; + } + + // As SetImageList() but we will delete the image list ourselves. + void AssignImageList(wxImageList* imageList) + { + SetImageList(imageList); + m_ownsImageList = true; + } + + // Get pointer (may be NULL) to the associated image list. + wxImageList* GetImageList() const { return m_imageList; } + +protected: + // Return true if we have a valid image list. + bool HasImageList() const { return m_imageList != NULL; } + + // Return the image with the given index from the image list. + // + // If there is no image list or if index == NO_IMAGE, silently returns + // wxNullIcon. + wxIcon GetImage(int iconIndex) const + { + return m_imageList && iconIndex != NO_IMAGE + ? m_imageList->GetIcon(iconIndex) + : wxNullIcon; + } + +private: + // Free the image list if necessary, i.e. if we own it. + void FreeIfNeeded() + { + if ( m_ownsImageList ) + { + delete m_imageList; + m_imageList = NULL; + + // We don't own it any more. + m_ownsImageList = false; + } + } + + + // The associated image list or NULL. + wxImageList* m_imageList; + + // False by default, if true then we delete m_imageList. + bool m_ownsImageList; + + wxDECLARE_NO_COPY_CLASS(wxWithImages); +}; + +#endif // _WX_WITHIMAGES_H_ diff --git a/include/wx/xrc/xh_all.h b/include/wx/xrc/xh_all.h index 21bd620de8..7825a72b31 100644 --- a/include/wx/xrc/xh_all.h +++ b/include/wx/xrc/xh_all.h @@ -15,6 +15,7 @@ // Existing handlers: #include "wx/xrc/xh_animatctrl.h" +#include "wx/xrc/xh_bannerwindow.h" #include "wx/xrc/xh_bmp.h" #include "wx/xrc/xh_bmpbt.h" #include "wx/xrc/xh_bmpcbox.h" diff --git a/include/wx/xrc/xh_bannerwindow.h b/include/wx/xrc/xh_bannerwindow.h new file mode 100644 index 0000000000..bc4a53d381 --- /dev/null +++ b/include/wx/xrc/xh_bannerwindow.h @@ -0,0 +1,31 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: wx/xrc/xh_bannerwindow.h +// Purpose: Declaration of wxBannerWindow XRC handler. +// Author: Vadim Zeitlin +// Created: 2011-08-16 +// RCS-ID: $Id$ +// Copyright: (c) 2011 Vadim Zeitlin +// Licence: wxWindows licence +/////////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_XH_BANNERWINDOW_H_ +#define _WX_XH_BANNERWINDOW_H_ + +#include "wx/xrc/xmlres.h" + +#if wxUSE_XRC && wxUSE_BANNERWINDOW + +class WXDLLIMPEXP_XRC wxBannerWindowXmlHandler : public wxXmlResourceHandler +{ +public: + wxBannerWindowXmlHandler(); + + virtual wxObject *DoCreateResource(); + virtual bool CanHandle(wxXmlNode *node); + + wxDECLARE_DYNAMIC_CLASS(wxBannerWindowXmlHandler); +}; + +#endif // wxUSE_XRC && wxUSE_BANNERWINDOW + +#endif // _WX_XH_BANNERWINDOW_H_ diff --git a/include/wx/xrc/xmlres.h b/include/wx/xrc/xmlres.h index f7c6867929..1d226c11af 100644 --- a/include/wx/xrc/xmlres.h +++ b/include/wx/xrc/xmlres.h @@ -558,6 +558,9 @@ protected: wxCoord GetDimension(const wxString& param, wxCoord defaultv = 0, wxWindow *windowToUse = NULL); + // Gets a direction, complains if the value is invalid. + wxDirection GetDirection(const wxString& param, wxDirection dir = wxLEFT); + // Gets a bitmap. wxBitmap GetBitmap(const wxString& param = wxT("bitmap"), const wxArtClient& defaultArtClient = wxART_OTHER, diff --git a/interface/wx/bannerwindow.h b/interface/wx/bannerwindow.h new file mode 100644 index 0000000000..50f70bb3b7 --- /dev/null +++ b/interface/wx/bannerwindow.h @@ -0,0 +1,151 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: interface.wx/bannerwindow.h +// Purpose: wxBannerWindow class documentation +// Author: Vadim Zeitlin +// Created: 2011-08-16 +// RCS-ID: $Id$ +// Copyright: (c) 2011 Vadim Zeitlin +// Licence: wxWindows licence +/////////////////////////////////////////////////////////////////////////////// + +/** + A simple banner window showing either a bitmap or text. + + Banner windows can be used to present some overview of the current window + contents to the user in an aesthetically pleasant way. They are typically + positioned along the left or top edge of the window (although this class + also supports right- and bottom-aligned banners) and show either a bitmap + with a logo or a few lines of text on a gradient-filled background. + + Using this class is very simple, e.g.: + @code + MyFrame::MyFrame(...) + { + ... create the frame itself ... + + // Create and initialize the banner. + wxBannerWindow* banner = new wxBannerWindow(this, wxTOP); + banner->SetText("Welcome to my wonderful program", + " Before doing anything else, you need to connect to " + "the online server.\n" + " Please enter your credentials in the controls below."); + + // And position it along the left edge of the window. + wxSizer* sizer = new wxBoxSizer(wxVERTICAL); + sizer->Add(banner, wxSizerFlags().Expand()); + + ... add the rest of the window contents to the same sizer ... + + SetSizerAndFit(sizer); + } + @endcode + + This class is currently implemented generically and so looks the same under + all platforms. + + @library{wxadv} + @category{miscwnd} + @genericAppearance{bannerwindow.png} + + @since 2.9.3 + */ +class wxBannerWindow : public wxWindow +{ +public: + /** + Default constructor, use Create() later. + + This constructor is only used for two-step creation, if possible, + prefer using the constructor below directly instead of using this one + and calling Create() later. + */ + wxBannerWindow(); + + /** + Convenient constructor that should be used in the majority of cases. + + The only really important arguments of the full constructor below are + @a parent and @a dir so this class provides a convenient constructor + taking only them. + + The banner orientation changes how the text in it is displayed and also + defines where is the bitmap truncated if it's too big to fit but doesn't + do anything for the banner position, this is supposed to be taken care + of in the usual way, e.g. using sizers. + */ + wxBannerWindow(wxWindow* parent, wxDirection dir = wxLEFT); + + /** + Full constructor provided for consistency with the other classes only. + + Prefer to use the shorter constructor documented above. You should + rarely, if ever, need to use non-default values for any other + parameters: as the banner window doesn't generate any events, its + identifier is not particularly useful; its position and size will be + almost always managed by the containing sizer and it doesn't have any + specific styles. So only the parent and the banner direction need to be + specified. + */ + wxBannerWindow(wxWindow* parent, + wxWindowID winid, + wxDirection dir = wxLEFT, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = 0, + const wxString& name = wxBannerWindowNameStr); + + /** + Really create the banner window for the objects created using the + default constructor. + + It's an error to call Create() for the objects created using + non-default constructor. + */ + bool Create(wxWindow* parent, + wxWindowID winid, + wxDirection dir = wxLEFT, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = 0, + const wxString& name = wxBannerWindowNameStr); + + + /** + Provide the bitmap to use as background. + + Notice that the bitmap should be big enough to always cover the entire + banner, e.g. for a horizontal banner with wxTOP style its width should + be bigger than any reasonable window size. + + For wxLEFT orientation the bitmap is truncated from the top, for wxTOP + and wxBOTTOM -- from the right and for wxRIGHT -- from the bottom, so + put the most important part of the bitmap information in the opposite + direction. + + If no valid background bitmap is specified, the banner draws gradient + background but if a valid bitmap is given here, the gradient is not + draw and the start and end colours specified for it are ignored. + + @param bmp Bitmap to use as background. May be invalid to indicate + that no background bitmap should be used. + */ + void SetBitmap(const wxBitmap& bmp); + + /** + Set the text to display. + + This is mutually exclusive with SetBitmap(). + + Title is rendered in bold and should be single line, message can have + multiple lines but is not wrapped automatically, include explicit line + breaks in the string if you want to have multiple lines. + */ + void SetText(const wxString& title, const wxString& message); + + /** + Set the colours between which the gradient runs. + + The gradient colours are ignored if SetBitmap() is used. + */ + void SetGradient(const wxColour& start, const wxColour& end); +}; diff --git a/interface/wx/bookctrl.h b/interface/wx/bookctrl.h index 450cd6d4eb..06092c4eaf 100644 --- a/interface/wx/bookctrl.h +++ b/interface/wx/bookctrl.h @@ -30,6 +30,12 @@ class wxBookCtrlBase : public wxControl { public: + enum + { + /// Symbolic constant indicating that no image should be used. + NO_IMAGE = -1 + }; + /** Default ctor. */ @@ -243,7 +249,7 @@ public: @see InsertPage() */ virtual bool AddPage(wxWindow* page, const wxString& text, - bool select = false, int imageId = wxNOT_FOUND); + bool select = false, int imageId = NO_IMAGE); /** Deletes all pages. @@ -280,7 +286,7 @@ public: wxWindow* page, const wxString& text, bool select = false, - int imageId = wxNOT_FOUND) = 0; + int imageId = NO_IMAGE) = 0; /** Deletes the specified page, without deleting the associated window. diff --git a/interface/wx/combobox.h b/interface/wx/combobox.h index 602916cccf..e77f8a8fd2 100644 --- a/interface/wx/combobox.h +++ b/interface/wx/combobox.h @@ -224,6 +224,39 @@ public: */ virtual long GetInsertionPoint() const; + /** + IsEmpty() is not available in this class. + + This method is documented here only to notice that it can't be used + with this class because of the ambiguity between the methods with the + same name inherited from wxItemContainer and wxTextEntry base classes. + + Because of this, any attempt to call it results in a compilation error + and you should use either IsListEmpty() or IsTextEmpty() depending on + what exactly do you want to test. + */ + bool IsEmpty() const; + + /** + Returns true if the list of combobox choices is empty. + + Use this method instead of (not available in this class) IsEmpty() to + test if the list of items is empty. + + @since 2.9.3 + */ + bool IsListEmpty() const; + + /** + Returns true if the text of the combobox is empty. + + Use this method instead of (not available in this class) IsEmpty() to + test if the text currently entered into the combobox is empty. + + @since 2.9.3 + */ + bool IsTextEmpty() const; + /** Same as wxTextEntry::SetSelection(). diff --git a/interface/wx/dataview.h b/interface/wx/dataview.h index 9c24be7d76..0c06dae862 100644 --- a/interface/wx/dataview.h +++ b/interface/wx/dataview.h @@ -1016,13 +1016,35 @@ public: */ wxDataViewModel* GetModel(); + /** + Returns the number of currently selected items. + + This method may be called for both the controls with single and + multiple selections and returns the number of selected item, possibly + 0, in any case. + + @since 2.9.3 + */ + virtual int GetSelectedItemsCount() const; + /** Returns first selected item or an invalid item if none is selected. + + This method may be called for both the controls with single and + multiple selections but returns an invalid item if more than one item + is selected in the latter case, use HasSelection() to determine if + there are any selected items when using multiple selection. */ virtual wxDataViewItem GetSelection() const; /** Fills @a sel with currently selected items and returns their number. + + This method may be called for both the controls with single and + multiple selections. In the single selection case it returns the array + with at most one element in it. + + @see GetSelectedItemsCount() */ virtual int GetSelections(wxDataViewItemArray& sel) const; @@ -1032,6 +1054,20 @@ public: */ virtual wxDataViewColumn* GetSortingColumn() const; + /** + Returns true if any items are currently selected. + + This method may be called for both the controls with single and + multiple selections. + + Calling this method is equivalent to calling GetSelectedItemsCount() + and comparing its result with 0 but is more clear and might also be + implemented more efficiently in the future. + + @since 2.9.3 + */ + bool HasSelection() const; + /** Hittest. */ diff --git a/interface/wx/gdicmn.h b/interface/wx/gdicmn.h index b660421374..c26755c304 100644 --- a/interface/wx/gdicmn.h +++ b/interface/wx/gdicmn.h @@ -24,8 +24,10 @@ enum wxBitmapType wxBITMAP_TYPE_XBM_DATA, wxBITMAP_TYPE_XPM, wxBITMAP_TYPE_XPM_DATA, - wxBITMAP_TYPE_TIF, - wxBITMAP_TYPE_TIF_RESOURCE, + wxBITMAP_TYPE_TIFF, + wxBITMAP_TYPE_TIF = wxBITMAP_TYPE_TIFF, + wxBITMAP_TYPE_TIFF_RESOURCE, + wxBITMAP_TYPE_TIF_RESOURCE = wxBITMAP_TYPE_TIFF_RESOURCE, wxBITMAP_TYPE_GIF, wxBITMAP_TYPE_GIF_RESOURCE, wxBITMAP_TYPE_PNG, diff --git a/interface/wx/image.h b/interface/wx/image.h index 7c5dcd6b2f..88175ba4fc 100644 --- a/interface/wx/image.h +++ b/interface/wx/image.h @@ -522,7 +522,7 @@ public: @li wxBITMAP_TYPE_PNG: Load a PNG bitmap file. @li wxBITMAP_TYPE_PCX: Load a PCX bitmap file. @li wxBITMAP_TYPE_PNM: Load a PNM bitmap file. - @li wxBITMAP_TYPE_TIF: Load a TIFF bitmap file. + @li wxBITMAP_TYPE_TIFF: Load a TIFF bitmap file. @li wxBITMAP_TYPE_TGA: Load a TGA bitmap file. @li wxBITMAP_TYPE_XPM: Load a XPM bitmap file. @li wxBITMAP_TYPE_ICO: Load a Windows icon file (ICO). @@ -1299,7 +1299,7 @@ public: @li wxBITMAP_TYPE_PNG: Load a PNG bitmap file. @li wxBITMAP_TYPE_PCX: Load a PCX bitmap file. @li wxBITMAP_TYPE_PNM: Load a PNM bitmap file. - @li wxBITMAP_TYPE_TIF: Load a TIFF bitmap file. + @li wxBITMAP_TYPE_TIFF: Load a TIFF bitmap file. @li wxBITMAP_TYPE_TGA: Load a TGA bitmap file. @li wxBITMAP_TYPE_XPM: Load a XPM bitmap file. @li wxBITMAP_TYPE_ICO: Load a Windows icon file (ICO). @@ -1781,7 +1781,7 @@ public: @li wxBITMAP_TYPE_PNG: Load a PNG bitmap file. @li wxBITMAP_TYPE_PCX: Load a PCX bitmap file. @li wxBITMAP_TYPE_PNM: Load a PNM bitmap file. - @li wxBITMAP_TYPE_TIF: Load a TIFF bitmap file. + @li wxBITMAP_TYPE_TIFF: Load a TIFF bitmap file. @li wxBITMAP_TYPE_TGA: Load a TGA bitmap file. @li wxBITMAP_TYPE_XPM: Load a XPM bitmap file. @li wxBITMAP_TYPE_ICO: Load a Windows icon file (ICO). diff --git a/interface/wx/kbdstate.h b/interface/wx/kbdstate.h index 27060a379a..4b85b6383a 100644 --- a/interface/wx/kbdstate.h +++ b/interface/wx/kbdstate.h @@ -77,18 +77,23 @@ public: bool HasModifiers() const; /** - Returns true if the Control key is pressed. + Returns true if the Control key or Apple/Command key under OS X is pressed. This function doesn't distinguish between right and left control keys. - In portable code you usually want to use CmdDown() to automatically - test for the more frequently used Command key (and not the rarely used - Control one) under Mac. - Notice that GetModifiers() should usually be used instead of this one. */ bool ControlDown() const; + /** + Returns true if the Control key (also under OS X). + + This function doesn't distinguish between right and left control keys. + + Notice that GetModifiers() should usually be used instead of this one. + */ + bool RawControlDown() const; + /** Returns true if the Shift key is pressed. @@ -102,9 +107,7 @@ public: Returns true if the Meta/Windows/Apple key is pressed. This function tests the state of the key traditionally called Meta - under Unix systems, Windows keys under MSW and Apple, or Command, key - under Mac. - + under Unix systems, Windows keys under MSW Notice that GetModifiers() should usually be used instead of this one. @see CmdDown() @@ -119,13 +122,8 @@ public: bool AltDown() const; /** - Returns true if the key used for command accelerators is pressed. - - @c Cmd is a pseudo key which is Control for PC and Unix platforms but - Apple (or Command) key under Macs: it makes often sense to use it - instead of ControlDown() because @c Command key is used for the same - thing under Mac as @c Control elsewhere (even though @c Control still - exists, it is usually not used for the same purpose under Mac). + Returns true if the key used for command accelerators is pressed. Same as + ControlDown(). Deprecated. Notice that GetModifiers() should usually be used instead of this one. */ @@ -133,6 +131,7 @@ public: void SetControlDown(bool down); + void SetRawControlDown(bool down); void SetShiftDown(bool down); void SetAltDown(bool down); void SetMetaDown(bool down); diff --git a/interface/wx/valnum.h b/interface/wx/valnum.h index 3cf138a07e..0ca772304c 100644 --- a/interface/wx/valnum.h +++ b/interface/wx/valnum.h @@ -101,7 +101,7 @@ public: Calling this is equivalent to calling both SetMin() and SetMax(). */ - void SetRange(ValueType min, ValueType max) + void SetRange(ValueType min, ValueType max); /** @@ -156,6 +156,12 @@ public: be restricted further by calling SetMin() and SetMax() or SetRange() methods inherited from the base class. + When the validator displays integers with thousands separators, the + character used for the separators (usually "." or ",") depends on the locale + set with wxLocale (note that you shouldn't change locale with setlocale() + as this can result in a mismatch between the thousands separator used by + wxLocale and the one used by the run-time library). + A simple example of using this class: @code class MyDialog : public wxDialog @@ -252,6 +258,12 @@ wxMakeIntegerValidator(T *value, int style = wxNUM_VAL_DEFAULT); implementation. As with the range, the precision can be restricted after the validator creation if necessary. + When the validator displays numbers with decimal or thousands separators, + the characters used for the separators (usually "." or ",") depend on the + locale set with wxLocale (note that you shouldn't change locale with + setlocale() as this can result in a mismatch between the separators used by + wxLocale and the one used by the run-time library). + A simple example of using this class: @code class MyDialog : public wxDialog diff --git a/interface/wx/xrc/xmlres.h b/interface/wx/xrc/xmlres.h index 269aa39ec8..28709171bc 100644 --- a/interface/wx/xrc/xmlres.h +++ b/interface/wx/xrc/xmlres.h @@ -553,6 +553,18 @@ protected: wxCoord GetDimension(const wxString& param, wxCoord defaultv = 0, wxWindow* windowToUse = 0); + /** + Gets a direction. + + If the given @a param is not present or has empty value, @a dir is + returned by default. Otherwise the value of the parameter is parsed and + a warning is generated if it's not one of @c wxLEFT, @c wxTOP, @c + wxRIGHT or @c wxBOTTOM. + + @since 2.9.3 + */ + wxDirection GetDirection(const wxString& param, wxDirection dir = wxLEFT); + /** Gets a font. */ diff --git a/misc/scripts/clean_patch b/misc/scripts/clean_patch new file mode 100755 index 0000000000..767aadeb8a --- /dev/null +++ b/misc/scripts/clean_patch @@ -0,0 +1,2 @@ +#!/bin/sh +filterdiff -x '*/*.vcproj' -x '*/*.dsp' -x autoconf_inc.m4 -x configure -x '*/makefile.*' -x '*Makefile.in' -x setup.h.in -x include/wx/msw/wince/setup.h -x '*/setup0.h' "$@" diff --git a/samples/dataview/dataview.cpp b/samples/dataview/dataview.cpp index f3c8bb2074..5fb2a2683d 100644 --- a/samples/dataview/dataview.cpp +++ b/samples/dataview/dataview.cpp @@ -684,7 +684,7 @@ void MyFrame::BuildDataViewCtrl(wxPanel* parent, unsigned int nPanel, unsigned l wxImageList *ilist = new wxImageList( 16, 16 ); ilist->Add( wxIcon(wx_small_xpm) ); - tc->SetImageList( ilist ); + tc->AssignImageList( ilist ); wxDataViewItem parent = tc->AppendContainer( wxDataViewItem(0), "The Root", 0 ); diff --git a/samples/image/canvas.cpp b/samples/image/canvas.cpp index 3bff81316f..2fc194423c 100644 --- a/samples/image/canvas.cpp +++ b/samples/image/canvas.cpp @@ -243,7 +243,7 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id, #if wxUSE_LIBTIFF image.Destroy(); - if ( !image.LoadFile( dir + wxT("horse.tif"), wxBITMAP_TYPE_TIF ) ) + if ( !image.LoadFile( dir + wxT("horse.tif"), wxBITMAP_TYPE_TIFF ) ) { wxLogError(wxT("Can't load TIFF image")); } diff --git a/samples/xrc/Makefile.in b/samples/xrc/Makefile.in index efa6c2f5b8..9855f6aa9b 100644 --- a/samples/xrc/Makefile.in +++ b/samples/xrc/Makefile.in @@ -196,7 +196,7 @@ xrcdemo$(EXEEXT): $(XRCDEMO_OBJECTS) $(__xrcdemo___win32rc) data: @mkdir -p ./rc - @for f in artprov.xpm artprov.xrc basicdlg.xpm basicdlg.xrc controls.xpm controls.xrc custclas.xpm custclas.xrc derivdlg.xpm derivdlg.xrc fileopen.gif filesave.gif frame.xrc fuzzy.gif menu.xrc platform.xpm platform.xrc quotes.gif resource.xrc toolbar.xrc uncenter.xpm objref.xrc objrefdlg.xpm uncenter.xrc update.gif variable.xpm variable.xrc throbber.gif stop.xpm; do \ + @for f in artprov.xpm artprov.xrc basicdlg.xpm basicdlg.xrc controls.xpm controls.xrc custclas.xpm custclas.xrc derivdlg.xpm derivdlg.xrc fileopen.gif filesave.gif frame.xrc fuzzy.gif menu.xrc platform.xpm platform.xrc quotes.gif resource.xrc toolbar.xrc uncenter.xpm objref.xrc objrefdlg.xpm uncenter.xrc update.gif variable.xpm variable.xrc throbber.gif stop.xpm wxbanner.gif; do \ if test ! -f ./rc/$$f -a ! -d ./rc/$$f ; \ then x=yep ; \ else x=`find $(srcdir)/rc/$$f -newer ./rc/$$f -print` ; \ diff --git a/samples/xrc/makefile.bcc b/samples/xrc/makefile.bcc index 640ceb508d..98b2e38818 100644 --- a/samples/xrc/makefile.bcc +++ b/samples/xrc/makefile.bcc @@ -256,7 +256,7 @@ $(OBJS)\xrcdemo.exe: $(XRCDEMO_OBJECTS) $(OBJS)\xrcdemo_sample.res data: if not exist $(OBJS)\rc mkdir $(OBJS)\rc - for %f in (artprov.xpm artprov.xrc basicdlg.xpm basicdlg.xrc controls.xpm controls.xrc custclas.xpm custclas.xrc derivdlg.xpm derivdlg.xrc fileopen.gif filesave.gif frame.xrc fuzzy.gif menu.xrc platform.xpm platform.xrc quotes.gif resource.xrc toolbar.xrc uncenter.xpm objref.xrc objrefdlg.xpm uncenter.xrc update.gif variable.xpm variable.xrc throbber.gif stop.xpm) do if not exist $(OBJS)\rc\%f copy .\rc\%f $(OBJS)\rc + for %f in (artprov.xpm artprov.xrc basicdlg.xpm basicdlg.xrc controls.xpm controls.xrc custclas.xpm custclas.xrc derivdlg.xpm derivdlg.xrc fileopen.gif filesave.gif frame.xrc fuzzy.gif menu.xrc platform.xpm platform.xrc quotes.gif resource.xrc toolbar.xrc uncenter.xpm objref.xrc objrefdlg.xpm uncenter.xrc update.gif variable.xpm variable.xrc throbber.gif stop.xpm wxbanner.gif) do if not exist $(OBJS)\rc\%f copy .\rc\%f $(OBJS)\rc $(OBJS)\xrcdemo_sample.res: .\..\..\samples\sample.rc brcc32 -32 -r -fo$@ -i$(BCCDIR)\include -d__WXMSW__ $(__WXUNIV_DEFINE_p_1) $(__DEBUG_DEFINE_p_1) $(__NDEBUG_DEFINE_p_1) $(__EXCEPTIONS_DEFINE_p_1) $(__RTTI_DEFINE_p_1) $(__THREAD_DEFINE_p_1) $(__UNICODE_DEFINE_p_1) $(__MSLU_DEFINE_p_1) -i$(SETUPHDIR) -i.\..\..\include $(____CAIRO_INCLUDEDIR_FILENAMES_1_p) -i. $(__DLLFLAG_p_1) -i.\..\..\samples -dNOPCH .\..\..\samples\sample.rc diff --git a/samples/xrc/makefile.gcc b/samples/xrc/makefile.gcc index c0fd8fd972..8459b4b80c 100644 --- a/samples/xrc/makefile.gcc +++ b/samples/xrc/makefile.gcc @@ -243,7 +243,7 @@ $(OBJS)\xrcdemo.exe: $(XRCDEMO_OBJECTS) $(OBJS)\xrcdemo_sample_rc.o data: if not exist $(OBJS)\rc mkdir $(OBJS)\rc - for %%f in (artprov.xpm artprov.xrc basicdlg.xpm basicdlg.xrc controls.xpm controls.xrc custclas.xpm custclas.xrc derivdlg.xpm derivdlg.xrc fileopen.gif filesave.gif frame.xrc fuzzy.gif menu.xrc platform.xpm platform.xrc quotes.gif resource.xrc toolbar.xrc uncenter.xpm objref.xrc objrefdlg.xpm uncenter.xrc update.gif variable.xpm variable.xrc throbber.gif stop.xpm) do if not exist $(OBJS)\rc\%%f copy .\rc\%%f $(OBJS)\rc + for %%f in (artprov.xpm artprov.xrc basicdlg.xpm basicdlg.xrc controls.xpm controls.xrc custclas.xpm custclas.xrc derivdlg.xpm derivdlg.xrc fileopen.gif filesave.gif frame.xrc fuzzy.gif menu.xrc platform.xpm platform.xrc quotes.gif resource.xrc toolbar.xrc uncenter.xpm objref.xrc objrefdlg.xpm uncenter.xrc update.gif variable.xpm variable.xrc throbber.gif stop.xpm wxbanner.gif) do if not exist $(OBJS)\rc\%%f copy .\rc\%%f $(OBJS)\rc $(OBJS)\xrcdemo_sample_rc.o: ./../../samples/sample.rc windres --use-temp-file -i$< -o$@ --define __WXMSW__ $(__WXUNIV_DEFINE_p_1) $(__DEBUG_DEFINE_p_1) $(__NDEBUG_DEFINE_p_1) $(__EXCEPTIONS_DEFINE_p_1) $(__RTTI_DEFINE_p_1) $(__THREAD_DEFINE_p_1) $(__UNICODE_DEFINE_p_1) $(__MSLU_DEFINE_p_1) --include-dir $(SETUPHDIR) --include-dir ./../../include $(__CAIRO_INCLUDEDIR_p) --include-dir . $(__DLLFLAG_p_1) --include-dir ./../../samples --define NOPCH diff --git a/samples/xrc/makefile.vc b/samples/xrc/makefile.vc index 8cf1f97d86..fde3fd3c77 100644 --- a/samples/xrc/makefile.vc +++ b/samples/xrc/makefile.vc @@ -366,7 +366,7 @@ $(OBJS)\xrcdemo.exe: $(XRCDEMO_OBJECTS) $(OBJS)\xrcdemo_sample.res data: if not exist $(OBJS)\rc mkdir $(OBJS)\rc - for %f in (artprov.xpm artprov.xrc basicdlg.xpm basicdlg.xrc controls.xpm controls.xrc custclas.xpm custclas.xrc derivdlg.xpm derivdlg.xrc fileopen.gif filesave.gif frame.xrc fuzzy.gif menu.xrc platform.xpm platform.xrc quotes.gif resource.xrc toolbar.xrc uncenter.xpm objref.xrc objrefdlg.xpm uncenter.xrc update.gif variable.xpm variable.xrc throbber.gif stop.xpm) do if not exist $(OBJS)\rc\%f copy .\rc\%f $(OBJS)\rc + for %f in (artprov.xpm artprov.xrc basicdlg.xpm basicdlg.xrc controls.xpm controls.xrc custclas.xpm custclas.xrc derivdlg.xpm derivdlg.xrc fileopen.gif filesave.gif frame.xrc fuzzy.gif menu.xrc platform.xpm platform.xrc quotes.gif resource.xrc toolbar.xrc uncenter.xpm objref.xrc objrefdlg.xpm uncenter.xrc update.gif variable.xpm variable.xrc throbber.gif stop.xpm wxbanner.gif) do if not exist $(OBJS)\rc\%f copy .\rc\%f $(OBJS)\rc $(OBJS)\xrcdemo_sample.res: .\..\..\samples\sample.rc rc /fo$@ /d WIN32 $(____DEBUGRUNTIME_3_p_1) $(__NO_VC_CRTDBG_p_1) /d __WXMSW__ $(__WXUNIV_DEFINE_p_1) $(__DEBUG_DEFINE_p_1) $(__NDEBUG_DEFINE_p_1) $(__EXCEPTIONS_DEFINE_p_1) $(__RTTI_DEFINE_p_1) $(__THREAD_DEFINE_p_1) $(__UNICODE_DEFINE_p_1) $(__MSLU_DEFINE_p_1) /i $(SETUPHDIR) /i .\..\..\include $(____CAIRO_INCLUDEDIR_FILENAMES_1_p) /i . $(__DLLFLAG_p_1) /d _WINDOWS /i .\..\..\samples /d NOPCH .\..\..\samples\sample.rc diff --git a/samples/xrc/makefile.wat b/samples/xrc/makefile.wat index 6baceeba05..d9ab7b2cdd 100644 --- a/samples/xrc/makefile.wat +++ b/samples/xrc/makefile.wat @@ -286,7 +286,7 @@ $(OBJS)\xrcdemo.exe : $(XRCDEMO_OBJECTS) $(OBJS)\xrcdemo_sample.res data : .SYMBOLIC if not exist $(OBJS)\rc mkdir $(OBJS)\rc - for %f in (artprov.xpm artprov.xrc basicdlg.xpm basicdlg.xrc controls.xpm controls.xrc custclas.xpm custclas.xrc derivdlg.xpm derivdlg.xrc fileopen.gif filesave.gif frame.xrc fuzzy.gif menu.xrc platform.xpm platform.xrc quotes.gif resource.xrc toolbar.xrc uncenter.xpm objref.xrc objrefdlg.xpm uncenter.xrc update.gif variable.xpm variable.xrc throbber.gif stop.xpm) do if not exist $(OBJS)\rc\%f copy .\rc\%f $(OBJS)\rc + for %f in (artprov.xpm artprov.xrc basicdlg.xpm basicdlg.xrc controls.xpm controls.xrc custclas.xpm custclas.xrc derivdlg.xpm derivdlg.xrc fileopen.gif filesave.gif frame.xrc fuzzy.gif menu.xrc platform.xpm platform.xrc quotes.gif resource.xrc toolbar.xrc uncenter.xpm objref.xrc objrefdlg.xpm uncenter.xrc update.gif variable.xpm variable.xrc throbber.gif stop.xpm wxbanner.gif) do if not exist $(OBJS)\rc\%f copy .\rc\%f $(OBJS)\rc $(OBJS)\xrcdemo_sample.res : .AUTODEPEND .\..\..\samples\sample.rc wrc -q -ad -bt=nt -r -fo=$^@ -d__WXMSW__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) $(__NDEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) $(__UNICODE_DEFINE_p) -i=$(SETUPHDIR) -i=.\..\..\include $(____CAIRO_INCLUDEDIR_FILENAMES) -i=. $(__DLLFLAG_p) -i=.\..\..\samples -dNOPCH $< diff --git a/samples/xrc/rc/controls.xrc b/samples/xrc/rc/controls.xrc index b50afb8112..f0ad8ffac1 100644 --- a/samples/xrc/rc/controls.xrc +++ b/samples/xrc/rc/controls.xrc @@ -54,6 +54,68 @@ + + + + + wxHORIZONTAL + + + wxEXPAND + + Welcome to banner demo page! + This is a default wxLEFT banner with some text.\nThe banner on the top uses a bitmap. + + + + + wxEXPAND|wxLEFT|wxRIGHT + + 15 + + wxVERTICAL + + + wxEXPAND + + wxTOP + wxbanner.gif + yellow + + Tip: + You can also use text\n and bitmap together. + + + + + + + + + wxEXPAND + + wxBOTTOM + A word of advice: + You probably shouldn't use banners\non all four sides at once. + + + + + + + wxEXPAND + + wxRIGHT + Custom Banner + You can change the gradient colours. + #7f7f7f + #ffffff + + + + + + diff --git a/samples/xrc/rc/wxbanner.gif b/samples/xrc/rc/wxbanner.gif new file mode 100644 index 0000000000..466d970f03 Binary files /dev/null and b/samples/xrc/rc/wxbanner.gif differ diff --git a/samples/xrc/xrcdemo.bkl b/samples/xrc/xrcdemo.bkl index 0d949591dc..747f8dba7a 100644 --- a/samples/xrc/xrcdemo.bkl +++ b/samples/xrc/xrcdemo.bkl @@ -38,6 +38,7 @@ objref.xrc objrefdlg.xpm uncenter.xrc update.gif variable.xpm variable.xrc throbber.gif stop.xpm + wxbanner.gif diff --git a/setup.h.in b/setup.h.in index f379879452..5290b32b01 100644 --- a/setup.h.in +++ b/setup.h.in @@ -368,6 +368,7 @@ #define wxUSE_TIPWINDOW 0 #define wxUSE_ANIMATIONCTRL 0 +#define wxUSE_BANNERWINDOW 0 #define wxUSE_BUTTON 0 #define wxUSE_BMPBUTTON 0 #define wxUSE_CALENDARCTRL 0 diff --git a/src/common/bookctrl.cpp b/src/common/bookctrl.cpp index 5392388681..cc2141b793 100644 --- a/src/common/bookctrl.cpp +++ b/src/common/bookctrl.cpp @@ -55,8 +55,6 @@ void wxBookCtrlBase::Init() { m_selection = wxNOT_FOUND; m_bookctrl = NULL; - m_imageList = NULL; - m_ownsImageList = false; m_fitToCurrentPage = false; #if defined(__WXWINCE__) @@ -89,39 +87,6 @@ wxBookCtrlBase::Create(wxWindow *parent, ); } -wxBookCtrlBase::~wxBookCtrlBase() -{ - if ( m_ownsImageList ) - { - // may be NULL, ok - delete m_imageList; - } -} - -// ---------------------------------------------------------------------------- -// image list -// ---------------------------------------------------------------------------- - -void wxBookCtrlBase::SetImageList(wxImageList *imageList) -{ - if ( m_ownsImageList ) - { - // may be NULL, ok - delete m_imageList; - - m_ownsImageList = false; - } - - m_imageList = imageList; -} - -void wxBookCtrlBase::AssignImageList(wxImageList* imageList) -{ - SetImageList(imageList); - - m_ownsImageList = true; -} - // ---------------------------------------------------------------------------- // geometry // ---------------------------------------------------------------------------- diff --git a/src/common/cshelp.cpp b/src/common/cshelp.cpp index 5bbdd65f52..f0f72c147b 100644 --- a/src/common/cshelp.cpp +++ b/src/common/cshelp.cpp @@ -284,7 +284,7 @@ wxContextHelpButton::wxContextHelpButton(wxWindow* parent, long style) #if defined(__WXPM__) : wxBitmapButton(parent, id, wxBitmap(wxCSQUERY_BITMAP - ,wxBITMAP_TYPE_RESOURCE + ,wxBITMAP_TYPE_BMP_RESOURCE ), pos, size, style) #else diff --git a/src/common/datavcmn.cpp b/src/common/datavcmn.cpp index c5540283fc..b7ee97b28e 100644 --- a/src/common/datavcmn.cpp +++ b/src/common/datavcmn.cpp @@ -673,7 +673,7 @@ wxDataViewRendererBase::~wxDataViewRendererBase() { } -const wxDataViewCtrl* wxDataViewRendererBase::GetView() const +wxDataViewCtrl* wxDataViewRendererBase::GetView() const { return const_cast(this)->GetOwner()->GetOwner(); } @@ -1094,6 +1094,16 @@ void wxDataViewCtrlBase::SetCurrentItem(const wxDataViewItem& item) Select(item); } +wxDataViewItem wxDataViewCtrlBase::GetSelection() const +{ + if ( GetSelectedItemsCount() != 1 ) + return wxDataViewItem(); + + wxDataViewItemArray selections; + GetSelections(selections); + return selections[0]; +} + wxDataViewColumn * wxDataViewCtrlBase::AppendTextColumn( const wxString &label, unsigned int model_column, wxDataViewCellMode mode, int width, wxAlignment align, int flags ) @@ -2248,11 +2258,6 @@ BEGIN_EVENT_TABLE(wxDataViewTreeCtrl,wxDataViewCtrl) EVT_SIZE( wxDataViewTreeCtrl::OnSize ) END_EVENT_TABLE() -wxDataViewTreeCtrl::~wxDataViewTreeCtrl() -{ - delete m_imageList; -} - bool wxDataViewTreeCtrl::Create( wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxValidator& validator ) { @@ -2277,21 +2282,11 @@ bool wxDataViewTreeCtrl::Create( wxWindow *parent, wxWindowID id, return true; } -void wxDataViewTreeCtrl::SetImageList( wxImageList *imagelist ) -{ - delete m_imageList; - - m_imageList = imagelist; -} - wxDataViewItem wxDataViewTreeCtrl::AppendItem( const wxDataViewItem& parent, const wxString &text, int iconIndex, wxClientData *data ) { - wxIcon icon = wxNullIcon; - if (m_imageList && (iconIndex != -1)) - icon = m_imageList->GetIcon( iconIndex ); - - wxDataViewItem res = GetStore()->AppendItem( parent, text, icon, data ); + wxDataViewItem res = GetStore()-> + AppendItem( parent, text, GetImage(iconIndex), data ); GetStore()->ItemAdded( parent, res ); @@ -2301,11 +2296,8 @@ wxDataViewItem wxDataViewTreeCtrl::AppendItem( const wxDataViewItem& parent, wxDataViewItem wxDataViewTreeCtrl::PrependItem( const wxDataViewItem& parent, const wxString &text, int iconIndex, wxClientData *data ) { - wxIcon icon = wxNullIcon; - if (m_imageList && (iconIndex != -1)) - icon = m_imageList->GetIcon( iconIndex ); - - wxDataViewItem res = GetStore()->PrependItem( parent, text, icon, data ); + wxDataViewItem res = GetStore()-> + PrependItem( parent, text, GetImage(iconIndex), data ); GetStore()->ItemAdded( parent, res ); @@ -2315,11 +2307,8 @@ wxDataViewItem wxDataViewTreeCtrl::PrependItem( const wxDataViewItem& parent, wxDataViewItem wxDataViewTreeCtrl::InsertItem( const wxDataViewItem& parent, const wxDataViewItem& previous, const wxString &text, int iconIndex, wxClientData *data ) { - wxIcon icon = wxNullIcon; - if (m_imageList && (iconIndex != -1)) - icon = m_imageList->GetIcon( iconIndex ); - - wxDataViewItem res = GetStore()->InsertItem( parent, previous, text, icon, data ); + wxDataViewItem res = GetStore()-> + InsertItem( parent, previous, text, GetImage(iconIndex), data ); GetStore()->ItemAdded( parent, res ); @@ -2329,15 +2318,9 @@ wxDataViewItem wxDataViewTreeCtrl::InsertItem( const wxDataViewItem& parent, con wxDataViewItem wxDataViewTreeCtrl::PrependContainer( const wxDataViewItem& parent, const wxString &text, int iconIndex, int expandedIndex, wxClientData *data ) { - wxIcon icon = wxNullIcon; - if (m_imageList && (iconIndex != -1)) - icon = m_imageList->GetIcon( iconIndex ); - - wxIcon expanded = wxNullIcon; - if (m_imageList && (expandedIndex != -1)) - expanded = m_imageList->GetIcon( expandedIndex ); - - wxDataViewItem res = GetStore()->PrependContainer( parent, text, icon, expanded, data ); + wxDataViewItem res = GetStore()-> + PrependContainer( parent, text, + GetImage(iconIndex), GetImage(expandedIndex), data ); GetStore()->ItemAdded( parent, res ); @@ -2347,15 +2330,9 @@ wxDataViewItem wxDataViewTreeCtrl::PrependContainer( const wxDataViewItem& paren wxDataViewItem wxDataViewTreeCtrl::AppendContainer( const wxDataViewItem& parent, const wxString &text, int iconIndex, int expandedIndex, wxClientData *data ) { - wxIcon icon = wxNullIcon; - if (m_imageList && (iconIndex != -1)) - icon = m_imageList->GetIcon( iconIndex ); - - wxIcon expanded = wxNullIcon; - if (m_imageList && (expandedIndex != -1)) - expanded = m_imageList->GetIcon( expandedIndex ); - - wxDataViewItem res = GetStore()->AppendContainer( parent, text, icon, expanded, data ); + wxDataViewItem res = GetStore()-> + AppendContainer( parent, text, + GetImage(iconIndex), GetImage(expandedIndex), data ); GetStore()->ItemAdded( parent, res ); @@ -2365,15 +2342,9 @@ wxDataViewItem wxDataViewTreeCtrl::AppendContainer( const wxDataViewItem& parent wxDataViewItem wxDataViewTreeCtrl::InsertContainer( const wxDataViewItem& parent, const wxDataViewItem& previous, const wxString &text, int iconIndex, int expandedIndex, wxClientData *data ) { - wxIcon icon = wxNullIcon; - if (m_imageList && (iconIndex != -1)) - icon = m_imageList->GetIcon( iconIndex ); - - wxIcon expanded = wxNullIcon; - if (m_imageList && (expandedIndex != -1)) - expanded = m_imageList->GetIcon( expandedIndex ); - - wxDataViewItem res = GetStore()->InsertContainer( parent, previous, text, icon, expanded, data ); + wxDataViewItem res = GetStore()-> + InsertContainer( parent, previous, text, + GetImage(iconIndex), GetImage(expandedIndex), data ); GetStore()->ItemAdded( parent, res ); @@ -2442,7 +2413,7 @@ void wxDataViewTreeCtrl::DeleteAllItems() void wxDataViewTreeCtrl::OnExpanded( wxDataViewEvent &event ) { - if (m_imageList) return; + if (HasImageList()) return; wxDataViewTreeStoreContainerNode* container = GetStore()->FindContainerNode( event.GetItem() ); if (!container) return; @@ -2454,7 +2425,7 @@ void wxDataViewTreeCtrl::OnExpanded( wxDataViewEvent &event ) void wxDataViewTreeCtrl::OnCollapsed( wxDataViewEvent &event ) { - if (m_imageList) return; + if (HasImageList()) return; wxDataViewTreeStoreContainerNode* container = GetStore()->FindContainerNode( event.GetItem() ); if (!container) return; diff --git a/src/common/imagtiff.cpp b/src/common/imagtiff.cpp index 40083e6bab..c71497af3b 100644 --- a/src/common/imagtiff.cpp +++ b/src/common/imagtiff.cpp @@ -110,7 +110,7 @@ wxTIFFHandler::wxTIFFHandler() m_name = wxT("TIFF file"); m_extension = wxT("tif"); m_altExtensions.Add(wxT("tiff")); - m_type = wxBITMAP_TYPE_TIF; + m_type = wxBITMAP_TYPE_TIFF; m_mime = wxT("image/tiff"); TIFFSetWarningHandler((TIFFErrorHandler) TIFFwxWarningHandler); TIFFSetErrorHandler((TIFFErrorHandler) TIFFwxErrorHandler); diff --git a/src/common/intl.cpp b/src/common/intl.cpp index 9b38ffbf14..97cb520a39 100644 --- a/src/common/intl.cpp +++ b/src/common/intl.cpp @@ -1442,7 +1442,23 @@ wxString wxLocale::GetInfo(wxLocaleInfo index, wxLocaleCategory cat) : LOCALE_SDECIMAL, buf, WXSIZEOF(buf)) ) + { str = buf; + + // As we get our decimal point separator from Win32 and not the + // CRT there is a possibility of mismatch between them and this + // can easily happen if the user code called setlocale() + // instead of using wxLocale to change the locale. And this can + // result in very strange bugs elsewhere in the code as the + // assumptions that formatted strings do use the decimal + // separator actually fail, so check for it here. + wxASSERT_MSG + ( + wxString::Format("%.3f", 1.23).find(str) != wxString::npos, + "Decimal separator mismatch -- did you use setlocale()?" + "If so, use wxLocale to change the locale instead." + ); + } break; case wxLOCALE_SHORT_DATE_FMT: diff --git a/src/generic/bannerwindow.cpp b/src/generic/bannerwindow.cpp new file mode 100644 index 0000000000..4717d0440e --- /dev/null +++ b/src/generic/bannerwindow.cpp @@ -0,0 +1,262 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: wx/bannerwindow.h +// Purpose: wxBannerWindow class implementation +// Author: Vadim Zeitlin +// Created: 2011-08-16 +// RCS-ID: $Id$ +// Copyright: (c) 2011 Vadim Zeitlin +// Licence: wxWindows licence +/////////////////////////////////////////////////////////////////////////////// + +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#if wxUSE_BANNERWINDOW + +#include "wx/bannerwindow.h" + +#ifndef WX_PRECOMP + #include "wx/bitmap.h" + #include "wx/colour.h" +#endif + +#include "wx/dcbuffer.h" + +namespace +{ + +// Some constants for banner layout, currently they're hard coded but we could +// easily make them configurable if needed later. +const int MARGIN_X = 5; +const int MARGIN_Y = 5; + +} // anonymous namespace + +const char wxBannerWindowNameStr[] = "bannerwindow"; + +BEGIN_EVENT_TABLE(wxBannerWindow, wxWindow) + EVT_SIZE(wxBannerWindow::OnSize) + EVT_PAINT(wxBannerWindow::OnPaint) +END_EVENT_TABLE() + +void wxBannerWindow::Init() +{ + m_direction = wxLEFT; + + m_colStart = *wxWHITE; + m_colEnd = *wxBLUE; +} + +bool +wxBannerWindow::Create(wxWindow* parent, + wxWindowID winid, + wxDirection dir, + const wxPoint& pos, + const wxSize& size, + long style, + const wxString& name) +{ + if ( !wxWindow::Create(parent, winid, pos, size, style, name) ) + return false; + + wxASSERT_MSG + ( + dir == wxLEFT || dir == wxRIGHT || dir == wxTOP || dir == wxBOTTOM, + wxS("Invalid banner direction") + ); + + m_direction = dir; + + SetBackgroundStyle(wxBG_STYLE_PAINT); + + return true; +} + +void wxBannerWindow::SetBitmap(const wxBitmap& bmp) +{ + m_bitmap = bmp; + + InvalidateBestSize(); + + Refresh(); +} + +void wxBannerWindow::SetText(const wxString& title, const wxString& message) +{ + m_title = title; + m_message = message; + + InvalidateBestSize(); + + Refresh(); +} + +void wxBannerWindow::SetGradient(const wxColour& start, const wxColour& end) +{ + m_colStart = start; + m_colEnd = end; + + Refresh(); +} + +wxFont wxBannerWindow::GetTitleFont() const +{ + wxFont font = GetFont(); + font.MakeBold().MakeLarger(); + return font; +} + +wxSize wxBannerWindow::DoGetBestClientSize() const +{ + if ( m_bitmap.IsOk() ) + { + return m_bitmap.GetSize(); + } + else + { + wxClientDC dc(const_cast(this)); + const wxSize sizeText = dc.GetMultiLineTextExtent(m_message); + + dc.SetFont(GetTitleFont()); + + const wxSize sizeTitle = dc.GetTextExtent(m_title); + + wxSize sizeWin(wxMax(sizeTitle.x, sizeText.x), sizeTitle.y + sizeText.y); + + // If we draw the text vertically width and height are swapped. + if ( m_direction == wxLEFT || m_direction == wxRIGHT ) + wxSwap(sizeWin.x, sizeWin.y); + + sizeWin += 2*wxSize(MARGIN_X, MARGIN_Y); + + return sizeWin; + } +} + +void wxBannerWindow::OnSize(wxSizeEvent& event) +{ + Refresh(); + + event.Skip(); +} + +void wxBannerWindow::OnPaint(wxPaintEvent& WXUNUSED(event)) +{ + if ( m_bitmap.IsOk() && m_title.empty() && m_message.empty() ) + { + // No need for buffering in this case. + wxPaintDC dc(this); + + DrawBitmapBackground(dc); + } + else // We need to compose our contents ourselves. + { + wxAutoBufferedPaintDC dc(this); + + // Deal with the background first. + if ( m_bitmap.IsOk() ) + { + DrawBitmapBackground(dc); + } + else // Draw gradient background. + { + wxDirection gradientDir; + if ( m_direction == wxLEFT ) + { + gradientDir = wxTOP; + } + else if ( m_direction == wxRIGHT ) + { + gradientDir = wxBOTTOM; + } + else // For both wxTOP and wxBOTTOM. + { + gradientDir = wxRIGHT; + } + + dc.GradientFillLinear(GetClientRect(), m_colStart, m_colEnd, + gradientDir); + } + + // Now draw the text on top of it. + dc.SetFont(GetTitleFont()); + + wxPoint pos(MARGIN_X, MARGIN_Y); + DrawBannerTextLine(dc, m_title, pos); + pos.y += dc.GetTextExtent(m_title).y; + + dc.SetFont(GetFont()); + + wxArrayString lines = wxSplit(m_message, '\n', '\0'); + const unsigned numLines = lines.size(); + for ( unsigned n = 0; n < numLines; n++ ) + { + const wxString& line = lines[n]; + + DrawBannerTextLine(dc, line, pos); + pos.y += dc.GetTextExtent(line).y; + } + } +} + +void wxBannerWindow::DrawBitmapBackground(wxDC& dc) +{ + switch ( m_direction ) + { + case wxTOP: + case wxBOTTOM: + case wxRIGHT: + // Draw the bitmap normally, its rightmost or bottom part could be + // truncated, as it's meant to be. + dc.DrawBitmap(m_bitmap, 0, 0); + break; + + case wxLEFT: + // The top most part of the bitmap may be truncated but its bottom + // must be always visible so intentionally draw it possibly partly + // outside of the window. + dc.DrawBitmap(m_bitmap, + 0, GetClientSize().y - m_bitmap.GetHeight()); + break; + + // This case is there only to prevent g++ warnings about not handling + // some enum elements in the switch, it can't really happen. + case wxALL: + wxFAIL_MSG( wxS("Unreachable") ); + } +} + +void +wxBannerWindow::DrawBannerTextLine(wxDC& dc, + const wxString& str, + const wxPoint& pos) +{ + switch ( m_direction ) + { + case wxTOP: + case wxBOTTOM: + // The simple case: we just draw the text normally. + dc.DrawText(str, pos); + break; + + case wxLEFT: + // We draw the text vertically and start from the lower left + // corner and not the upper left one as usual. + dc.DrawRotatedText(str, pos.y, GetClientSize().y - pos.x, 90); + break; + + case wxRIGHT: + // We also draw the text vertically but now we start from the upper + // right corner and draw it from top to bottom. + dc.DrawRotatedText(str, GetClientSize().x - pos.y, pos.x, -90); + break; + + case wxALL: + wxFAIL_MSG( wxS("Unreachable") ); + } +} + +#endif // wxUSE_BANNERWINDOW diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index 233b83f5b3..8fbfa5a75f 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -518,7 +518,6 @@ public: unsigned int GetLastVisibleRow(); unsigned int GetRowCount(); - wxDataViewItem GetSelection() const; const wxDataViewSelection& GetSelections() const { return m_selection; } void SetSelections( const wxDataViewSelection & sel ) { m_selection = sel; UpdateDisplay(); } @@ -581,7 +580,8 @@ private: int RecalculateCount(); - wxDataViewEvent SendExpanderEvent( wxEventType type, const wxDataViewItem & item ); + // Return false only if the event was vetoed by its handler. + bool SendExpanderEvent(wxEventType type, const wxDataViewItem& item); wxDataViewTreeNode * FindNode( const wxDataViewItem & item ); @@ -1969,7 +1969,6 @@ bool Walker( wxDataViewTreeNode * node, DoJob & func ) bool wxDataViewMainWindow::ItemAdded(const wxDataViewItem & parent, const wxDataViewItem & item) { - GetOwner()->InvalidateColBestWidths(); if (IsVirtualList()) { @@ -2004,6 +2003,7 @@ bool wxDataViewMainWindow::ItemAdded(const wxDataViewItem & parent, const wxData m_count = -1; } + GetOwner()->UpdateColBestWidths(); UpdateDisplay(); return true; @@ -2014,8 +2014,6 @@ static void DestroyTreeHelper( wxDataViewTreeNode * node); bool wxDataViewMainWindow::ItemDeleted(const wxDataViewItem& parent, const wxDataViewItem& item) { - GetOwner()->InvalidateColBestWidths(); - if (IsVirtualList()) { wxDataViewVirtualListModel *list_model = @@ -2026,29 +2024,35 @@ bool wxDataViewMainWindow::ItemDeleted(const wxDataViewItem& parent, { const int row = GetRowByItem(item); + int rowIndexInSelection = wxNOT_FOUND; + const size_t selCount = m_selection.size(); for ( size_t i = 0; i < selCount; i++ ) { - if ( m_selection[i] > (unsigned)row ) + if ( m_selection[i] == (unsigned)row ) + rowIndexInSelection = i; + else if ( m_selection[i] > (unsigned)row ) m_selection[i]--; } - int itemRow = m_selection.Index(row); - if ( itemRow != wxNOT_FOUND ) - m_selection.RemoveAt(itemRow); + if ( rowIndexInSelection != wxNOT_FOUND ) + m_selection.RemoveAt(rowIndexInSelection); } } else // general case { wxDataViewTreeNode * node = FindNode(parent); - int itemPosInNode = node ? node->GetChildren().Index(item.GetID()) : wxNOT_FOUND; // Notice that it is possible that the item being deleted is not in the // tree at all, for example we could be deleting a never shown (because // collapsed) item in a tree model. So it's not an error if we don't know // about this item, just return without doing anything then. - if ( !node || itemPosInNode == wxNOT_FOUND ) + if ( !node ) + return false; + + int itemPosInNode = node->GetChildren().Index(item.GetID()); + if ( itemPosInNode == wxNOT_FOUND ) return false; bool isContainer = false; @@ -2128,6 +2132,7 @@ bool wxDataViewMainWindow::ItemDeleted(const wxDataViewItem& parent, if( m_currentRow > GetRowCount() ) ChangeCurrentRow(m_count - 1); + GetOwner()->UpdateColBestWidths(); UpdateDisplay(); return true; @@ -2135,11 +2140,11 @@ bool wxDataViewMainWindow::ItemDeleted(const wxDataViewItem& parent, bool wxDataViewMainWindow::ItemChanged(const wxDataViewItem & item) { - GetOwner()->InvalidateColBestWidths(); - SortPrepare(); g_model->Resort(); + GetOwner()->UpdateColBestWidths(); + // Send event wxWindow *parent = GetParent(); wxDataViewEvent le(wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED, parent->GetId()); @@ -2167,8 +2172,6 @@ bool wxDataViewMainWindow::ValueChanged( const wxDataViewItem & item, unsigned i if (view_column == -1) return false; - GetOwner()->InvalidateColBestWidth(view_column); - // NOTE: to be valid, we cannot use e.g. INT_MAX - 1 /*#define MAX_VIRTUAL_WIDTH 100000 @@ -2181,6 +2184,8 @@ bool wxDataViewMainWindow::ValueChanged( const wxDataViewItem & item, unsigned i SortPrepare(); g_model->Resort(); + GetOwner()->UpdateColBestWidth(view_column); + // Send event wxWindow *parent = GetParent(); wxDataViewEvent le(wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED, parent->GetId()); @@ -2196,14 +2201,13 @@ bool wxDataViewMainWindow::ValueChanged( const wxDataViewItem & item, unsigned i bool wxDataViewMainWindow::Cleared() { - GetOwner()->InvalidateColBestWidths(); - DestroyTree(); m_selection.Clear(); SortPrepare(); BuildTree( GetOwner()->GetModel() ); + GetOwner()->UpdateColBestWidths(); UpdateDisplay(); return true; @@ -2885,8 +2889,9 @@ wxDataViewTreeNode * wxDataViewMainWindow::GetTreeNodeByRow(unsigned int row) co return job.GetResult(); } -wxDataViewEvent wxDataViewMainWindow::SendExpanderEvent( wxEventType type, - const wxDataViewItem & item ) +bool +wxDataViewMainWindow::SendExpanderEvent(wxEventType type, + const wxDataViewItem& item) { wxWindow *parent = GetParent(); wxDataViewEvent le(type, parent->GetId()); @@ -2895,8 +2900,7 @@ wxDataViewEvent wxDataViewMainWindow::SendExpanderEvent( wxEventType type, le.SetModel(GetOwner()->GetModel()); le.SetItem( item ); - parent->GetEventHandler()->ProcessEvent(le); - return le; + return !parent->ProcessWindowEvent(le) || le.IsAllowed(); } bool wxDataViewMainWindow::IsExpanded( unsigned int row ) const @@ -2952,12 +2956,11 @@ void wxDataViewMainWindow::Expand( unsigned int row ) if (!node->IsOpen()) { - wxDataViewEvent e = - SendExpanderEvent(wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDING, node->GetItem()); - - // Check if the user prevent expanding - if( e.GetSkipped() ) + if ( !SendExpanderEvent(wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDING, node->GetItem()) ) + { + // Vetoed by the event handler. return; + } node->ToggleOpen(); @@ -3008,10 +3011,11 @@ void wxDataViewMainWindow::Collapse(unsigned int row) if (node->IsOpen()) { - wxDataViewEvent e = - SendExpanderEvent(wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSING,node->GetItem()); - if( e.GetSkipped() ) + if ( !SendExpanderEvent(wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSING,node->GetItem()) ) + { + // Vetoed by the event handler. return; + } // Find out if there are selected items below the current node. bool selectCollapsingRow = false; @@ -3586,8 +3590,11 @@ void wxDataViewMainWindow::OnMouse( wxMouseEvent &event ) return; } - // Test whether the mouse is hovered on the tree item button + // Test whether the mouse is hovering over the expander (a.k.a tree "+" + // button) and also determine the offset of the real cell start, skipping + // the indentation and the expander itself. bool hoverOverExpander = false; + int expanderOffset = 0; if ((!IsList()) && (GetOwner()->GetExpanderColumn() == col)) { wxDataViewTreeNode * node = GetTreeNodeByRow(current); @@ -3601,6 +3608,9 @@ void wxDataViewMainWindow::OnMouse( wxMouseEvent &event ) wxRect rect( xpos + indent, GetLineStart( current ) + (GetLineHeight(current) - m_lineHeight)/2, m_lineHeight, m_lineHeight); + + expanderOffset = indent + m_lineHeight; + if( rect.Contains(x, y) ) { // So the mouse is over the expander @@ -3891,8 +3901,10 @@ void wxDataViewMainWindow::OnMouse( wxMouseEvent &event ) // notify cell about click cell->PrepareForItem(model, item, col->GetModelColumn()); - wxRect cell_rect( xpos, GetLineStart( current ), - col->GetWidth(), GetLineHeight( current ) ); + wxRect cell_rect( xpos + expanderOffset, + GetLineStart( current ), + col->GetWidth() - expanderOffset, + GetLineHeight( current ) ); // Report position relative to the cell's custom area, i.e. // no the entire space as given by the control but the one @@ -3956,14 +3968,6 @@ void wxDataViewMainWindow::OnKillFocus( wxFocusEvent &event ) event.Skip(); } -wxDataViewItem wxDataViewMainWindow::GetSelection() const -{ - if( m_selection.GetCount() != 1 ) - return wxDataViewItem(); - - return GetItemByRow( m_selection.Item(0)); -} - //----------------------------------------------------------------------------- // wxDataViewCtrl //----------------------------------------------------------------------------- @@ -4402,7 +4406,7 @@ bool wxDataViewCtrl::ClearColumns() return true; } -void wxDataViewCtrl::InvalidateColBestWidth(int idx) +void wxDataViewCtrl::UpdateColBestWidth(int idx) { m_colsBestWidths[idx] = 0; @@ -4410,7 +4414,7 @@ void wxDataViewCtrl::InvalidateColBestWidth(int idx) m_headerArea->UpdateColumn(idx); } -void wxDataViewCtrl::InvalidateColBestWidths() +void wxDataViewCtrl::UpdateColBestWidths() { m_colsBestWidths.clear(); m_colsBestWidths.resize(m_cols.size()); @@ -4480,10 +4484,9 @@ void wxDataViewCtrl::DoSetCurrentItem(const wxDataViewItem& item) } } -// Selection code with wxDataViewItem as parameters -wxDataViewItem wxDataViewCtrl::GetSelection() const +int wxDataViewCtrl::GetSelectedItemsCount() const { - return m_clientArea->GetSelection(); + return m_clientArea->GetSelections().size(); } int wxDataViewCtrl::GetSelections( wxDataViewItemArray & sel ) const diff --git a/src/gtk/button.cpp b/src/gtk/button.cpp index 28379ea998..cf3fb8b26a 100644 --- a/src/gtk/button.cpp +++ b/src/gtk/button.cpp @@ -19,6 +19,7 @@ #include "wx/stockitem.h" #include "wx/gtk/private.h" +#include "wx/gtk/private/list.h" // ---------------------------------------------------------------------------- // GTK callbacks @@ -252,13 +253,12 @@ GtkLabel *wxButton::GTKGetLabel() const { GtkWidget* box = gtk_bin_get_child(GTK_BIN(child)); GtkLabel* label = NULL; - GList* list = gtk_container_get_children(GTK_CONTAINER(box)); + wxGtkList list(gtk_container_get_children(GTK_CONTAINER(box))); for (GList* item = list; item; item = item->next) { if (GTK_IS_LABEL(item->data)) label = GTK_LABEL(item->data); } - g_list_free(list); return label; } @@ -280,12 +280,11 @@ void wxButton::DoApplyWidgetStyle(GtkRcStyle *style) GtkWidget* box = gtk_bin_get_child(GTK_BIN(child)); if ( GTK_IS_BOX(box) ) { - GList* list = gtk_container_get_children(GTK_CONTAINER(box)); + wxGtkList list(gtk_container_get_children(GTK_CONTAINER(box))); for (GList* item = list; item; item = item->next) { gtk_widget_modify_style(GTK_WIDGET(item->data), style); } - g_list_free(list); } } } diff --git a/src/gtk/dataview.cpp b/src/gtk/dataview.cpp index 4c387eae4a..2947bce732 100644 --- a/src/gtk/dataview.cpp +++ b/src/gtk/dataview.cpp @@ -34,6 +34,7 @@ #include "wx/gtk/dcclient.h" #include "wx/gtk/private/gdkconv.h" +#include "wx/gtk/private/list.h" using namespace wxGTKImpl; class wxGtkDataViewModelNotifier; @@ -98,6 +99,26 @@ private: wxDECLARE_NO_COPY_CLASS(wxGtkTreePath); }; +// ---------------------------------------------------------------------------- +// wxGtkTreePathList: self-destroying list of GtkTreePath objects. +// ---------------------------------------------------------------------------- + +class wxGtkTreePathList : public wxGtkList +{ +public: + // Ctor takes ownership of the list. + explicit wxGtkTreePathList(GList* list) + : wxGtkList(list) + { + } + + ~wxGtkTreePathList() + { + // Delete the list contents, wxGtkList will delete the list itself. + g_list_foreach(m_list, (GFunc)gtk_tree_path_free, NULL); + } +}; + // ---------------------------------------------------------------------------- // wxGtkTreeSelectionLock: prevent selection from changing during the // lifetime of this object @@ -1642,23 +1663,28 @@ bool wxGtkDataViewModelNotifier::ValueChanged( const wxDataViewItem &item, unsig GtkTreeView *widget = GTK_TREE_VIEW(ctrl->GtkGetTreeView()); GtkTreeViewColumn *gcolumn = GTK_TREE_VIEW_COLUMN(column->GetGtkHandle()); - // Get cell area - GtkTreeIter iter; - iter.stamp = wxgtk_model->stamp; - iter.user_data = (gpointer) item.GetID(); - wxGtkTreePath path(wxgtk_tree_model_get_path( - GTK_TREE_MODEL(wxgtk_model), &iter )); - GdkRectangle cell_area; - gtk_tree_view_get_cell_area( widget, path, gcolumn, &cell_area ); + // Don't attempt to refresh not yet realized tree, it is useless + // and results in GTK errors. + if ( gtk_widget_get_realized(ctrl->GtkGetTreeView()) ) + { + // Get cell area + GtkTreeIter iter; + iter.stamp = wxgtk_model->stamp; + iter.user_data = (gpointer) item.GetID(); + wxGtkTreePath path(wxgtk_tree_model_get_path( + GTK_TREE_MODEL(wxgtk_model), &iter )); + GdkRectangle cell_area; + gtk_tree_view_get_cell_area( widget, path, gcolumn, &cell_area ); - GtkAdjustment* hadjust = gtk_tree_view_get_hadjustment( widget ); - double d = gtk_adjustment_get_value( hadjust ); - int xdiff = (int) d; + GtkAdjustment* hadjust = gtk_tree_view_get_hadjustment( widget ); + double d = gtk_adjustment_get_value( hadjust ); + int xdiff = (int) d; - int ydiff = gtk_widget_get_allocated_height(gtk_tree_view_column_get_button(gcolumn)); - // Redraw - gtk_widget_queue_draw_area( GTK_WIDGET(widget), - cell_area.x - xdiff, ydiff + cell_area.y, cell_area.width, cell_area.height ); + int ydiff = gcolumn->button->allocation.height; + // Redraw + gtk_widget_queue_draw_area( GTK_WIDGET(widget), + cell_area.x - xdiff, ydiff + cell_area.y, cell_area.width, cell_area.height ); + } m_internal->ValueChanged( item, model_column ); @@ -4838,13 +4864,9 @@ int wxDataViewCtrl::GetColumnPosition( const wxDataViewColumn *column ) const { GtkTreeViewColumn *gtk_column = GTK_TREE_VIEW_COLUMN(column->GetGtkHandle()); - GList *list = gtk_tree_view_get_columns( GTK_TREE_VIEW(m_treeview) ); + wxGtkList list(gtk_tree_view_get_columns(GTK_TREE_VIEW(m_treeview))); - gint pos = g_list_index( list, (gconstpointer) gtk_column ); - - g_list_free( list ); - - return pos; + return g_list_index( list, (gconstpointer) gtk_column ); } wxDataViewColumn *wxDataViewCtrl::GetSortingColumn() const @@ -4940,39 +4962,11 @@ void wxDataViewCtrl::StartEditor(const wxDataViewItem& item, unsigned int column gtk_tree_view_set_cursor(GTK_TREE_VIEW(m_treeview), path, gcolumn, TRUE); } -wxDataViewItem wxDataViewCtrl::GetSelection() const +int wxDataViewCtrl::GetSelectedItemsCount() const { GtkTreeSelection *selection = gtk_tree_view_get_selection( GTK_TREE_VIEW(m_treeview) ); - if (m_windowStyle & wxDV_MULTIPLE) - { - // Report the first one - GtkTreeModel *model; - GList *list = gtk_tree_selection_get_selected_rows( selection, &model ); - - if (list) - { - GtkTreePath *path = (GtkTreePath*) list->data; - wxDataViewItem item(GTKPathToItem(path)); - - // delete list - g_list_foreach( list, (GFunc) gtk_tree_path_free, NULL ); - g_list_free( list ); - - return item; - } - } - else - { - GtkTreeIter iter; - if (gtk_tree_selection_get_selected( selection, NULL, &iter )) - { - wxDataViewItem item( iter.user_data ); - return item; - } - } - - return wxDataViewItem(0); + return gtk_tree_selection_count_selected_rows(selection); } int wxDataViewCtrl::GetSelections( wxDataViewItemArray & sel ) const @@ -4983,38 +4977,25 @@ int wxDataViewCtrl::GetSelections( wxDataViewItemArray & sel ) const if (HasFlag(wxDV_MULTIPLE)) { GtkTreeModel *model; - GList *list = gtk_tree_selection_get_selected_rows( selection, &model ); + wxGtkTreePathList list(gtk_tree_selection_get_selected_rows(selection, &model)); - int count = 0; - while (list) + for ( GList* current = list; current; current = g_list_next(current) ) { - GtkTreePath *path = (GtkTreePath*) list->data; + GtkTreePath *path = (GtkTreePath*) current->data; sel.Add(GTKPathToItem(path)); - - list = g_list_next( list ); - count++; } - - // delete list - g_list_foreach( list, (GFunc) gtk_tree_path_free, NULL ); - g_list_free( list ); - - return count; } else { - GtkTreeModel *model; GtkTreeIter iter; - gboolean has_selection = gtk_tree_selection_get_selected( selection, &model, &iter ); - if (has_selection) + if (gtk_tree_selection_get_selected( selection, NULL, &iter )) { - sel.Add( wxDataViewItem( (void*) iter.user_data) ); - return 1; + sel.Add( wxDataViewItem(iter.user_data) ); } } - return 0; + return sel.size(); } void wxDataViewCtrl::SetSelections( const wxDataViewItemArray & sel ) diff --git a/src/gtk/notebook.cpp b/src/gtk/notebook.cpp index 89661bec54..9a73600f19 100644 --- a/src/gtk/notebook.cpp +++ b/src/gtk/notebook.cpp @@ -277,8 +277,8 @@ bool wxNotebook::SetPageImage( size_t page, int image ) wxGtkNotebookPage* pageData = GetNotebookPage(page); if (image >= 0) { - wxCHECK_MSG(m_imageList, false, "invalid notebook imagelist"); - const wxBitmap* bitmap = m_imageList->GetBitmapPtr(image); + wxCHECK_MSG(HasImageList(), false, "invalid notebook imagelist"); + const wxBitmap* bitmap = GetImageList()->GetBitmapPtr(image); if (bitmap == NULL) return false; if (pageData->m_image) @@ -410,9 +410,9 @@ bool wxNotebook::InsertPage( size_t position, pageData->m_image = NULL; if (imageId != -1) { - if (m_imageList) + if (HasImageList()) { - const wxBitmap* bitmap = m_imageList->GetBitmapPtr(imageId); + const wxBitmap* bitmap = GetImageList()->GetBitmapPtr(imageId); pageData->m_image = gtk_image_new_from_pixbuf(bitmap->GetPixbuf()); gtk_box_pack_start(GTK_BOX(pageData->m_box), pageData->m_image, false, false, m_padding); diff --git a/src/gtk1/notebook.cpp b/src/gtk1/notebook.cpp index 9018d38702..5406419a13 100644 --- a/src/gtk1/notebook.cpp +++ b/src/gtk1/notebook.cpp @@ -289,7 +289,6 @@ void wxNotebook::Init() m_padding = 0; m_inSwitchPage = false; - m_imageList = NULL; m_themeEnabled = true; } @@ -511,10 +510,10 @@ bool wxNotebook::SetPageImage( size_t page, int image ) } /* Only cases 3) and 4) left */ - wxASSERT( m_imageList != NULL ); /* Just in case */ + wxASSERT( HasImageList() ); /* Just in case */ /* Construct the new pixmap */ - const wxBitmap *bmp = m_imageList->GetBitmapPtr(image); + const wxBitmap *bmp = GetImageList()->GetBitmapPtr(image); GdkPixmap *pixmap = bmp->GetPixmap(); GdkBitmap *mask = NULL; if ( bmp->GetMask() ) @@ -680,9 +679,9 @@ bool wxNotebook::InsertPage( size_t position, if (imageId != -1) { - wxASSERT( m_imageList != NULL ); + wxASSERT( HasImageList() ); - const wxBitmap *bmp = m_imageList->GetBitmapPtr(imageId); + const wxBitmap *bmp = GetImageList()->GetBitmapPtr(imageId); GdkPixmap *pixmap = bmp->GetPixmap(); GdkBitmap *mask = NULL; if ( bmp->GetMask() ) diff --git a/src/msw/artmsw.cpp b/src/msw/artmsw.cpp index 10fd2621ee..f304ffdea8 100644 --- a/src/msw/artmsw.cpp +++ b/src/msw/artmsw.cpp @@ -124,6 +124,10 @@ wxSize wxArtProvider::GetNativeSizeHint(const wxArtClient& client) { return wxSize(16, 16); } + else if (client == wxART_LIST) + { + return wxSize(16, 16); + } return wxDefaultSize; } diff --git a/src/msw/notebook.cpp b/src/msw/notebook.cpp index 1879bb2ba3..e69fd60c43 100644 --- a/src/msw/notebook.cpp +++ b/src/msw/notebook.cpp @@ -138,8 +138,6 @@ END_EVENT_TABLE() // common part of all ctors void wxNotebook::Init() { - m_imageList = NULL; - #if wxUSE_UXTHEME m_hbrBackground = NULL; #endif // wxUSE_UXTHEME diff --git a/src/os2/notebook.cpp b/src/os2/notebook.cpp index 299b848a96..f1c52e8ed4 100644 --- a/src/os2/notebook.cpp +++ b/src/os2/notebook.cpp @@ -73,7 +73,6 @@ END_EVENT_TABLE() // void wxNotebook::Init() { - m_imageList = NULL; m_nTabSize = 0; } // end of wxNotebook::Init @@ -325,7 +324,7 @@ bool wxNotebook::SetPageImage ( , int nImage ) { - wxBitmap vBitmap = (wxBitmap)m_imageList->GetBitmap(nImage); + wxBitmap vBitmap = (wxBitmap)GetImageList()->GetBitmap(nImage); return (bool)::WinSendMsg( GetHWND() ,BKM_SETTABBITMAP diff --git a/src/osx/carbon/app.cpp b/src/osx/carbon/app.cpp index 722f9cc2f8..161ab55387 100644 --- a/src/osx/carbon/app.cpp +++ b/src/osx/carbon/app.cpp @@ -1570,10 +1570,10 @@ wxMouseState wxGetMouseState() ms.SetRightDown( (buttons & 0x02) != 0 ); UInt32 modifiers = GetCurrentKeyModifiers(); - ms.SetControlDown(modifiers & controlKey); + ms.SetRawControlDown(modifiers & controlKey); ms.SetShiftDown(modifiers & shiftKey); ms.SetAltDown(modifiers & optionKey); - ms.SetMetaDown(modifiers & cmdKey); + ms.SetControlDown(modifiers & cmdKey); return ms; } @@ -1766,9 +1766,9 @@ void wxApp::MacCreateKeyEvent( wxKeyEvent& event, wxWindow* focus , long keymess } event.m_shiftDown = modifiers & shiftKey; - event.m_controlDown = modifiers & controlKey; + event.m_rawControlDown = modifiers & controlKey; event.m_altDown = modifiers & optionKey; - event.m_metaDown = modifiers & cmdKey; + event.m_controlDown = modifiers & cmdKey; event.m_keyCode = keyval ; #if wxUSE_UNICODE event.m_uniChar = uniChar ; diff --git a/src/osx/carbon/dataview.cpp b/src/osx/carbon/dataview.cpp index 2d316d9e0c..dd288d8e17 100644 --- a/src/osx/carbon/dataview.cpp +++ b/src/osx/carbon/dataview.cpp @@ -1107,6 +1107,23 @@ void wxMacDataViewDataBrowserListViewControl::SetCurrentItem(const wxDataViewIte wxFAIL_MSG( "unimplemented for Carbon" ); } +int wxMacDataViewDataBrowserListViewControl::GetSelectedItemsCount() const +{ + Handle handle(::NewHandle(0)); + + if ( GetItems(kDataBrowserNoItem,true,kDataBrowserItemIsSelected,handle) != noErr ) + { + wxFAIL_MSG( "failed to get selected items" ); + return 0; + } + + size_t noOfItems = static_cast(::GetHandleSize(handle)/sizeof(DataBrowserItemID)); + HUnlock(handle); + DisposeHandle(handle); + + return noOfItems; +} + int wxMacDataViewDataBrowserListViewControl::GetSelections(wxDataViewItemArray& sel) const { size_t noOfSelectedItems; diff --git a/src/osx/cocoa/dataview.mm b/src/osx/cocoa/dataview.mm index 148c9b0113..f9600c916e 100644 --- a/src/osx/cocoa/dataview.mm +++ b/src/osx/cocoa/dataview.mm @@ -2265,6 +2265,11 @@ void wxCocoaDataViewControl::SetCurrentItem(const wxDataViewItem& item) Select(item); } +int wxCocoaDataViewControl::GetSelectedItemsCount() const +{ + return [m_OutlineView numberOfSelectedRows]; +} + int wxCocoaDataViewControl::GetSelections(wxDataViewItemArray& sel) const { NSIndexSet* selectedRowIndexes([m_OutlineView selectedRowIndexes]); diff --git a/src/osx/cocoa/utils.mm b/src/osx/cocoa/utils.mm index 225c9d487c..7307a6837a 100644 --- a/src/osx/cocoa/utils.mm +++ b/src/osx/cocoa/utils.mm @@ -305,10 +305,10 @@ wxMouseState wxGetMouseState() ms.SetMiddleDown( (buttons & 0x04) != 0 ); ms.SetRightDown( (buttons & 0x02) != 0 ); - ms.SetControlDown(modifiers & NSControlKeyMask); + ms.SetRealControlDown(modifiers & NSControlKeyMask); ms.SetShiftDown(modifiers & NSShiftKeyMask); ms.SetAltDown(modifiers & NSAlternateKeyMask); - ms.SetMetaDown(modifiers & NSCommandKeyMask); + ms.SetControlDown(modifiers & NSCommandKeyMask); return ms; } diff --git a/src/osx/cocoa/window.mm b/src/osx/cocoa/window.mm index ec4381d4c0..ce90d2f800 100644 --- a/src/osx/cocoa/window.mm +++ b/src/osx/cocoa/window.mm @@ -137,7 +137,7 @@ NSRect wxOSXGetFrameForControl( wxWindowMac* window , const wxPoint& pos , const - (void)setImagePosition:(NSCellImagePosition)aPosition; @end -long wxOSXTranslateCocoaKey( NSEvent* event ) +long wxOSXTranslateCocoaKey( NSEvent* event, int eventType ) { long retval = 0; @@ -147,54 +147,61 @@ long wxOSXTranslateCocoaKey( NSEvent* event ) // backspace char reports as delete w/modifiers for some reason if ([s length] == 1) { - switch ( [s characterAtIndex:0] ) + if ( eventType == wxEVT_CHAR && ([event modifierFlags] & NSControlKeyMask) && ( [s characterAtIndex:0] >= 'a' && [s characterAtIndex:0] <= 'z' ) ) { - // backspace key - case 0x7F : - case 8 : - retval = WXK_BACK; - break; - case NSUpArrowFunctionKey : - retval = WXK_UP; - break; - case NSDownArrowFunctionKey : - retval = WXK_DOWN; - break; - case NSLeftArrowFunctionKey : - retval = WXK_LEFT; - break; - case NSRightArrowFunctionKey : - retval = WXK_RIGHT; - break; - case NSInsertFunctionKey : - retval = WXK_INSERT; - break; - case NSDeleteFunctionKey : - retval = WXK_DELETE; - break; - case NSHomeFunctionKey : - retval = WXK_HOME; - break; - // case NSBeginFunctionKey : - // retval = WXK_BEGIN; - // break; - case NSEndFunctionKey : - retval = WXK_END; - break; - case NSPageUpFunctionKey : - retval = WXK_PAGEUP; - break; - case NSPageDownFunctionKey : - retval = WXK_PAGEDOWN; - break; - case NSHelpFunctionKey : - retval = WXK_HELP; - break; - default: - int intchar = [s characterAtIndex: 0]; - if ( intchar >= NSF1FunctionKey && intchar <= NSF24FunctionKey ) - retval = WXK_F1 + (intchar - NSF1FunctionKey ); - break; + retval = WXK_CONTROL_A + ([s characterAtIndex:0] - 'a'); + } + else + { + switch ( [s characterAtIndex:0] ) + { + // backspace key + case 0x7F : + case 8 : + retval = WXK_BACK; + break; + case NSUpArrowFunctionKey : + retval = WXK_UP; + break; + case NSDownArrowFunctionKey : + retval = WXK_DOWN; + break; + case NSLeftArrowFunctionKey : + retval = WXK_LEFT; + break; + case NSRightArrowFunctionKey : + retval = WXK_RIGHT; + break; + case NSInsertFunctionKey : + retval = WXK_INSERT; + break; + case NSDeleteFunctionKey : + retval = WXK_DELETE; + break; + case NSHomeFunctionKey : + retval = WXK_HOME; + break; + // case NSBeginFunctionKey : + // retval = WXK_BEGIN; + // break; + case NSEndFunctionKey : + retval = WXK_END; + break; + case NSPageUpFunctionKey : + retval = WXK_PAGEUP; + break; + case NSPageDownFunctionKey : + retval = WXK_PAGEDOWN; + break; + case NSHelpFunctionKey : + retval = WXK_HELP; + break; + default: + int intchar = [s characterAtIndex: 0]; + if ( intchar >= NSF1FunctionKey && intchar <= NSF24FunctionKey ) + retval = WXK_F1 + (intchar - NSF1FunctionKey ); + break; + } } } } @@ -207,7 +214,7 @@ long wxOSXTranslateCocoaKey( NSEvent* event ) // command key case 54: case 55: - retval = WXK_COMMAND; + retval = WXK_CONTROL; break; // caps locks key case 57: // Capslock @@ -226,7 +233,7 @@ long wxOSXTranslateCocoaKey( NSEvent* event ) // ctrl key case 59: // Left Ctrl case 62: // Right Ctrl - retval = WXK_CONTROL; + retval = WXK_RAW_CONTROL; break; // clear key case 71: @@ -298,9 +305,9 @@ void wxWidgetCocoaImpl::SetupKeyEvent(wxKeyEvent &wxevent , NSEvent * nsEvent, N int eventType = [nsEvent type]; wxevent.m_shiftDown = modifiers & NSShiftKeyMask; - wxevent.m_controlDown = modifiers & NSControlKeyMask; + wxevent.m_rawControlDown = modifiers & NSControlKeyMask; wxevent.m_altDown = modifiers & NSAlternateKeyMask; - wxevent.m_metaDown = modifiers & NSCommandKeyMask; + wxevent.m_controlDown = modifiers & NSCommandKeyMask; wxevent.m_rawCode = [nsEvent keyCode]; wxevent.m_rawFlags = modifiers; @@ -310,7 +317,7 @@ void wxWidgetCocoaImpl::SetupKeyEvent(wxKeyEvent &wxevent , NSEvent * nsEvent, N wxString chars; if ( eventType != NSFlagsChanged ) { - NSString* nschars = [nsEvent charactersIgnoringModifiers]; + NSString* nschars = [[nsEvent charactersIgnoringModifiers] uppercaseString]; if ( charString ) { // if charString is set, it did not come from key up / key down @@ -328,7 +335,7 @@ void wxWidgetCocoaImpl::SetupKeyEvent(wxKeyEvent &wxevent , NSEvent * nsEvent, N if (wxevent.GetEventType() != wxEVT_CHAR) { - keyval = wxOSXTranslateCocoaKey(nsEvent) ; + keyval = wxOSXTranslateCocoaKey(nsEvent, wxevent.GetEventType()) ; switch (eventType) { case NSKeyDown : @@ -349,8 +356,8 @@ void wxWidgetCocoaImpl::SetupKeyEvent(wxKeyEvent &wxevent , NSEvent * nsEvent, N case WXK_ALT: wxevent.SetEventType( wxevent.m_altDown ? wxEVT_KEY_DOWN : wxEVT_KEY_UP); break; - case WXK_COMMAND: - wxevent.SetEventType( wxevent.m_metaDown ? wxEVT_KEY_DOWN : wxEVT_KEY_UP); + case WXK_RAW_CONTROL: + wxevent.SetEventType( wxevent.m_rawControlDown ? wxEVT_KEY_DOWN : wxEVT_KEY_UP); break; } break; @@ -427,9 +434,9 @@ void wxWidgetCocoaImpl::SetupMouseEvent( wxMouseEvent &wxevent , NSEvent * nsEve wxevent.m_x = locationInViewWX.x; wxevent.m_y = locationInViewWX.y; wxevent.m_shiftDown = modifiers & NSShiftKeyMask; - wxevent.m_controlDown = modifiers & NSControlKeyMask; + wxevent.m_rawControlDown = modifiers & NSControlKeyMask; wxevent.m_altDown = modifiers & NSAlternateKeyMask; - wxevent.m_metaDown = modifiers & NSCommandKeyMask; + wxevent.m_controlDown = modifiers & NSCommandKeyMask; wxevent.SetTimestamp( (int)([nsEvent timestamp] * 1000) ) ; UInt32 mouseChord = 0; @@ -2128,11 +2135,14 @@ bool wxWidgetCocoaImpl::DoHandleKeyEvent(NSEvent *event) { if ( IsUserPane() && [event type] == NSKeyDown) { - if ( wxevent.GetKeyCode() < WXK_SPACE || wxevent.GetKeyCode() == WXK_DELETE || wxevent.GetKeyCode() >= WXK_START ) + long keycode = wxOSXTranslateCocoaKey( event, wxEVT_CHAR ); + + if ( (keycode > 0 && keycode < WXK_SPACE) || keycode == WXK_DELETE || keycode >= WXK_START ) { // eventually we could setup a doCommandBySelector catcher and retransform this into the wx key chars wxKeyEvent wxevent2(wxevent) ; wxevent2.SetEventType(wxEVT_CHAR); + wxevent2.m_keyCode = keycode; result = GetWXPeer()->OSXHandleKeyEvent(wxevent2); } else diff --git a/src/osx/dataview_osx.cpp b/src/osx/dataview_osx.cpp index c239ca35ff..490f6d9fd7 100644 --- a/src/osx/dataview_osx.cpp +++ b/src/osx/dataview_osx.cpp @@ -535,15 +535,9 @@ wxRect wxDataViewCtrl::GetItemRect(wxDataViewItem const& item, wxDataViewColumn return wxRect(); } -wxDataViewItem wxDataViewCtrl::GetSelection() const +int wxDataViewCtrl::GetSelectedItemsCount() const { - wxDataViewItemArray itemIDs; - - - if (GetDataViewPeer()->GetSelections(itemIDs) > 0) - return itemIDs[0]; - else - return wxDataViewItem(); + return GetDataViewPeer()->GetSelectedItemsCount(); } int wxDataViewCtrl::GetSelections(wxDataViewItemArray& sel) const diff --git a/src/osx/notebook_osx.cpp b/src/osx/notebook_osx.cpp index 0f0ea5f37b..68ff2095b5 100644 --- a/src/osx/notebook_osx.cpp +++ b/src/osx/notebook_osx.cpp @@ -145,7 +145,7 @@ bool wxNotebook::SetPageImage(size_t nPage, int nImage) { wxCHECK_MSG( IS_VALID_PAGE(nPage), false, wxT("SetPageImage: invalid notebook page") ); - wxCHECK_MSG( m_imageList && nImage < m_imageList->GetImageCount(), false, + wxCHECK_MSG( HasImageList() && nImage < GetImageList()->GetImageCount(), false, wxT("SetPageImage: invalid image index") ); if ( nImage != m_images[nPage] ) diff --git a/src/richtext/richtextformatdlg.cpp b/src/richtext/richtextformatdlg.cpp index 768ef405b0..032268117c 100644 --- a/src/richtext/richtextformatdlg.cpp +++ b/src/richtext/richtextformatdlg.cpp @@ -94,7 +94,6 @@ wxRichTextFormattingDialogFactory* wxRichTextFormattingDialog::ms_FormattingDial void wxRichTextFormattingDialog::Init() { - m_imageList = NULL; m_styleDefinition = NULL; m_styleSheet = NULL; m_object = NULL; @@ -102,7 +101,6 @@ void wxRichTextFormattingDialog::Init() wxRichTextFormattingDialog::~wxRichTextFormattingDialog() { - delete m_imageList; delete m_styleDefinition; } diff --git a/src/richtext/richtexthtml.cpp b/src/richtext/richtexthtml.cpp index 06670cb486..f9a24d9c9f 100644 --- a/src/richtext/richtexthtml.cpp +++ b/src/richtext/richtexthtml.cpp @@ -588,7 +588,7 @@ const wxChar* wxRichTextHTMLHandler::GetMimeType(int imageType) { case wxBITMAP_TYPE_BMP: return wxT("image/bmp"); - case wxBITMAP_TYPE_TIF: + case wxBITMAP_TYPE_TIFF: return wxT("image/tiff"); case wxBITMAP_TYPE_GIF: return wxT("image/gif"); diff --git a/src/univ/notebook.cpp b/src/univ/notebook.cpp index 0bd4942765..44129b423b 100644 --- a/src/univ/notebook.cpp +++ b/src/univ/notebook.cpp @@ -191,8 +191,8 @@ bool wxNotebook::SetPageImage(size_t nPage, int nImage) { wxCHECK_MSG( IS_VALID_PAGE(nPage), false, wxT("invalid notebook page") ); - wxCHECK_MSG( m_imageList && nImage < m_imageList->GetImageCount(), false, - wxT("invalid image index in SetPageImage()") ); + wxCHECK_MSG( HasImageList() && nImage < GetImageList()->GetImageCount(), + false, wxT("invalid image index in SetPageImage()") ); if ( nImage != m_images[nPage] ) { @@ -472,15 +472,15 @@ void wxNotebook::DoDrawTab(wxDC& dc, const wxRect& rect, size_t n) // used for wxUniversal under MSW #if 0 // def __WXMSW__ // FIXME int w, h; - m_imageList->GetSize(n, w, h); + GetImageList()->GetSize(n, w, h); bmp.Create(w, h); wxMemoryDC dc; dc.SelectObject(bmp); dc.SetBackground(wxBrush(GetBackgroundColour(), wxSOLID)); - m_imageList->Draw(image, dc, 0, 0, wxIMAGELIST_DRAW_NORMAL, true); + GetImageList()->Draw(image, dc, 0, 0, wxIMAGELIST_DRAW_NORMAL, true); dc.SelectObject(wxNullBitmap); #else - bmp = m_imageList->GetBitmap(image); + bmp = GetImageList()->GetBitmap(image); #endif } @@ -829,7 +829,7 @@ wxSize wxNotebook::CalcTabSize(int page) const if ( HasImage(page) ) { wxSize sizeImage; - m_imageList->GetSize(m_images[page], sizeImage.x, sizeImage.y); + GetImageList()->GetSize(m_images[page], sizeImage.x, sizeImage.y); size.x += sizeImage.x + 5; // FIXME: hard coded margin diff --git a/src/xrc/xh_bannerwindow.cpp b/src/xrc/xh_bannerwindow.cpp new file mode 100644 index 0000000000..6507c85500 --- /dev/null +++ b/src/xrc/xh_bannerwindow.cpp @@ -0,0 +1,88 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: srx/xrc/xh_bannerwindow.h +// Purpose: Implementation of wxBannerWindow XRC handler. +// Author: Vadim Zeitlin +// Created: 2011-08-16 +// RCS-ID: $Id$ +// Copyright: (c) 2011 Vadim Zeitlin +// Licence: wxWindows licence +/////////////////////////////////////////////////////////////////////////////// + +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#if wxUSE_XRC && wxUSE_BANNERWINDOW + +#include "wx/xrc/xh_bannerwindow.h" +#include "wx/bannerwindow.h" + +wxIMPLEMENT_DYNAMIC_CLASS(wxBannerWindowXmlHandler, wxXmlResourceHandler) + +wxBannerWindowXmlHandler::wxBannerWindowXmlHandler() + : wxXmlResourceHandler() +{ + AddWindowStyles(); +} + +wxObject *wxBannerWindowXmlHandler::DoCreateResource() +{ + XRC_MAKE_INSTANCE(banner, wxBannerWindow) + + banner->Create(m_parentAsWindow, + GetID(), + GetDirection(wxS("direction")), + GetPosition(), + GetSize(), + GetStyle(wxS("style")), + GetName()); + + SetupWindow(banner); + + const wxColour colStart = GetColour(wxS("gradient-start")); + const wxColour colEnd = GetColour(wxS("gradient-end")); + if ( colStart.IsOk() || colEnd.IsOk() ) + { + if ( !colStart.IsOk() || !colEnd.IsOk() ) + { + ReportError + ( + "Both start and end gradient colours must be " + "specified if either one is." + ); + } + else + { + banner->SetGradient(colStart, colEnd); + } + } + + wxBitmap bitmap = GetBitmap(); + if ( bitmap.IsOk() ) + { + if ( colStart.IsOk() || colEnd.IsOk() ) + { + ReportError + ( + "Gradient colours are ignored by wxBannerWindow " + "if the background bitmap is specified." + ); + } + + banner->SetBitmap(bitmap); + } + + banner->SetText(GetText(wxS("title")), GetText(wxS("message"))); + + return banner; +} + +bool wxBannerWindowXmlHandler::CanHandle(wxXmlNode *node) +{ + return IsOfClass(node, wxS("wxBannerWindow")); +} + +#endif // wxUSE_XRC && wxUSE_BANNERWINDOW diff --git a/src/xrc/xh_bttn.cpp b/src/xrc/xh_bttn.cpp index 926b6849b9..7f2058cdd2 100644 --- a/src/xrc/xh_bttn.cpp +++ b/src/xrc/xh_bttn.cpp @@ -53,33 +53,8 @@ wxObject *wxButtonXmlHandler::DoCreateResource() if ( GetParamNode("bitmap") ) { - wxDirection dir; - const wxString dirstr = GetParamValue("bitmapposition"); - if ( dirstr.empty() || dirstr == "wxLEFT" ) - dir = wxLEFT; - else if ( dirstr == "wxRIGHT" ) - dir = wxRIGHT; - else if ( dirstr == "wxTOP" ) - dir = wxTOP; - else if ( dirstr == "wxBOTTOM" ) - dir = wxBOTTOM; - else - { - ReportError - ( - GetParamNode("bitmapposition"), - wxString::Format - ( - "Invalid bitmap position \"%s\": must be one of " - "wxLEFT|wxRIGHT|wxTOP|wxBOTTOM.", - dirstr - ) - ); - - dir = wxLEFT; - } - - button->SetBitmap(GetBitmap("bitmap", wxART_BUTTON), dir); + button->SetBitmap(GetBitmap("bitmap", wxART_BUTTON), + GetDirection("bitmapposition")); } SetupWindow(button); diff --git a/src/xrc/xmlres.cpp b/src/xrc/xmlres.cpp index 95525ac90a..7a3041e630 100644 --- a/src/xrc/xmlres.cpp +++ b/src/xrc/xmlres.cpp @@ -2150,6 +2150,40 @@ wxCoord wxXmlResourceHandler::GetDimension(const wxString& param, return sx; } +wxDirection +wxXmlResourceHandler::GetDirection(const wxString& param, wxDirection dirDefault) +{ + wxDirection dir; + + const wxString dirstr = GetParamValue(param); + if ( dirstr.empty() ) + dir = dirDefault; + else if ( dirstr == "wxLEFT" ) + dir = wxLEFT; + else if ( dirstr == "wxRIGHT" ) + dir = wxRIGHT; + else if ( dirstr == "wxTOP" ) + dir = wxTOP; + else if ( dirstr == "wxBOTTOM" ) + dir = wxBOTTOM; + else + { + ReportError + ( + GetParamNode(param), + wxString::Format + ( + "Invalid direction \"%s\": must be one of " + "wxLEFT|wxRIGHT|wxTOP|wxBOTTOM.", + dirstr + ) + ); + + dir = dirDefault; + } + + return dir; +} // Get system font index using indexname static wxFont GetSystemFont(const wxString& name) diff --git a/src/xrc/xmlrsall.cpp b/src/xrc/xmlrsall.cpp index b116c5d994..993b8de982 100644 --- a/src/xrc/xmlrsall.cpp +++ b/src/xrc/xmlrsall.cpp @@ -38,6 +38,9 @@ void wxXmlResource::InitAllHandlers() #if wxUSE_ANIMATIONCTRL AddHandler(new wxAnimationCtrlXmlHandler); #endif +#if wxUSE_BANNERWINDOW + AddHandler(new wxBannerWindowXmlHandler); +#endif #if wxUSE_BITMAPCOMBOBOX AddHandler(new wxBitmapComboBoxXmlHandler); #endif diff --git a/tests/Makefile.in b/tests/Makefile.in index 396d64ab28..8df2f3c8e9 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -922,7 +922,17 @@ test_gui_xrctest.o: $(srcdir)/xml/xrctest.cpp $(TEST_GUI_ODEP) # warnings don't matter when we expect compilation to fail anyhow so we can # use this variable to enable the compilation of code which is supposed to # fail -failtest: +failtest: failtest_combobox failtest_evthandler + +failtest_combobox: + @$(RM) test_gui_comboboxtest.o + if $(MAKE) CXXWARNINGS=-DTEST_INVALID_COMBOBOX_ISEMPTY test_gui_comboboxtest.o 2>/dev/null; then \ + echo "*** Compilation with TEST_INVALID_COMBOBOX_ISEMPTY unexpectedly succeeded.">&2; \ + exit 1; \ + fi; \ + exit 0 + +failtest_evthandler: @$(RM) test_evthandler.o @for d in GLOBAL STATIC METHOD FUNCTOR NO_HANDLER DERIVED WRONG_CLASS; do \ if $(MAKE) CXXWARNINGS=-DTEST_INVALID_BIND_$$d test_evthandler.o 2>/dev/null; then \ diff --git a/tests/controls/comboboxtest.cpp b/tests/controls/comboboxtest.cpp index 3086578c7f..a624d62d60 100644 --- a/tests/controls/comboboxtest.cpp +++ b/tests/controls/comboboxtest.cpp @@ -62,12 +62,14 @@ private: CPPUNIT_TEST( PopDismiss ); CPPUNIT_TEST( Sort ); CPPUNIT_TEST( ReadOnly ); + CPPUNIT_TEST( IsEmpty ); CPPUNIT_TEST_SUITE_END(); void Size(); void PopDismiss(); void Sort(); void ReadOnly(); + void IsEmpty(); wxComboBox *m_combo; @@ -194,4 +196,27 @@ void ComboBoxTestCase::ReadOnly() #endif } +void ComboBoxTestCase::IsEmpty() +{ + CPPUNIT_ASSERT( m_combo->IsListEmpty() ); + CPPUNIT_ASSERT( m_combo->IsTextEmpty() ); + + m_combo->Append("foo"); + CPPUNIT_ASSERT( !m_combo->IsListEmpty() ); + CPPUNIT_ASSERT( m_combo->IsTextEmpty() ); + + m_combo->SetValue("bar"); + CPPUNIT_ASSERT( !m_combo->IsListEmpty() ); + CPPUNIT_ASSERT( !m_combo->IsTextEmpty() ); + + m_combo->Clear(); + CPPUNIT_ASSERT( m_combo->IsListEmpty() ); + CPPUNIT_ASSERT( m_combo->IsTextEmpty() ); + +#ifdef TEST_INVALID_COMBOBOX_ISEMPTY + // Compiling this should fail, see failtest target definition in test.bkl. + m_combo->IsEmpty(); +#endif +} + #endif //wxUSE_COMBOBOX diff --git a/tests/controls/dataviewctrltest.cpp b/tests/controls/dataviewctrltest.cpp index 60d1a38270..76e3dfd865 100644 --- a/tests/controls/dataviewctrltest.cpp +++ b/tests/controls/dataviewctrltest.cpp @@ -40,10 +40,19 @@ private: CPPUNIT_TEST_SUITE( DataViewCtrlTestCase ); CPPUNIT_TEST( DeleteSelected ); CPPUNIT_TEST( DeleteNotSelected ); + CPPUNIT_TEST( GetSelectionForMulti ); + CPPUNIT_TEST( GetSelectionForSingle ); CPPUNIT_TEST_SUITE_END(); + // Create wxDataViewTreeCtrl with the given style. + void Create(long style); + void DeleteSelected(); void DeleteNotSelected(); + void GetSelectionForMulti(); + void GetSelectionForSingle(); + + void TestSelectionFor0and1(); // the dataview control itself wxDataViewTreeCtrl *m_dvc; @@ -67,13 +76,13 @@ CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( DataViewCtrlTestCase, "DataViewCtrlTestCa // test initialization // ---------------------------------------------------------------------------- -void DataViewCtrlTestCase::setUp() +void DataViewCtrlTestCase::Create(long style) { m_dvc = new wxDataViewTreeCtrl(wxTheApp->GetTopWindow(), wxID_ANY, wxDefaultPosition, wxSize(400, 200), - wxDV_MULTIPLE); + style); m_root = m_dvc->AppendContainer(wxDataViewItem(), "The root"); m_child1 = m_dvc->AppendContainer(m_root, "child1"); @@ -86,6 +95,11 @@ void DataViewCtrlTestCase::setUp() m_dvc->Update(); } +void DataViewCtrlTestCase::setUp() +{ + Create(wxDV_MULTIPLE); +} + void DataViewCtrlTestCase::tearDown() { delete m_dvc; @@ -115,7 +129,7 @@ void DataViewCtrlTestCase::DeleteSelected() m_dvc->GetSelections(sel); // m_child1 and its children should be removed from the selection now - CPPUNIT_ASSERT( sel.size() == 1 ); + CPPUNIT_ASSERT_EQUAL( 1, sel.size() ); CPPUNIT_ASSERT( sel[0] == m_child2 ); } @@ -131,10 +145,55 @@ void DataViewCtrlTestCase::DeleteNotSelected() m_dvc->GetSelections(sel); - // m_child1 and its children should be removed from the selection now - CPPUNIT_ASSERT( sel.size() == 2 ); + // m_child1 and its children should be unaffected + CPPUNIT_ASSERT_EQUAL( 2, sel.size() ); CPPUNIT_ASSERT( sel[0] == m_child1 ); CPPUNIT_ASSERT( sel[1] == m_grandchild ); } -#endif //wxUSE_TREECTRL +void DataViewCtrlTestCase::TestSelectionFor0and1() +{ + wxDataViewItemArray selections; + + // Initially there is no selection. + CPPUNIT_ASSERT_EQUAL( 0, m_dvc->GetSelectedItemsCount() ); + CPPUNIT_ASSERT( !m_dvc->HasSelection() ); + CPPUNIT_ASSERT( !m_dvc->GetSelection().IsOk() ); + + CPPUNIT_ASSERT( !m_dvc->GetSelections(selections) ); + CPPUNIT_ASSERT( selections.empty() ); + + // Select one item. + m_dvc->Select(m_child1); + CPPUNIT_ASSERT_EQUAL( 1, m_dvc->GetSelectedItemsCount() ); + CPPUNIT_ASSERT( m_dvc->HasSelection() ); + CPPUNIT_ASSERT( m_dvc->GetSelection().IsOk() ); + CPPUNIT_ASSERT_EQUAL( 1, m_dvc->GetSelections(selections) ); + CPPUNIT_ASSERT( selections[0] == m_child1 ); +} + +void DataViewCtrlTestCase::GetSelectionForMulti() +{ + wxDataViewItemArray selections; + + TestSelectionFor0and1(); + + // Also test with more than one selected item. + m_dvc->Select(m_child2); + + CPPUNIT_ASSERT_EQUAL( 2, m_dvc->GetSelectedItemsCount() ); + CPPUNIT_ASSERT( m_dvc->HasSelection() ); + CPPUNIT_ASSERT( !m_dvc->GetSelection().IsOk() ); + CPPUNIT_ASSERT_EQUAL( 2, m_dvc->GetSelections(selections) ); + CPPUNIT_ASSERT( selections[1] == m_child2 ); +} + +void DataViewCtrlTestCase::GetSelectionForSingle() +{ + delete m_dvc; + Create(0); + + TestSelectionFor0and1(); +} + +#endif //wxUSE_DATAVIEWCTRL diff --git a/tests/image/image.cpp b/tests/image/image.cpp index 0350dcbfa9..d063621dcc 100644 --- a/tests/image/image.cpp +++ b/tests/image/image.cpp @@ -50,7 +50,7 @@ struct testData { { "horse.pcx", wxBITMAP_TYPE_PCX, 8 }, { "horse.pnm", wxBITMAP_TYPE_PNM, 24 }, { "horse.tga", wxBITMAP_TYPE_TGA, 8 }, - { "horse.tif", wxBITMAP_TYPE_TIF, 8 } + { "horse.tif", wxBITMAP_TYPE_TIFF, 8 } }; @@ -192,7 +192,7 @@ void ImageTestCase::LoadFromZipStream() case wxBITMAP_TYPE_GIF: case wxBITMAP_TYPE_PCX: case wxBITMAP_TYPE_TGA: - case wxBITMAP_TYPE_TIF: + case wxBITMAP_TYPE_TIFF: continue; // skip testing those wxImageHandlers which cannot // load data from non-seekable streams @@ -1097,7 +1097,7 @@ static void TestTIFFImage(const wxString& option, int value) wxMemoryOutputStream memOut; image.SetOption(option, value); - CPPUNIT_ASSERT(image.SaveFile(memOut, wxBITMAP_TYPE_TIF)); + CPPUNIT_ASSERT(image.SaveFile(memOut, wxBITMAP_TYPE_TIFF)); wxMemoryInputStream memIn(memOut); CPPUNIT_ASSERT(memIn.IsOk()); diff --git a/tests/test.bkl b/tests/test.bkl index ba5bf00ae7..d650f8d470 100644 --- a/tests/test.bkl +++ b/tests/test.bkl @@ -253,7 +253,17 @@ # warnings don't matter when we expect compilation to fail anyhow so we can # use this variable to enable the compilation of code which is supposed to # fail -failtest: +failtest: failtest_combobox failtest_evthandler + +failtest_combobox: + @$(RM) test_gui_comboboxtest.o + if $(MAKE) CXXWARNINGS=-DTEST_INVALID_COMBOBOX_ISEMPTY test_gui_comboboxtest.o 2>/dev/null; then \ + echo "*** Compilation with TEST_INVALID_COMBOBOX_ISEMPTY unexpectedly succeeded.">&2; \ + exit 1; \ + fi; \ + exit 0 + +failtest_evthandler: @$(RM) test_evthandler.o @for d in GLOBAL STATIC METHOD FUNCTOR NO_HANDLER DERIVED WRONG_CLASS; do \ if $(MAKE) CXXWARNINGS=-DTEST_INVALID_BIND_$$d test_evthandler.o 2>/dev/null; then \ diff --git a/utils/emulator/src/emulator.cpp b/utils/emulator/src/emulator.cpp index e7f1545b17..f033ac1774 100644 --- a/utils/emulator/src/emulator.cpp +++ b/utils/emulator/src/emulator.cpp @@ -534,7 +534,7 @@ wxBitmapType wxDetermineImageType(const wxString& filename) if (ext == wxT("pcx")) return wxBITMAP_TYPE_PCX; if (ext == wxT("tif") || ext == wxT("tiff")) - return wxBITMAP_TYPE_TIF; + return wxBITMAP_TYPE_TIFF; return wxBITMAP_TYPE_INVALID; }