From 8fd2b35cbe5d66bf0c32b91e5313918a518ee5fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Thu, 28 Sep 2000 22:18:47 +0000 Subject: [PATCH] modified wxHtmlHelpFrame to use AssignImageList git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8437 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/html/helpfrm.h | 1 - src/html/helpfrm.cpp | 17 ++++++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/include/wx/html/helpfrm.h b/include/wx/html/helpfrm.h index 7ce4bc2a7f..9bcf7574a4 100644 --- a/include/wx/html/helpfrm.h +++ b/include/wx/html/helpfrm.h @@ -206,7 +206,6 @@ class WXDLLEXPORT wxHtmlHelpFrame : public wxFrame wxSplitterWindow *m_Splitter; wxNotebook *m_NavigPan; wxTreeCtrl *m_ContentsBox; - wxImageList *m_ContentsImageList; wxTextCtrl *m_IndexText; wxButton *m_IndexButton; wxButton *m_IndexButtonAll; diff --git a/src/html/helpfrm.cpp b/src/html/helpfrm.cpp index 25052abfe8..cf03e1065c 100644 --- a/src/html/helpfrm.cpp +++ b/src/html/helpfrm.cpp @@ -143,12 +143,6 @@ void wxHtmlHelpFrame::Init(wxHtmlHelpData* data) m_DataCreated = TRUE; } - m_ContentsImageList = new wxImageList(16, 16); - m_ContentsImageList -> Add(wxICON(wbook)); - m_ContentsImageList -> Add(wxICON(wfolder)); - m_ContentsImageList -> Add(wxICON(wpage)); - m_ContentsImageList -> Add(wxICON(whlproot)); - m_ContentsBox = NULL; m_IndexList = NULL; m_IndexButton = NULL; @@ -200,6 +194,12 @@ void wxHtmlHelpFrame::Init(wxHtmlHelpData* data) bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id, const wxString& title, int style) { + wxImageList *ContentsImageList = new wxImageList(16, 16); + ContentsImageList->Add(wxICON(wbook)); + ContentsImageList->Add(wxICON(wfolder)); + ContentsImageList->Add(wxICON(wpage)); + ContentsImageList->Add(wxICON(whlproot)); + // Do the config in two steps. We read the HtmlWindow customization after we // create the window. if (m_Config) @@ -289,7 +289,7 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id, const wxString& ti m_ContentsBox = new wxTreeCtrl(dummy, wxID_HTML_TREECTRL, wxDefaultPosition, wxDefaultSize, wxTR_HAS_BUTTONS | wxSUNKEN_BORDER); - m_ContentsBox -> SetImageList(m_ContentsImageList); + m_ContentsBox -> AssignImageList(ContentsImageList); b4 -> top.Below (m_Bookmarks, 10); b4 -> left.SameAs (dummy, wxLeft, 0); @@ -308,7 +308,7 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id, const wxString& ti m_ContentsBox = new wxTreeCtrl(m_NavigPan, wxID_HTML_TREECTRL, wxDefaultPosition, wxDefaultSize, wxTR_HAS_BUTTONS | wxSUNKEN_BORDER); - m_ContentsBox -> SetImageList(m_ContentsImageList); + m_ContentsBox -> AssignImageList(ContentsImageList); m_NavigPan -> AddPage(m_ContentsBox, _("Contents")); } @@ -462,7 +462,6 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id, const wxString& ti wxHtmlHelpFrame::~wxHtmlHelpFrame() { // PopEventHandler(); // wxhtmlhelpcontroller (not any more!) - delete m_ContentsImageList; if (m_DataCreated) delete m_Data; if (m_NormalFonts) delete m_NormalFonts;