X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2c12c792f34998b8b9d96a3b6e5a09525c022d1c..f773e9b0bbfd051a4ae316461fd241230c87e39f:/src/xrc/xh_notbk.cpp diff --git a/src/xrc/xh_notbk.cpp b/src/xrc/xh_notbk.cpp index f6d646786f..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"), 0)); + 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;