From 3f4880a451af5b982e775acae7f316793c3df0b5 Mon Sep 17 00:00:00 2001 From: Dimitri Schoolwerth Date: Tue, 23 Aug 2011 03:08:01 +0000 Subject: [PATCH] Fixed compilation of various notebook.cpp's. Make use of HasImageList() and GetImageList() instead of accessing the now private m_imageList directly. Fixed for wxUniv, wxGTK1, and wxOS2 (the latter 2 blindly). Changes are similar to r68856 and should have been a part of that. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68857 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk1/notebook.cpp | 9 ++++----- src/os2/notebook.cpp | 3 +-- src/univ/notebook.cpp | 12 ++++++------ 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/gtk1/notebook.cpp b/src/gtk1/notebook.cpp index 9018d38702..5406419a13 100644 --- a/src/gtk1/notebook.cpp +++ b/src/gtk1/notebook.cpp @@ -289,7 +289,6 @@ void wxNotebook::Init() m_padding = 0; m_inSwitchPage = false; - m_imageList = NULL; m_themeEnabled = true; } @@ -511,10 +510,10 @@ bool wxNotebook::SetPageImage( size_t page, int image ) } /* Only cases 3) and 4) left */ - wxASSERT( m_imageList != NULL ); /* Just in case */ + wxASSERT( HasImageList() ); /* Just in case */ /* Construct the new pixmap */ - const wxBitmap *bmp = m_imageList->GetBitmapPtr(image); + const wxBitmap *bmp = GetImageList()->GetBitmapPtr(image); GdkPixmap *pixmap = bmp->GetPixmap(); GdkBitmap *mask = NULL; if ( bmp->GetMask() ) @@ -680,9 +679,9 @@ bool wxNotebook::InsertPage( size_t position, if (imageId != -1) { - wxASSERT( m_imageList != NULL ); + wxASSERT( HasImageList() ); - const wxBitmap *bmp = m_imageList->GetBitmapPtr(imageId); + const wxBitmap *bmp = GetImageList()->GetBitmapPtr(imageId); GdkPixmap *pixmap = bmp->GetPixmap(); GdkBitmap *mask = NULL; if ( bmp->GetMask() ) diff --git a/src/os2/notebook.cpp b/src/os2/notebook.cpp index 299b848a96..f1c52e8ed4 100644 --- a/src/os2/notebook.cpp +++ b/src/os2/notebook.cpp @@ -73,7 +73,6 @@ END_EVENT_TABLE() // void wxNotebook::Init() { - m_imageList = NULL; m_nTabSize = 0; } // end of wxNotebook::Init @@ -325,7 +324,7 @@ bool wxNotebook::SetPageImage ( , int nImage ) { - wxBitmap vBitmap = (wxBitmap)m_imageList->GetBitmap(nImage); + wxBitmap vBitmap = (wxBitmap)GetImageList()->GetBitmap(nImage); return (bool)::WinSendMsg( GetHWND() ,BKM_SETTABBITMAP diff --git a/src/univ/notebook.cpp b/src/univ/notebook.cpp index 0bd4942765..44129b423b 100644 --- a/src/univ/notebook.cpp +++ b/src/univ/notebook.cpp @@ -191,8 +191,8 @@ bool wxNotebook::SetPageImage(size_t nPage, int nImage) { wxCHECK_MSG( IS_VALID_PAGE(nPage), false, wxT("invalid notebook page") ); - wxCHECK_MSG( m_imageList && nImage < m_imageList->GetImageCount(), false, - wxT("invalid image index in SetPageImage()") ); + wxCHECK_MSG( HasImageList() && nImage < GetImageList()->GetImageCount(), + false, wxT("invalid image index in SetPageImage()") ); if ( nImage != m_images[nPage] ) { @@ -472,15 +472,15 @@ void wxNotebook::DoDrawTab(wxDC& dc, const wxRect& rect, size_t n) // used for wxUniversal under MSW #if 0 // def __WXMSW__ // FIXME int w, h; - m_imageList->GetSize(n, w, h); + GetImageList()->GetSize(n, w, h); bmp.Create(w, h); wxMemoryDC dc; dc.SelectObject(bmp); dc.SetBackground(wxBrush(GetBackgroundColour(), wxSOLID)); - m_imageList->Draw(image, dc, 0, 0, wxIMAGELIST_DRAW_NORMAL, true); + GetImageList()->Draw(image, dc, 0, 0, wxIMAGELIST_DRAW_NORMAL, true); dc.SelectObject(wxNullBitmap); #else - bmp = m_imageList->GetBitmap(image); + bmp = GetImageList()->GetBitmap(image); #endif } @@ -829,7 +829,7 @@ wxSize wxNotebook::CalcTabSize(int page) const if ( HasImage(page) ) { wxSize sizeImage; - m_imageList->GetSize(m_images[page], sizeImage.x, sizeImage.y); + GetImageList()->GetSize(m_images[page], sizeImage.x, sizeImage.y); size.x += sizeImage.x + 5; // FIXME: hard coded margin -- 2.45.2