From 3080bf599a2422855b0a83726413605f842c9545 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 14 Jun 2003 13:00:55 +0000 Subject: [PATCH] added a few #ifdefs needed to build a smaller library (patch 751523) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21147 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/generic/dragimgg.h | 9 +++++++++ include/wx/msw/dragimag.h | 8 ++++++++ include/wx/tbarsmpl.h | 2 +- src/common/prntbase.cpp | 12 ++++++++---- src/common/timercmn.cpp | 4 ++-- src/generic/dragimgg.cpp | 4 ++++ src/generic/tbarsmpl.cpp | 2 +- src/msw/dc.cpp | 2 +- src/msw/dragimag.cpp | 4 ++++ src/msw/popupwin.cpp | 3 +++ src/msw/statbr95.cpp | 2 +- 11 files changed, 42 insertions(+), 10 deletions(-) diff --git a/include/wx/generic/dragimgg.h b/include/wx/generic/dragimgg.h index cbfa4afb43..6b2ec08dc8 100644 --- a/include/wx/generic/dragimgg.h +++ b/include/wx/generic/dragimgg.h @@ -156,19 +156,24 @@ public: Create(str, cursor, cursorHotspot); } +#if wxUSE_TREECTRL wxGenericDragImage(const wxTreeCtrl& treeCtrl, wxTreeItemId& id) { Init(); Create(treeCtrl, id); } +#endif +#if wxUSE_LISTCTRL wxGenericDragImage(const wxListCtrl& listCtrl, long id) { Init(); Create(listCtrl, id); } +#endif + ~wxGenericDragImage(); // Attributes @@ -213,11 +218,15 @@ public: return Create(str, cursor); } +#if wxUSE_TREECTRL // Create a drag image for the given tree control item bool Create(const wxTreeCtrl& treeCtrl, wxTreeItemId& id); +#endif +#if wxUSE_LISTCTRL // Create a drag image for the given list control item bool Create(const wxListCtrl& listCtrl, long id); +#endif // Begin drag. hotspot is the location of the drag position relative to the upper-left // corner of the image. diff --git a/include/wx/msw/dragimag.h b/include/wx/msw/dragimag.h index 49b745c836..90477b6ab4 100644 --- a/include/wx/msw/dragimag.h +++ b/include/wx/msw/dragimag.h @@ -154,19 +154,23 @@ public: Create(str, cursor, cursorHotspot); } +#if wxUSE_TREECTRL wxDragImage(const wxTreeCtrl& treeCtrl, wxTreeItemId& id) { Init(); Create(treeCtrl, id); } +#endif +#if wxUSE_LISTCTRL wxDragImage(const wxListCtrl& listCtrl, long id) { Init(); Create(listCtrl, id); } +#endif ~wxDragImage(); @@ -200,11 +204,15 @@ public: return Create(str, cursor); } +#if wxUSE_TREECTRL // Create a drag image for the given tree control item bool Create(const wxTreeCtrl& treeCtrl, wxTreeItemId& id); +#endif +#if wxUSE_LISTCTRL // Create a drag image for the given list control item bool Create(const wxListCtrl& listCtrl, long id); +#endif // Begin drag. hotspot is the location of the drag position relative to the upper-left // corner of the image. diff --git a/include/wx/tbarsmpl.h b/include/wx/tbarsmpl.h index 3c602d9154..7d68984022 100644 --- a/include/wx/tbarsmpl.h +++ b/include/wx/tbarsmpl.h @@ -18,7 +18,7 @@ #include "wx/tbarbase.h" -#if wxUSE_TOOLBAR_SIMPLE +#if wxUSE_TOOLBAR && wxUSE_TOOLBAR_SIMPLE class WXDLLEXPORT wxMemoryDC; diff --git a/src/common/prntbase.cpp b/src/common/prntbase.cpp index fc2df6a705..4f5860323f 100644 --- a/src/common/prntbase.cpp +++ b/src/common/prntbase.cpp @@ -547,7 +547,9 @@ void wxPreviewFrame::OnCloseWindow(wxCloseEvent& WXUNUSED(event)) void wxPreviewFrame::Initialize() { +#if wxUSE_STATUSBAR CreateStatusBar(); +#endif CreateCanvas(); CreateControlBar(); @@ -780,14 +782,16 @@ bool wxPrintPreviewBase::RenderPage(int pageNum) memoryDC.SelectObject(wxNullBitmap); - wxChar buf[200]; +#if wxUSE_STATUSBAR + wxString status; if (m_maxPage != 0) - wxSprintf(buf, _("Page %d of %d"), pageNum, m_maxPage); + status = wxString::Format(_("Page %d of %d"), pageNum, m_maxPage); else - wxSprintf(buf, _("Page %d"), pageNum); + status = wxString::Format(_("Page %d"), pageNum); if (m_previewFrame) - m_previewFrame->SetStatusText(buf); + m_previewFrame->SetStatusText(status); +#endif return TRUE; } diff --git a/src/common/timercmn.cpp b/src/common/timercmn.cpp index 767ce02e29..b6e7e918dd 100644 --- a/src/common/timercmn.cpp +++ b/src/common/timercmn.cpp @@ -163,7 +163,7 @@ bool wxTimerBase::Start(int milliseconds, bool oneShot) // wxStopWatch // ---------------------------------------------------------------------------- -#if wxUSE_LONGLONG +#if wxUSE_STOPWATCH && wxUSE_LONGLONG void wxStopWatch::Start(long t) { @@ -404,5 +404,5 @@ wxLongLong wxGetLocalTimeMillis() #endif // time functions } -#endif // wxUSE_LONGLONG +#endif // #if wxUSE_STOPWATCH && wxUSE_LONGLONG diff --git a/src/generic/dragimgg.cpp b/src/generic/dragimgg.cpp index 8e89afe823..9d6ae54d29 100644 --- a/src/generic/dragimgg.cpp +++ b/src/generic/dragimgg.cpp @@ -172,19 +172,23 @@ bool wxGenericDragImage::Create(const wxString& str, const wxCursor& cursor) return Create(bitmap, cursor); } +#if wxUSE_TREECTRL // Create a drag image for the given tree control item bool wxGenericDragImage::Create(const wxTreeCtrl& treeCtrl, wxTreeItemId& id) { wxString str = treeCtrl.GetItemText(id); return Create(str); } +#endif +#if wxUSE_LISTCTRL // Create a drag image for the given list control item bool wxGenericDragImage::Create(const wxListCtrl& listCtrl, long id) { wxString str = listCtrl.GetItemText(id); return Create(str); } +#endif // Begin drag bool wxGenericDragImage::BeginDrag(const wxPoint& hotspot, diff --git a/src/generic/tbarsmpl.cpp b/src/generic/tbarsmpl.cpp index 33d24e4178..f6dbd31a55 100644 --- a/src/generic/tbarsmpl.cpp +++ b/src/generic/tbarsmpl.cpp @@ -28,7 +28,7 @@ #pragma hdrstop #endif -#if wxUSE_TOOLBAR_SIMPLE +#if wxUSE_TOOLBAR && wxUSE_TOOLBAR_SIMPLE #ifndef WX_PRECOMP #include "wx/settings.h" diff --git a/src/msw/dc.cpp b/src/msw/dc.cpp index 190526870a..8caa96a2e7 100644 --- a/src/msw/dc.cpp +++ b/src/msw/dc.cpp @@ -2280,7 +2280,7 @@ static bool AlphaBlt(HDC hdcDst, wxASSERT_MSG( hdcDst && hdcSrc, _T("AlphaBlt(): invalid HDC") ); // do we have AlphaBlend() and company in the headers? -#ifdef AC_SRC_OVER +#if defined(AC_SRC_OVER) && wxUSE_DYNLIB_CLASS // yes, now try to see if we have it during run-time typedef BOOL (WINAPI *AlphaBlend_t)(HDC,int,int,int,int, HDC,int,int,int,int, diff --git a/src/msw/dragimag.cpp b/src/msw/dragimag.cpp index a1dfb5b4b9..7bb4c4def1 100644 --- a/src/msw/dragimag.cpp +++ b/src/msw/dragimag.cpp @@ -237,6 +237,7 @@ bool wxDragImage::Create(const wxString& str, const wxCursor& cursor) return Create(wxBitmap(image), cursor); } +#if wxUSE_TREECTRL // Create a drag image for the given tree control item bool wxDragImage::Create(const wxTreeCtrl& treeCtrl, wxTreeItemId& id) { @@ -245,7 +246,9 @@ bool wxDragImage::Create(const wxTreeCtrl& treeCtrl, wxTreeItemId& id) m_hImageList = (WXHIMAGELIST) TreeView_CreateDragImage((HWND) treeCtrl.GetHWND(), (HTREEITEM) (WXHTREEITEM) id); return TRUE; } +#endif +#if wxUSE_LISTCTRL // Create a drag image for the given list control item bool wxDragImage::Create(const wxListCtrl& listCtrl, long id) { @@ -256,6 +259,7 @@ bool wxDragImage::Create(const wxListCtrl& listCtrl, long id) m_hImageList = (WXHIMAGELIST) ListView_CreateDragImage((HWND) listCtrl.GetHWND(), id, & pt); return TRUE; } +#endif // Begin drag bool wxDragImage::BeginDrag(const wxPoint& hotspot, wxWindow* window, bool fullScreen, wxRect* rect) diff --git a/src/msw/popupwin.cpp b/src/msw/popupwin.cpp index a9c0676ae3..7e44f08a0e 100644 --- a/src/msw/popupwin.cpp +++ b/src/msw/popupwin.cpp @@ -31,6 +31,8 @@ #ifndef WX_PRECOMP #endif //WX_PRECOMP +#if wxUSE_POPUPWIN + #include "wx/popupwin.h" #include "wx/msw/private.h" // for GetDesktopWindow() @@ -85,3 +87,4 @@ WXHWND wxPopupWindow::MSWGetParent() const return (WXHWND)::GetDesktopWindow(); } +#endif // #if wxUSE_POPUPWIN diff --git a/src/msw/statbr95.cpp b/src/msw/statbr95.cpp index 3205e84971..d28a6b8ae8 100644 --- a/src/msw/statbr95.cpp +++ b/src/msw/statbr95.cpp @@ -27,7 +27,7 @@ #include "wx/dcclient.h" #endif -#if defined(__WIN95__) && wxUSE_NATIVE_STATUSBAR +#if wxUSE_STATUSBAR && defined(__WIN95__) && wxUSE_NATIVE_STATUSBAR #include "wx/intl.h" #include "wx/log.h" -- 2.45.2