diff --git a/Makefile.in b/Makefile.in index 76f9337520..04eaa957f2 100644 --- a/Makefile.in +++ b/Makefile.in @@ -3314,7 +3314,6 @@ COND_TOOLKIT_OSX_COCOA_GUI_HDR = \ wx/osx/fontdlg.h \ wx/osx/frame.h \ wx/osx/gauge.h \ - wx/osx/imaglist.h \ wx/osx/listbox.h \ wx/osx/listctrl.h \ wx/osx/mdi.h \ @@ -3368,6 +3367,7 @@ COND_TOOLKIT_OSX_COCOA_GUI_HDR = \ wx/generic/statusbr.h \ wx/osx/appprogress.h \ wx/generic/icon.h \ + wx/generic/imaglist.h \ wx/osx/cocoa/chkconf.h \ wx/osx/cocoa/evtloop.h \ wx/osx/cocoa/private.h \ @@ -3424,7 +3424,6 @@ COND_TOOLKIT_OSX_IPHONE_GUI_HDR = \ wx/osx/fontdlg.h \ wx/osx/frame.h \ wx/osx/gauge.h \ - wx/osx/imaglist.h \ wx/osx/listbox.h \ wx/osx/listctrl.h \ wx/osx/mdi.h \ @@ -3478,6 +3477,7 @@ COND_TOOLKIT_OSX_IPHONE_GUI_HDR = \ wx/generic/statusbr.h \ wx/osx/appprogress.h \ wx/generic/icon.h \ + wx/generic/imaglist.h \ wx/osx/iphone/chkconf.h \ wx/osx/iphone/evtloop.h \ wx/osx/iphone/private.h \ @@ -13174,7 +13174,8 @@ COND_PLATFORM_MACOSX_1___OSX_COMMON_SRC_OBJECTS = \ monodll_generic_statusbr.o \ monodll_generic_textmeasure.o \ monodll_generic_icon.o \ - monodll_statbmp_osx.o + monodll_statbmp_osx.o \ + monodll_generic_imaglist.o @COND_PLATFORM_MACOSX_1@__OSX_COMMON_SRC_OBJECTS = $(COND_PLATFORM_MACOSX_1___OSX_COMMON_SRC_OBJECTS) COND_PLATFORM_MACOSX_1___GTK_PLATFORM_SRC_OBJECTS = \ monodll_generic_caret.o \ @@ -13225,7 +13226,6 @@ COND_PLATFORM_MACOSX_1___OSX_LOWLEVEL_SRC_OBJECTS = \ monodll_osx_brush.o \ monodll_dialog_osx.o \ monodll_osx_fontutil.o \ - monodll_osx_imaglist.o \ monodll_osx_minifram.o \ monodll_nonownedwnd_osx.o \ monodll_osx_palette.o \ @@ -13315,7 +13315,8 @@ COND_PLATFORM_MACOSX_1___OSX_COMMON_SRC_OBJECTS_0 = \ monolib_generic_statusbr.o \ monolib_generic_textmeasure.o \ monolib_generic_icon.o \ - monolib_statbmp_osx.o + monolib_statbmp_osx.o \ + monolib_generic_imaglist.o @COND_PLATFORM_MACOSX_1@__OSX_COMMON_SRC_OBJECTS_0 = $(COND_PLATFORM_MACOSX_1___OSX_COMMON_SRC_OBJECTS_0) COND_PLATFORM_MACOSX_1___GTK_PLATFORM_SRC_OBJECTS_27 = \ monolib_generic_caret.o \ @@ -13366,7 +13367,6 @@ COND_PLATFORM_MACOSX_1___OSX_LOWLEVEL_SRC_OBJECTS_17 = \ monolib_osx_brush.o \ monolib_dialog_osx.o \ monolib_osx_fontutil.o \ - monolib_osx_imaglist.o \ monolib_osx_minifram.o \ monolib_nonownedwnd_osx.o \ monolib_osx_palette.o \ @@ -13456,7 +13456,8 @@ COND_PLATFORM_MACOSX_1___OSX_COMMON_SRC_OBJECTS_8 = \ coredll_generic_statusbr.o \ coredll_generic_textmeasure.o \ coredll_generic_icon.o \ - coredll_statbmp_osx.o + coredll_statbmp_osx.o \ + coredll_generic_imaglist.o @COND_PLATFORM_MACOSX_1@__OSX_COMMON_SRC_OBJECTS_8 = $(COND_PLATFORM_MACOSX_1___OSX_COMMON_SRC_OBJECTS_8) COND_PLATFORM_MACOSX_1___GTK_PLATFORM_SRC_OBJECTS_1_4 = \ coredll_generic_caret.o \ @@ -13507,7 +13508,6 @@ COND_PLATFORM_MACOSX_1___OSX_LOWLEVEL_SRC_OBJECTS_1_1 = \ coredll_osx_brush.o \ coredll_dialog_osx.o \ coredll_osx_fontutil.o \ - coredll_osx_imaglist.o \ coredll_osx_minifram.o \ coredll_nonownedwnd_osx.o \ coredll_osx_palette.o \ @@ -13594,7 +13594,8 @@ COND_PLATFORM_MACOSX_1___OSX_COMMON_SRC_OBJECTS_9 = \ corelib_generic_statusbr.o \ corelib_generic_textmeasure.o \ corelib_generic_icon.o \ - corelib_statbmp_osx.o + corelib_statbmp_osx.o \ + corelib_generic_imaglist.o @COND_PLATFORM_MACOSX_1@__OSX_COMMON_SRC_OBJECTS_9 = $(COND_PLATFORM_MACOSX_1___OSX_COMMON_SRC_OBJECTS_9) COND_PLATFORM_MACOSX_1___GTK_PLATFORM_SRC_OBJECTS_2_2 = \ corelib_generic_caret.o \ @@ -13645,7 +13646,6 @@ COND_PLATFORM_MACOSX_1___OSX_LOWLEVEL_SRC_OBJECTS_1_4 = \ corelib_osx_brush.o \ corelib_dialog_osx.o \ corelib_osx_fontutil.o \ - corelib_osx_imaglist.o \ corelib_osx_minifram.o \ corelib_nonownedwnd_osx.o \ corelib_osx_palette.o \ @@ -17549,6 +17549,12 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP) @COND_TOOLKIT_DFB_USE_GUI_1@monodll_generic_caret.o: $(srcdir)/src/generic/caret.cpp $(MONODLL_ODEP) @COND_TOOLKIT_DFB_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/generic/caret.cpp +@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@monodll_generic_imaglist.o: $(srcdir)/src/generic/imaglist.cpp $(MONODLL_ODEP) +@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/generic/imaglist.cpp + +@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@monodll_generic_imaglist.o: $(srcdir)/src/generic/imaglist.cpp $(MONODLL_ODEP) +@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/generic/imaglist.cpp + @COND_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@monodll_generic_imaglist.o: $(srcdir)/src/generic/imaglist.cpp $(MONODLL_ODEP) @COND_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/generic/imaglist.cpp @@ -18704,12 +18710,6 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@monodll_osx_fontutil.o: $(srcdir)/src/osx/fontutil.cpp $(MONODLL_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/osx/fontutil.cpp -@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@monodll_osx_imaglist.o: $(srcdir)/src/osx/imaglist.cpp $(MONODLL_ODEP) -@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/osx/imaglist.cpp - -@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@monodll_osx_imaglist.o: $(srcdir)/src/osx/imaglist.cpp $(MONODLL_ODEP) -@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/osx/imaglist.cpp - @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@monodll_osx_minifram.o: $(srcdir)/src/osx/minifram.cpp $(MONODLL_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/osx/minifram.cpp @@ -22802,6 +22802,12 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP) @COND_TOOLKIT_DFB_USE_GUI_1@monolib_generic_caret.o: $(srcdir)/src/generic/caret.cpp $(MONOLIB_ODEP) @COND_TOOLKIT_DFB_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/generic/caret.cpp +@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@monolib_generic_imaglist.o: $(srcdir)/src/generic/imaglist.cpp $(MONOLIB_ODEP) +@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/generic/imaglist.cpp + +@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@monolib_generic_imaglist.o: $(srcdir)/src/generic/imaglist.cpp $(MONOLIB_ODEP) +@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/generic/imaglist.cpp + @COND_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@monolib_generic_imaglist.o: $(srcdir)/src/generic/imaglist.cpp $(MONOLIB_ODEP) @COND_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/generic/imaglist.cpp @@ -23957,12 +23963,6 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@monolib_osx_fontutil.o: $(srcdir)/src/osx/fontutil.cpp $(MONOLIB_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/osx/fontutil.cpp -@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@monolib_osx_imaglist.o: $(srcdir)/src/osx/imaglist.cpp $(MONOLIB_ODEP) -@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/osx/imaglist.cpp - -@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@monolib_osx_imaglist.o: $(srcdir)/src/osx/imaglist.cpp $(MONOLIB_ODEP) -@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/osx/imaglist.cpp - @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@monolib_osx_minifram.o: $(srcdir)/src/osx/minifram.cpp $(MONOLIB_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/osx/minifram.cpp @@ -28148,6 +28148,12 @@ coredll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(COREDLL_ODEP) @COND_TOOLKIT_DFB_USE_GUI_1@coredll_generic_caret.o: $(srcdir)/src/generic/caret.cpp $(COREDLL_ODEP) @COND_TOOLKIT_DFB_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/generic/caret.cpp +@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@coredll_generic_imaglist.o: $(srcdir)/src/generic/imaglist.cpp $(COREDLL_ODEP) +@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/generic/imaglist.cpp + +@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@coredll_generic_imaglist.o: $(srcdir)/src/generic/imaglist.cpp $(COREDLL_ODEP) +@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/generic/imaglist.cpp + @COND_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@coredll_generic_imaglist.o: $(srcdir)/src/generic/imaglist.cpp $(COREDLL_ODEP) @COND_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/generic/imaglist.cpp @@ -29303,12 +29309,6 @@ coredll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(COREDLL_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@coredll_osx_fontutil.o: $(srcdir)/src/osx/fontutil.cpp $(COREDLL_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/osx/fontutil.cpp -@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@coredll_osx_imaglist.o: $(srcdir)/src/osx/imaglist.cpp $(COREDLL_ODEP) -@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/osx/imaglist.cpp - -@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@coredll_osx_imaglist.o: $(srcdir)/src/osx/imaglist.cpp $(COREDLL_ODEP) -@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/osx/imaglist.cpp - @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@coredll_osx_minifram.o: $(srcdir)/src/osx/minifram.cpp $(COREDLL_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/osx/minifram.cpp @@ -32396,6 +32396,12 @@ corelib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(CORELIB_ODEP) @COND_TOOLKIT_DFB_USE_GUI_1@corelib_generic_caret.o: $(srcdir)/src/generic/caret.cpp $(CORELIB_ODEP) @COND_TOOLKIT_DFB_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/generic/caret.cpp +@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@corelib_generic_imaglist.o: $(srcdir)/src/generic/imaglist.cpp $(CORELIB_ODEP) +@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/generic/imaglist.cpp + +@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@corelib_generic_imaglist.o: $(srcdir)/src/generic/imaglist.cpp $(CORELIB_ODEP) +@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/generic/imaglist.cpp + @COND_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@corelib_generic_imaglist.o: $(srcdir)/src/generic/imaglist.cpp $(CORELIB_ODEP) @COND_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/generic/imaglist.cpp @@ -33551,12 +33557,6 @@ corelib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(CORELIB_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@corelib_osx_fontutil.o: $(srcdir)/src/osx/fontutil.cpp $(CORELIB_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/osx/fontutil.cpp -@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@corelib_osx_imaglist.o: $(srcdir)/src/osx/imaglist.cpp $(CORELIB_ODEP) -@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/osx/imaglist.cpp - -@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@corelib_osx_imaglist.o: $(srcdir)/src/osx/imaglist.cpp $(CORELIB_ODEP) -@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/osx/imaglist.cpp - @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@corelib_osx_minifram.o: $(srcdir)/src/osx/minifram.cpp $(CORELIB_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/osx/minifram.cpp diff --git a/build/bakefiles/files.bkl b/build/bakefiles/files.bkl index 52d42891fe..863a733a94 100644 --- a/build/bakefiles/files.bkl +++ b/build/bakefiles/files.bkl @@ -2395,7 +2395,6 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! src/osx/brush.cpp src/osx/dialog_osx.cpp src/osx/fontutil.cpp - src/osx/imaglist.cpp src/osx/minifram.cpp src/osx/nonownedwnd_osx.cpp src/osx/palette.cpp @@ -2495,6 +2494,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! src/generic/textmeasure.cpp src/generic/icon.cpp src/osx/statbmp_osx.cpp + src/generic/imaglist.cpp @@ -2538,7 +2538,6 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! wx/osx/fontdlg.h wx/osx/frame.h wx/osx/gauge.h - wx/osx/imaglist.h wx/osx/listbox.h wx/osx/listctrl.h wx/osx/mdi.h @@ -2593,6 +2592,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! wx/generic/statusbr.h wx/osx/appprogress.h wx/generic/icon.h + wx/generic/imaglist.h diff --git a/build/cmake/files.cmake b/build/cmake/files.cmake index 999faa219e..455e2d2f11 100644 --- a/build/cmake/files.cmake +++ b/build/cmake/files.cmake @@ -2274,7 +2274,6 @@ set(OSX_LOWLEVEL_SRC src/osx/brush.cpp src/osx/dialog_osx.cpp src/osx/fontutil.cpp - src/osx/imaglist.cpp src/osx/minifram.cpp src/osx/nonownedwnd_osx.cpp src/osx/palette.cpp @@ -2373,6 +2372,7 @@ set(OSX_COMMON_SRC src/generic/icon.cpp #TODO: src/osx/statbmp_osx.cpp + src/generic/imaglist.cpp ) set(OSX_SHARED_HDR @@ -2414,7 +2414,6 @@ set(OSX_SHARED_HDR wx/osx/fontdlg.h wx/osx/frame.h wx/osx/gauge.h - wx/osx/imaglist.h wx/osx/listbox.h wx/osx/listctrl.h wx/osx/mdi.h @@ -2469,6 +2468,7 @@ set(OSX_SHARED_HDR wx/generic/statusbr.h wx/osx/appprogress.h wx/generic/icon.h + wx/generic/imaglist.h ) set(OSX_COCOA_SRC diff --git a/build/files b/build/files index d6fd3ea446..93c9fec7dd 100644 --- a/build/files +++ b/build/files @@ -2256,7 +2256,6 @@ OSX_LOWLEVEL_SRC = src/osx/brush.cpp src/osx/dialog_osx.cpp src/osx/fontutil.cpp - src/osx/imaglist.cpp src/osx/minifram.cpp src/osx/nonownedwnd_osx.cpp src/osx/palette.cpp @@ -2347,6 +2346,7 @@ OSX_COMMON_SRC = src/generic/fontdlgg.cpp src/generic/fontpickerg.cpp src/generic/icon.cpp + src/generic/imaglist.cpp src/generic/listctrl.cpp src/generic/prntdlgg.cpp src/generic/statusbr.cpp @@ -2393,7 +2393,6 @@ OSX_SHARED_HDR = wx/osx/fontdlg.h wx/osx/frame.h wx/osx/gauge.h - wx/osx/imaglist.h wx/osx/listbox.h wx/osx/listctrl.h wx/osx/mdi.h @@ -2444,6 +2443,7 @@ OSX_SHARED_HDR = wx/generic/fontdlgg.h wx/generic/fontpickerg.h wx/generic/icon.h + wx/generic/imaglist.h wx/generic/listctrl.h wx/generic/prntdlgg.h wx/generic/statusbr.h diff --git a/include/wx/generic/imaglist.h b/include/wx/generic/imaglist.h index f87e19b43c..a3189e4b5a 100644 --- a/include/wx/generic/imaglist.h +++ b/include/wx/generic/imaglist.h @@ -10,10 +10,11 @@ #ifndef _WX_IMAGLISTG_H_ #define _WX_IMAGLISTG_H_ +#include "wx/bitmap.h" #include "wx/gdicmn.h" +#include "wx/vector.h" class WXDLLIMPEXP_FWD_CORE wxDC; -class WXDLLIMPEXP_FWD_CORE wxBitmap; class WXDLLIMPEXP_FWD_CORE wxIcon; class WXDLLIMPEXP_FWD_CORE wxColour; @@ -21,23 +22,23 @@ class WXDLLIMPEXP_FWD_CORE wxColour; class WXDLLIMPEXP_CORE wxGenericImageList: public wxObject { public: - wxGenericImageList() { m_width = m_height = 0; } + wxGenericImageList() { } wxGenericImageList( int width, int height, bool mask = true, int initialCount = 1 ); virtual ~wxGenericImageList(); bool Create( int width, int height, bool mask = true, int initialCount = 1 ); - bool Create(); virtual int GetImageCount() const; virtual bool GetSize( int index, int &width, int &height ) const; - virtual wxSize GetSize() const { return wxSize(m_width, m_height); } + virtual wxSize GetSize() const { return m_size; } int Add( const wxBitmap& bitmap ); int Add( const wxBitmap& bitmap, const wxBitmap& mask ); int Add( const wxBitmap& bitmap, const wxColour& maskColour ); wxBitmap GetBitmap(int index) const; wxIcon GetIcon(int index) const; - bool Replace( int index, const wxBitmap &bitmap ); - bool Replace( int index, const wxBitmap &bitmap, const wxBitmap& mask ); + bool Replace( int index, + const wxBitmap& bitmap, + const wxBitmap& mask = wxNullBitmap ); bool Remove( int index ); bool RemoveAll(); @@ -45,13 +46,21 @@ public: int flags = wxIMAGELIST_DRAW_NORMAL, bool solidBackground = false); - // Internal use only - const wxBitmap *GetBitmapPtr(int index) const; -private: - wxObjectList m_images; +#if WXWIN_COMPATIBILITY_3_0 + wxDEPRECATED_MSG("Don't use this overload: it's not portable and does nothing") + bool Create() { return true; } - int m_width; - int m_height; + wxDEPRECATED_MSG("Use GetBitmap() instead") + const wxBitmap *GetBitmapPtr(int index) const { return DoGetPtr(index); } +#endif // WXWIN_COMPATIBILITY_3_0 + +private: + const wxBitmap *DoGetPtr(int index) const; + + wxVector m_images; + + // Size of a single bitmap in the list. + wxSize m_size; wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxGenericImageList); }; diff --git a/include/wx/imaglist.h b/include/wx/imaglist.h index d625eff324..5fd6a9f9a3 100644 --- a/include/wx/imaglist.h +++ b/include/wx/imaglist.h @@ -41,16 +41,11 @@ enum #define wxIMAGELIST_DRAW_SELECTED 0x0004 #define wxIMAGELIST_DRAW_FOCUSED 0x0008 -#if defined(__WXMSW__) || defined(__WXMAC__) - #define wxHAS_NATIVE_IMAGELIST -#endif - -#if !defined(wxHAS_NATIVE_IMAGELIST) - #include "wx/generic/imaglist.h" -#elif defined(__WXMSW__) +#if defined(__WXMSW__) #include "wx/msw/imaglist.h" -#elif defined(__WXMAC__) - #include "wx/osx/imaglist.h" + #define wxHAS_NATIVE_IMAGELIST +#else + #include "wx/generic/imaglist.h" #endif #endif // _WX_IMAGLIST_H_BASE_ diff --git a/include/wx/osx/imaglist.h b/include/wx/osx/imaglist.h deleted file mode 100644 index fdab2447bd..0000000000 --- a/include/wx/osx/imaglist.h +++ /dev/null @@ -1,60 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/osx/imaglist.h -// Purpose: -// Author: Robert Roebling, Stefan Csomor -// Created: 01/02/97 -// Id: -// Copyright: (c) 1998 Robert Roebling and Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_IMAGLIST_H_ -#define _WX_IMAGLIST_H_ - -#include "wx/defs.h" -#include "wx/list.h" -#include "wx/icon.h" - -class WXDLLIMPEXP_FWD_CORE wxDC; -class WXDLLIMPEXP_FWD_CORE wxBitmap; -class WXDLLIMPEXP_FWD_CORE wxColour; - -class WXDLLIMPEXP_CORE wxImageList: public wxObject -{ -public: - wxImageList() { m_width = m_height = 0; } - wxImageList( int width, int height, bool mask = true, int initialCount = 1 ); - virtual ~wxImageList(); - bool Create( int width, int height, bool mask = true, int initialCount = 1 ); - bool Create(); - - virtual int GetImageCount() const; - virtual bool GetSize( int index, int &width, int &height ) const; - virtual wxSize GetSize() const { return wxSize(m_width, m_height); } - - int Add( const wxBitmap& bitmap ); - int Add( const wxBitmap& bitmap, const wxBitmap& mask ); - int Add( const wxBitmap& bitmap, const wxColour& maskColour ); - wxBitmap GetBitmap(int index) const; - wxIcon GetIcon(int index) const; - bool Replace( int index, const wxIcon &bitmap ); - bool Replace( int index, const wxBitmap &bitmap ); - bool Replace( int index, const wxBitmap &bitmap, const wxBitmap &mask ); - bool Remove( int index ); - bool RemoveAll(); - - virtual bool Draw(int index, wxDC& dc, int x, int y, - int flags = wxIMAGELIST_DRAW_NORMAL, - bool solidBackground = false); - -private: - wxList m_images; - - int m_width; - int m_height; - - wxDECLARE_DYNAMIC_CLASS(wxImageList); -}; - -#endif // _WX_IMAGLIST_H_ - diff --git a/src/generic/imaglist.cpp b/src/generic/imaglist.cpp index 14c8127a80..771373ce00 100644 --- a/src/generic/imaglist.cpp +++ b/src/generic/imaglist.cpp @@ -42,62 +42,52 @@ wxGenericImageList::~wxGenericImageList() int wxGenericImageList::GetImageCount() const { - return m_images.GetCount(); + return static_cast(m_images.size()); } bool wxGenericImageList::Create( int width, int height, bool WXUNUSED(mask), int WXUNUSED(initialCount) ) { - m_width = width; - m_height = height; + m_size = wxSize(width, height); - return Create(); -} - -bool wxGenericImageList::Create() -{ return true; } int wxGenericImageList::Add( const wxBitmap &bitmap ) { - wxASSERT_MSG( (bitmap.GetWidth() >= m_width && bitmap.GetHeight() == m_height) - || (m_width == 0 && m_height == 0), - wxT("invalid bitmap size in wxImageList: this might work ") - wxT("on this platform but definitely won't under Windows.") ); + // We use the scaled, i.e. logical, size here as image list images size is + // specified in logical pixels, just as window coordinates and sizes are. + const wxSize bitmapSize = bitmap.GetScaledSize(); - const int index = int(m_images.GetCount()); - - if (bitmap.IsKindOf(wxCLASSINFO(wxIcon))) + if ( m_size == wxSize(0, 0) ) { - m_images.Append( new wxIcon( (const wxIcon&) bitmap ) ); + // This is the first time Add() is called and we hadn't had any fixed + // size: adopt the size of our first bitmap as image size. + m_size = bitmapSize; } - else + else // We already have a fixed size, check that the bitmap conforms to it. { - // Mimic behaviour of Windows ImageList_Add that automatically breaks up the added - // bitmap into sub-images of the correct size - if (m_width > 0 && bitmap.GetWidth() > m_width && bitmap.GetHeight() >= m_height) + // There is a special case: a bitmap may contain more than one image, + // in which case we're supposed to chop it in parts, just as Windows + // ImageList_Add() does. + if ( bitmapSize.x > m_size.x && (bitmapSize.x % m_size.x == 0) ) { - int numImages = bitmap.GetWidth() / m_width; + const int numImages = bitmapSize.x / m_size.x; for (int subIndex = 0; subIndex < numImages; subIndex++) { - wxRect rect(m_width * subIndex, 0, m_width, m_height); - wxBitmap tmpBmp = bitmap.GetSubBitmap(rect); - m_images.Append( new wxBitmap(tmpBmp) ); + wxRect rect(m_size.x * subIndex, 0, m_size.x, m_size.y); + Add(bitmap.GetSubBitmap(rect)); } + + return GetImageCount() - 1; } - else - { - m_images.Append( new wxBitmap(bitmap) ); - } + + wxASSERT_MSG( bitmapSize == m_size, + "All bitmaps in wxImageList must have the same size" ); } - if (m_width == 0 && m_height == 0) - { - m_width = bitmap.GetWidth(); - m_height = bitmap.GetHeight(); - } + m_images.push_back(bitmap); - return index; + return GetImageCount() - 1; } int wxGenericImageList::Add( const wxBitmap& bitmap, const wxBitmap& mask ) @@ -115,128 +105,79 @@ int wxGenericImageList::Add( const wxBitmap& bitmap, const wxColour& maskColour return Add(wxBitmap(img)); } -const wxBitmap *wxGenericImageList::GetBitmapPtr( int index ) const +const wxBitmap *wxGenericImageList::DoGetPtr( int index ) const { - wxObjectList::compatibility_iterator node = m_images.Item( index ); + wxCHECK_MSG( index >= 0 && (size_t)index < m_images.size(), + NULL, wxT("wrong index in image list") ); - wxCHECK_MSG( node, NULL, wxT("wrong index in image list") ); - - return (wxBitmap*)node->GetData(); + return &m_images[index]; } // Get the bitmap wxBitmap wxGenericImageList::GetBitmap(int index) const { - const wxBitmap* bmp = GetBitmapPtr(index); - if (bmp) - return *bmp; - else + const wxBitmap* bmp = DoGetPtr(index); + if (!bmp) return wxNullBitmap; + + return *bmp; } // Get the icon wxIcon wxGenericImageList::GetIcon(int index) const { - const wxBitmap* bmp = GetBitmapPtr(index); - if (bmp) - { - wxIcon icon; - icon.CopyFromBitmap(*bmp); - return icon; - } - else + const wxBitmap* bmp = DoGetPtr(index); + if (!bmp) return wxNullIcon; + + wxIcon icon; + icon.CopyFromBitmap(*bmp); + return icon; } -bool wxGenericImageList::Replace( int index, const wxBitmap &bitmap ) +bool +wxGenericImageList::Replace(int index, + const wxBitmap& bitmap, + const wxBitmap& mask) { - wxObjectList::compatibility_iterator node = m_images.Item( index ); + // Call DoGetPtr() just to check the index validity. + if ( !DoGetPtr(index) ) + return false; - wxCHECK_MSG( node, false, wxT("wrong index in image list") ); + m_images[index] = bitmap; - wxBitmap* newBitmap = (bitmap.IsKindOf(wxCLASSINFO(wxIcon))) ? - new wxBitmap( (const wxIcon&) bitmap ) - : new wxBitmap(bitmap) ; - - if (index == (int) m_images.GetCount() - 1) - { - delete node->GetData(); - m_images.Erase( node ); - m_images.Append( newBitmap ); - } - else - { - wxObjectList::compatibility_iterator next = node->GetNext(); - delete node->GetData(); - m_images.Erase( node ); - m_images.Insert( next, newBitmap ); - } - - return true; -} - -bool wxGenericImageList::Replace( int index, const wxBitmap &bitmap, const wxBitmap &mask ) -{ - wxObjectList::compatibility_iterator node = m_images.Item( index ); - - wxCHECK_MSG( node, false, wxT("wrong index in image list") ); - - wxBitmap* newBitmap = (bitmap.IsKindOf(wxCLASSINFO(wxIcon))) ? - new wxBitmap( (const wxIcon&) bitmap ) - : new wxBitmap(bitmap) ; - - if (index == (int) m_images.GetCount() - 1) - { - delete node->GetData(); - m_images.Erase( node ); - m_images.Append( newBitmap ); - } - else - { - wxObjectList::compatibility_iterator next = node->GetNext(); - delete node->GetData(); - m_images.Erase( node ); - m_images.Insert( next, newBitmap ); - } - - if (mask.IsOk()) - newBitmap->SetMask(new wxMask(mask)); + if ( mask.IsOk() ) + m_images[index].SetMask(new wxMask(mask)); return true; } bool wxGenericImageList::Remove( int index ) { - wxObjectList::compatibility_iterator node = m_images.Item( index ); - - wxCHECK_MSG( node, false, wxT("wrong index in image list") ); - - delete node->GetData(); - m_images.Erase( node ); + m_images.erase(m_images.begin() + index); return true; } bool wxGenericImageList::RemoveAll() { - WX_CLEAR_LIST(wxObjectList, m_images); - m_images.Clear(); + m_images.clear(); return true; } bool wxGenericImageList::GetSize( int index, int &width, int &height ) const { - width = 0; - height = 0; + const wxBitmap* bmp = DoGetPtr(index); + if ( !bmp ) + { + width = 0; + height = 0; + return false; + } - wxObjectList::compatibility_iterator node = m_images.Item( index ); - - wxCHECK_MSG( node, false, wxT("wrong index in image list") ); - - wxBitmap *bm = (wxBitmap*)node->GetData(); - width = bm->GetWidth(); - height = bm->GetHeight(); + width = bmp->GetScaledWidth(); + height = bmp->GetScaledHeight(); return true; } @@ -244,16 +185,11 @@ bool wxGenericImageList::GetSize( int index, int &width, int &height ) const bool wxGenericImageList::Draw( int index, wxDC &dc, int x, int y, int flags, bool WXUNUSED(solidBackground) ) { - wxObjectList::compatibility_iterator node = m_images.Item( index ); + const wxBitmap* bmp = DoGetPtr(index); + if ( !bmp ) + return false; - wxCHECK_MSG( node, false, wxT("wrong index in image list") ); - - wxBitmap *bm = (wxBitmap*)node->GetData(); - - if (bm->IsKindOf(wxCLASSINFO(wxIcon))) - dc.DrawIcon( * ((wxIcon*) bm), x, y); - else - dc.DrawBitmap( *bm, x, y, (flags & wxIMAGELIST_DRAW_TRANSPARENT) > 0 ); + dc.DrawBitmap(*bmp, x, y, (flags & wxIMAGELIST_DRAW_TRANSPARENT) != 0); return true; } diff --git a/src/gtk/notebook.cpp b/src/gtk/notebook.cpp index 93878cceb6..31978cb2b0 100644 --- a/src/gtk/notebook.cpp +++ b/src/gtk/notebook.cpp @@ -284,17 +284,15 @@ bool wxNotebook::SetPageImage( size_t page, int image ) if (image >= 0) { wxCHECK_MSG(HasImageList(), false, "invalid notebook imagelist"); - const wxBitmap* bitmap = GetImageList()->GetBitmapPtr(image); - if (bitmap == NULL) - return false; + const wxBitmap bitmap = GetImageList()->GetBitmap(image); if (pageData->m_image) { gtk_image_set_from_pixbuf( - GTK_IMAGE(pageData->m_image), bitmap->GetPixbuf()); + GTK_IMAGE(pageData->m_image), bitmap.GetPixbuf()); } else { - pageData->m_image = gtk_image_new_from_pixbuf(bitmap->GetPixbuf()); + pageData->m_image = gtk_image_new_from_pixbuf(bitmap.GetPixbuf()); gtk_widget_show(pageData->m_image); gtk_box_pack_start(GTK_BOX(pageData->m_box), pageData->m_image, false, false, m_padding); @@ -443,8 +441,8 @@ bool wxNotebook::InsertPage( size_t position, { if (HasImageList()) { - const wxBitmap* bitmap = GetImageList()->GetBitmapPtr(imageId); - pageData->m_image = gtk_image_new_from_pixbuf(bitmap->GetPixbuf()); + const wxBitmap bitmap = GetImageList()->GetBitmap(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 6dc0752862..cb17186a51 100644 --- a/src/gtk1/notebook.cpp +++ b/src/gtk1/notebook.cpp @@ -512,12 +512,12 @@ bool wxNotebook::SetPageImage( size_t page, int image ) wxASSERT( HasImageList() ); /* Just in case */ /* Construct the new pixmap */ - const wxBitmap *bmp = GetImageList()->GetBitmapPtr(image); - GdkPixmap *pixmap = bmp->GetPixmap(); + const wxBitmap bmp = GetImageList()->GetBitmap(image); + GdkPixmap *pixmap = bmp.GetPixmap(); GdkBitmap *mask = NULL; - if ( bmp->GetMask() ) + if ( bmp.GetMask() ) { - mask = bmp->GetMask()->GetBitmap(); + mask = bmp.GetMask()->GetBitmap(); } if (pixmapwid == NULL) @@ -679,12 +679,12 @@ bool wxNotebook::InsertPage( size_t position, { wxASSERT( HasImageList() ); - const wxBitmap *bmp = GetImageList()->GetBitmapPtr(imageId); - GdkPixmap *pixmap = bmp->GetPixmap(); + const wxBitmap bmp = GetImageList()->GetBitmap(imageId); + GdkPixmap *pixmap = bmp.GetPixmap(); GdkBitmap *mask = NULL; - if ( bmp->GetMask() ) + if ( bmp.GetMask() ) { - mask = bmp->GetMask()->GetBitmap(); + mask = bmp.GetMask()->GetBitmap(); } GtkWidget *pixmapwid = gtk_pixmap_new (pixmap, mask ); diff --git a/src/osx/imaglist.cpp b/src/osx/imaglist.cpp deleted file mode 100644 index d487bd8bc6..0000000000 --- a/src/osx/imaglist.cpp +++ /dev/null @@ -1,290 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/osx/imaglist.cpp -// Purpose: -// Author: Robert Roebling -// Copyright: (c) 1998 Robert Roebling -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_IMAGLIST - -#include "wx/imaglist.h" - -#ifndef WX_PRECOMP - #include "wx/dc.h" - #include "wx/icon.h" - #include "wx/image.h" -#endif - -wxIMPLEMENT_DYNAMIC_CLASS(wxImageList, wxObject); - - -wxImageList::wxImageList( int width, int height, bool mask, int initialCount ) -{ - (void)Create(width, height, mask, initialCount); -} - -wxImageList::~wxImageList() -{ - (void)RemoveAll(); -} - -int wxImageList::GetImageCount() const -{ - return m_images.GetCount(); -} - -bool wxImageList::Create( int width, int height, bool WXUNUSED(mask), int WXUNUSED(initialCount) ) -{ - m_width = width; - m_height = height; - - return Create(); -} - -bool wxImageList::Create() -{ - return true; -} - -int wxImageList::Add( const wxBitmap &bitmap ) -{ - wxASSERT_MSG( (bitmap.GetScaledWidth() >= m_width && bitmap.GetScaledHeight() == m_height) - || (m_width == 0 && m_height == 0), - wxT("invalid bitmap size in wxImageList: this might work ") - wxT("on this platform but definitely won't under Windows.") ); - - // Mimic behaviour of Windows ImageList_Add that automatically breaks up the added - // bitmap into sub-images of the correct size - if (m_width > 0 && bitmap.GetScaledWidth() > m_width && bitmap.GetScaledHeight() >= m_height) - { - int numImages = bitmap.GetScaledWidth() / m_width; - for (int subIndex = 0; subIndex < numImages; subIndex++) - { - wxRect rect(m_width * subIndex, 0, m_width, m_height); - wxBitmap tmpBmp = bitmap.GetSubBitmap(rect); - m_images.Append( new wxBitmap(tmpBmp) ); - } - } - else - { - m_images.Append( new wxBitmap(bitmap) ); - } - - if (m_width == 0 && m_height == 0) - { - m_width = bitmap.GetScaledWidth(); - m_height = bitmap.GetScaledHeight(); - } - - return m_images.GetCount() - 1; -} - -int wxImageList::Add( const wxBitmap& bitmap, const wxBitmap& mask ) -{ - wxBitmap bmp( bitmap ); - if (mask.IsOk()) - bmp.SetMask( new wxMask( mask ) ); - - return Add( bmp ); -} - -int wxImageList::Add( const wxBitmap& bitmap, const wxColour& maskColour ) -{ - wxImage img = bitmap.ConvertToImage(); - img.SetMaskColour( maskColour.Red(), maskColour.Green(), maskColour.Blue() ); - - return Add( wxBitmap( img ) ); -} - -// Get the bitmap -wxBitmap wxImageList::GetBitmap(int index) const -{ - wxList::compatibility_iterator node = m_images.Item( index ); - - wxCHECK_MSG( node, wxNullBitmap , wxT("wrong index in image list") ); - - wxObject* obj = (wxObject*) node->GetData(); - if ( obj == NULL ) - return wxNullBitmap ; - else if ( obj->IsKindOf(CLASSINFO(wxIcon)) ) - return wxBitmap( *(static_cast(obj)) ) ; - else - return *(static_cast(obj)) ; -} - -// Get the icon -wxIcon wxImageList::GetIcon(int index) const -{ - wxList::compatibility_iterator node = m_images.Item( index ); - - wxCHECK_MSG( node, wxNullIcon , wxT("wrong index in image list") ); - - wxObject* obj = (wxObject*) node->GetData(); - if ( obj == NULL ) - return wxNullIcon ; - if ( obj->IsKindOf(CLASSINFO(wxBitmap)) ) - { - wxIcon icon; - icon.CopyFromBitmap(*static_cast(obj)); - return icon; - } - return *(static_cast(obj)) ; -} - -bool wxImageList::Replace( int index, const wxBitmap &bitmap ) -{ - wxList::compatibility_iterator node = m_images.Item( index ); - - wxCHECK_MSG( node, false, wxT("wrong index in image list") ); - - wxBitmap* newBitmap = new wxBitmap( bitmap ); - - if (index == (int) m_images.GetCount() - 1) - { - delete node->GetData(); - - m_images.Erase( node ); - m_images.Append( newBitmap ); - } - else - { - wxList::compatibility_iterator next = node->GetNext(); - delete node->GetData(); - - m_images.Erase( node ); - m_images.Insert( next, newBitmap ); - } - - return true; -} - -bool wxImageList::Replace( int index, const wxIcon &bitmap ) -{ - wxList::compatibility_iterator node = m_images.Item( index ); - - wxCHECK_MSG( node, false, wxT("wrong index in image list") ); - - wxIcon* newBitmap = new wxIcon( bitmap ); - - if (index == (int) m_images.GetCount() - 1) - { - delete node->GetData(); - m_images.Erase( node ); - m_images.Append( newBitmap ); - } - else - { - wxList::compatibility_iterator next = node->GetNext(); - delete node->GetData(); - m_images.Erase( node ); - m_images.Insert( next, newBitmap ); - } - - return true; -} - -bool wxImageList::Replace( int index, const wxBitmap &bitmap, const wxBitmap &mask ) -{ - wxList::compatibility_iterator node = m_images.Item( index ); - - wxCHECK_MSG( node, false, wxT("wrong index in image list") ); - - wxBitmap* newBitmap = new wxBitmap(bitmap); - - if (index == (int) m_images.GetCount() - 1) - { - delete node->GetData(); - m_images.Erase( node ); - m_images.Append( newBitmap ); - } - else - { - wxList::compatibility_iterator next = node->GetNext(); - delete node->GetData(); - m_images.Erase( node ); - m_images.Insert( next, newBitmap ); - } - - if (mask.IsOk()) - newBitmap->SetMask(new wxMask(mask)); - - return true; -} - -bool wxImageList::Remove( int index ) -{ - wxList::compatibility_iterator node = m_images.Item( index ); - - wxCHECK_MSG( node, false, wxT("wrong index in image list") ); - - delete node->GetData(); - m_images.Erase( node ); - - return true; -} - -bool wxImageList::RemoveAll() -{ - WX_CLEAR_LIST(wxList, m_images); - m_images.Clear(); - - return true; -} - -bool wxImageList::GetSize( int index, int &width, int &height ) const -{ - width = 0; - height = 0; - - wxList::compatibility_iterator node = m_images.Item( index ); - - wxCHECK_MSG( node, false, wxT("wrong index in image list") ); - - wxObject *obj = (wxObject*)node->GetData(); - if (obj->IsKindOf(CLASSINFO(wxIcon))) - { - wxIcon *bm = static_cast< wxIcon* >(obj ) ; - width = bm->GetWidth(); - height = bm->GetHeight(); - } - else - { - wxBitmap *bm = static_cast< wxBitmap* >(obj ) ; - width = bm->GetScaledWidth(); - height = bm->GetScaledHeight(); - } - - return true; -} - -bool wxImageList::Draw( - int index, wxDC &dc, int x, int y, - int flags, bool WXUNUSED(solidBackground) ) -{ - wxList::compatibility_iterator node = m_images.Item( index ); - - wxCHECK_MSG( node, false, wxT("wrong index in image list") ); - - wxObject *obj = (wxObject*)node->GetData(); - if (obj->IsKindOf(CLASSINFO(wxIcon))) - { - wxIcon *bm = static_cast< wxIcon* >(obj ) ; - dc.DrawIcon( *bm , x, y ); - } - else - { - wxBitmap *bm = static_cast< wxBitmap* >(obj ) ; - dc.DrawBitmap( *bm, x, y, (flags & wxIMAGELIST_DRAW_TRANSPARENT) > 0 ); - } - - return true; -} - -#endif // wxUSE_IMAGLIST diff --git a/src/qt/listctrl.cpp b/src/qt/listctrl.cpp index 7ddd3b8d79..8a087ef07d 100644 --- a/src/qt/listctrl.cpp +++ b/src/qt/listctrl.cpp @@ -329,12 +329,9 @@ bool wxListCtrl::SetItem(wxListItem& info) { wxImageList *imglst = GetImageList(InReportView() ? wxIMAGE_LIST_SMALL : wxIMAGE_LIST_NORMAL); wxCHECK_MSG(imglst, false, "invalid listctrl imagelist"); - const wxBitmap* bitmap = imglst->GetBitmapPtr(info.m_image); - if (bitmap != NULL) - { - // set the new image: - qitem->setIcon( info.GetColumn(), QIcon( *bitmap->GetHandle() )); - } + const wxBitmap bitmap = imglst->GetBitmap(info.m_image); + // set the new image: + qitem->setIcon( info.GetColumn(), QIcon( *bitmap.GetHandle() )); } else { diff --git a/src/qt/notebook.cpp b/src/qt/notebook.cpp index 8fd294f1f5..3730c67782 100644 --- a/src/qt/notebook.cpp +++ b/src/qt/notebook.cpp @@ -112,11 +112,9 @@ bool wxNotebook::SetPageImage(size_t n, int imageId) if (imageId >= 0) { wxCHECK_MSG(HasImageList(), false, "invalid notebook imagelist"); - const wxBitmap* bitmap = GetImageList()->GetBitmapPtr(imageId); - if (bitmap == NULL) - return false; + const wxBitmap bitmap = GetImageList()->GetBitmap(imageId); // set the new image: - m_qtTabWidget->setTabIcon( n, QIcon( *bitmap->GetHandle() )); + m_qtTabWidget->setTabIcon( n, QIcon( *bitmap.GetHandle() )); } else { @@ -137,8 +135,8 @@ bool wxNotebook::InsertPage(size_t n, wxWindow *page, const wxString& text, { if (HasImageList()) { - const wxBitmap* bitmap = GetImageList()->GetBitmapPtr(imageId); - m_qtTabWidget->insertTab( n, page->GetHandle(), QIcon( *bitmap->GetHandle() ), wxQtConvertString( text )); + const wxBitmap bitmap = GetImageList()->GetBitmap(imageId); + m_qtTabWidget->insertTab( n, page->GetHandle(), QIcon( *bitmap.GetHandle() ), wxQtConvertString( text )); } else {