X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9fbad34ddd8c01de8948b0cb93c2c9facd72cd9b..b4a5e7b6f19bcef7449c87d46ab46af1b4aaec6b:/src/xrc/xh_notbk.cpp diff --git a/src/xrc/xh_notbk.cpp b/src/xrc/xh_notbk.cpp index 3392b59e57..596df57b36 100644 --- a/src/xrc/xh_notbk.cpp +++ b/src/xrc/xh_notbk.cpp @@ -8,7 +8,7 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "xh_notbk.h" #endif @@ -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;