From 484149522d8b6f8bf1409e2737d202bc4cbd21c7 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Fri, 12 Nov 2004 15:28:48 +0000 Subject: [PATCH] Notebook page bitmaps now supported. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30501 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/xrc/xh_notbk.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/xrc/xh_notbk.cpp b/src/xrc/xh_notbk.cpp index 3392b59e57..14a60c8536 100644 --- a/src/xrc/xh_notbk.cpp +++ b/src/xrc/xh_notbk.cpp @@ -25,6 +25,7 @@ #include "wx/log.h" #include "wx/notebook.h" +#include "wx/imaglist.h" #include "wx/sizer.h" IMPLEMENT_DYNAMIC_CLASS(wxNotebookXmlHandler, wxXmlResourceHandler) @@ -58,8 +59,22 @@ wxObject *wxNotebookXmlHandler::DoCreateResource() wxWindow *wnd = wxDynamicCast(item, wxWindow); if (wnd) + { m_notebook->AddPage(wnd, GetText(wxT("label")), GetBool(wxT("selected"))); + if ( HasParam(wxT("bitmap")) ) + { + wxBitmap bmp = GetBitmap(wxT("bitmap"), wxART_OTHER); + wxImageList *imgList = m_notebook->GetImageList(); + if ( imgList == NULL ) + { + imgList = new wxImageList( bmp.GetWidth(), bmp.GetHeight() ); + m_notebook->AssignImageList( imgList ); + } + int imgIndex = imgList->Add(bmp); + m_notebook->SetPageImage(m_notebook->GetPageCount()-1, imgIndex ); + } + } else wxLogError(wxT("Error in resource.")); return wnd; -- 2.45.2