Add wxWithImages helper mix-in with {Set,Get,Assign}ImageList() methods.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 21 Aug 2011 14:08:43 +0000 (14:08 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 21 Aug 2011 14:08:43 +0000 (14:08 +0000)
commitabfdefede3209ac777bdac8a65bae8bf008f327b
treeb34f5244e28179ca11c52a2e0e92a2249e0f1298
parent36a96421b31530604c9dcccc0ba2a2861359f462
Add wxWithImages helper mix-in with {Set,Get,Assign}ImageList() methods.

Avoid defining SetImageList() in several different places in wx API as not
only this resulted in (trivial) code duplication but this method also had
different semantics before: it didn't take ownership of the pointer passed to
it in wxTreeCtrl, wxListCtrl and wxBookCtrl and derived classes but did take
its ownership in wxDataViewTreeCtrl and wxRichTextFormattingDialog.

Harmonize this for all the classes now: SetImageList() never takes ownership
while AssignImageList() (which is now available in all classes having
SetImageList()) always does.

Also add convenience wxWithImages::GetImage() helper to avoid (more) code
duplication in wxDataViewTreeCtrl code.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68809 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
17 files changed:
Makefile.in
build/bakefiles/files.bkl
build/msw/wx_core.dsp
build/msw/wx_vc7_core.vcproj
build/msw/wx_vc8_core.vcproj
build/msw/wx_vc9_core.vcproj
include/wx/bookctrl.h
include/wx/dataview.h
include/wx/richtext/richtextformatdlg.h
include/wx/withimages.h [new file with mode: 0644]
samples/dataview/dataview.cpp
src/common/bookctrl.cpp
src/common/datavcmn.cpp
src/gtk/notebook.cpp
src/msw/notebook.cpp
src/osx/notebook_osx.cpp
src/richtext/richtextformatdlg.cpp