X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9fbad34ddd8c01de8948b0cb93c2c9facd72cd9b..abc2a4ccec3d06d4b268d5ac3c97d657721f5cff:/src/xrc/xh_notbk.cpp 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;