]> git.saurik.com Git - wxWidgets.git/commitdiff
modified wxHtmlHelpFrame to use AssignImageList
authorVáclav Slavík <vslavik@fastmail.fm>
Thu, 28 Sep 2000 22:18:47 +0000 (22:18 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Thu, 28 Sep 2000 22:18:47 +0000 (22:18 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8437 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/html/helpfrm.h
src/html/helpfrm.cpp

index 7ce4bc2a7f845ea0c07e99ace03aab771cde3969..9bcf7574a4cf13df3f02e5855bcbb053a8ab3040 100644 (file)
@@ -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;
index 25052abfe8644808af0b58fe0605bdc9a4639575..cf03e1065cc841fcd0fa58d8063f56eeaede26ac 100644 (file)
@@ -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;