From 1904aa72f0df85f2f02af417eff35639d4f1b93b Mon Sep 17 00:00:00 2001 From: Dimitri Schoolwerth Date: Mon, 16 Feb 2004 23:27:54 +0000 Subject: [PATCH] Fixed compilation for !wxUSE_IMAGE as well as !wxUSE_TOOLBAR. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25838 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/fs_mem.h | 3 ++- src/common/fs_mem.cpp | 5 +++-- src/common/iconbndl.cpp | 4 ++++ src/common/rgncmn.cpp | 10 ++++++++-- src/generic/dirctrlg.cpp | 6 ++++-- src/msw/bitmap.cpp | 4 ++++ src/msw/mdi.cpp | 6 ++++++ 7 files changed, 31 insertions(+), 7 deletions(-) diff --git a/include/wx/fs_mem.h b/include/wx/fs_mem.h index 9a46b264f4..a941c894f8 100644 --- a/include/wx/fs_mem.h +++ b/include/wx/fs_mem.h @@ -91,11 +91,12 @@ public: #if wxUSE_IMAGE static void AddFile(const wxString& filename, wxImage& image, long type); -#endif // wxUSE_IMAGE static void AddFile(const wxString& filename, const wxBitmap& bitmap, long type); +#endif // wxUSE_IMAGE + }; #else // !wxUSE_GUI diff --git a/src/common/fs_mem.cpp b/src/common/fs_mem.cpp index 37a272bbdc..782b95d758 100644 --- a/src/common/fs_mem.cpp +++ b/src/common/fs_mem.cpp @@ -231,7 +231,6 @@ wxMemoryFSHandler::AddFile(const wxString& filename, wxImage& image, long type) wxLogError(s); } } -#endif // wxUSE_IMAGE /*static*/ void wxMemoryFSHandler::AddFile(const wxString& filename, const wxBitmap& bitmap, long type) { @@ -239,7 +238,9 @@ wxMemoryFSHandler::AddFile(const wxString& filename, wxImage& image, long type) AddFile(filename, img, type); } -#endif +#endif // wxUSE_IMAGE + +#endif // wxUSE_GUI #endif // wxUSE_FILESYSTEM && wxUSE_FS_ZIP diff --git a/src/common/iconbndl.cpp b/src/common/iconbndl.cpp index 0661a1e7db..2fa8344534 100644 --- a/src/common/iconbndl.cpp +++ b/src/common/iconbndl.cpp @@ -54,7 +54,11 @@ void wxIconBundle::DeleteIcons() m_icons.Empty(); } +#if wxUSE_IMAGE void wxIconBundle::AddIcon( const wxString& file, long type ) +#else +void wxIconBundle::AddIcon( const wxString& WXUNUSED(file), long WXUNUSED(type) ) +#endif { #if wxUSE_IMAGE size_t count = wxImage::GetImageCount( file, type ); diff --git a/src/common/rgncmn.cpp b/src/common/rgncmn.cpp index 41b273e76c..581ecbf68e 100644 --- a/src/common/rgncmn.cpp +++ b/src/common/rgncmn.cpp @@ -50,9 +50,15 @@ wxBitmap wxRegion::ConvertToBitmap() const //--------------------------------------------------------------------------- +#if wxUSE_IMAGE bool wxRegion::Union(const wxBitmap& bmp, const wxColour& transColour, int tolerance) +#else +bool wxRegion::Union(const wxBitmap& WXUNUSED(bmp), + const wxColour& WXUNUSED(transColour), + int WXUNUSED(tolerance)) +#endif { #if wxUSE_IMAGE unsigned char loR, loG, loB; @@ -116,10 +122,10 @@ bool wxRegion::Union(const wxBitmap& bmp, } } - return TRUE; + return true; #else // No wxImage support - return FALSE; + return false; #endif } diff --git a/src/generic/dirctrlg.cpp b/src/generic/dirctrlg.cpp index bf16d8a0df..2c596b3535 100644 --- a/src/generic/dirctrlg.cpp +++ b/src/generic/dirctrlg.cpp @@ -1528,7 +1528,7 @@ wxImageList *wxFileIconsTable::GetSmallImageList() return m_smallImageList; } -#if wxUSE_MIMETYPE +#if wxUSE_MIMETYPE && wxUSE_IMAGE // VS: we don't need this function w/o wxMimeTypesManager because we'll only have // one icon and we won't resize it @@ -1684,6 +1684,7 @@ int wxFileIconsTable::GetIconID(const wxString& extension, const wxString& mime) { m_smallImageList->Add(bmp); } +#if wxUSE_IMAGE else { wxImage img = bmp.ConvertToImage(); @@ -1694,7 +1695,8 @@ int wxFileIconsTable::GetIconID(const wxString& extension, const wxString& mime) else m_smallImageList->Add(CreateAntialiasedBitmap(img)); } - +#endif // wxUSE_IMAGE + m_HashTable->Put(extension, new wxFileIconEntry(id)); return id; diff --git a/src/msw/bitmap.cpp b/src/msw/bitmap.cpp index ad7929de21..6a2c74a221 100644 --- a/src/msw/bitmap.cpp +++ b/src/msw/bitmap.cpp @@ -429,7 +429,11 @@ wxBitmap::wxBitmap(const char bits[], int width, int height, int depth) } // Create from XPM data +#if wxUSE_IMAGE && wxUSE_XPM bool wxBitmap::CreateFromXpm(const char **data) +#else +bool wxBitmap::CreateFromXpm(const char **WXUNUSED(data)) +#endif { #if wxUSE_IMAGE && wxUSE_XPM Init(); diff --git a/src/msw/mdi.cpp b/src/msw/mdi.cpp index edb246d750..5f980abb3d 100644 --- a/src/msw/mdi.cpp +++ b/src/msw/mdi.cpp @@ -234,7 +234,9 @@ bool wxMDIParentFrame::Create(wxWindow *parent, wxMDIParentFrame::~wxMDIParentFrame() { // see comment in ~wxMDIChildFrame +#if wxUSE_TOOLBAR m_frameToolBar = NULL; +#endif m_frameStatusBar = NULL; DestroyChildren(); @@ -732,7 +734,9 @@ wxMDIChildFrame::~wxMDIChildFrame() { // will be destroyed by DestroyChildren() but reset them before calling it // to avoid using dangling pointers if a callback comes in the meanwhile +#if wxUSE_TOOLBAR m_frameToolBar = NULL; +#endif m_frameStatusBar = NULL; DestroyChildren(); @@ -1027,11 +1031,13 @@ bool wxMDIChildFrame::HandleWindowPosChanging(void *pos) lpPos->cx = rectClient.right - rectClient.left; lpPos->cy = rectClient.bottom - rectClient.top; } +#if wxUSE_TOOLBAR wxMDIParentFrame* pFrameWnd = (wxMDIParentFrame *)GetParent(); if (pFrameWnd && pFrameWnd->GetToolBar() && pFrameWnd->GetToolBar()->IsShown()) { pFrameWnd->GetToolBar()->Refresh(); } +#endif } #endif // Win95 -- 2.45.2