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
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user