From ca3e85cfa8bec43f148eb1db520ab125947bf1e7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?W=C5=82odzimierz=20Skiba?= Date: Thu, 30 Mar 2006 14:04:17 +0000 Subject: [PATCH] Better backward compatibility and deprecation markup for interface deprecated in comments. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38448 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/datetime.h | 2 ++ include/wx/docview.h | 10 +++++- include/wx/event.h | 13 +++++--- include/wx/filefn.h | 5 ++- include/wx/fontdlg.h | 17 +++++++--- include/wx/gdicmn.h | 4 ++- include/wx/generic/dragimgg.h | 63 +++++++---------------------------- include/wx/generic/fontdlgg.h | 11 ++++-- include/wx/generic/listctrl.h | 5 +-- include/wx/gtk/fontdlg.h | 13 ++++++-- include/wx/gtk1/fontdlg.h | 11 ++++-- include/wx/msw/fontdlg.h | 14 +++++--- include/wx/os2/fontdlg.h | 24 ++++++------- include/wx/palmos/fontdlg.h | 5 --- samples/dialogs/dialogs.cpp | 2 +- src/common/datetime.cpp | 2 ++ src/common/event.cpp | 2 ++ src/common/gdicmn.cpp | 5 +-- src/common/sizer.cpp | 6 +++- src/generic/dragimgg.cpp | 49 +++++++++++++++++++++++++++ 20 files changed, 163 insertions(+), 100 deletions(-) diff --git a/include/wx/datetime.h b/include/wx/datetime.h index 962d0396b3..18f0829a09 100644 --- a/include/wx/datetime.h +++ b/include/wx/datetime.h @@ -704,6 +704,7 @@ public: Month month = Inv_Month, int year = Inv_Year); +#if WXWIN_COMPATIBILITY_2_6 // sets the date to the given day of the given week in the year, // returns true on success and false if given date doesn't exist (e.g. // numWeek is > 53) @@ -716,6 +717,7 @@ public: wxDEPRECATED( wxDateTime GetWeek(wxDateTime_t numWeek, WeekDay weekday = Mon, WeekFlags flags = Monday_First) const ); +#endif // WXWIN_COMPATIBILITY_2_6 // returns the date corresponding to the given week day of the given // week (in ISO notation) of the specified year diff --git a/include/wx/docview.h b/include/wx/docview.h index 13e875ceac..36a9bd114e 100644 --- a/include/wx/docview.h +++ b/include/wx/docview.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: docview.h +// Name: wx/docview.h // Purpose: Doc/View classes // Author: Julian Smart // Modified by: @@ -424,8 +424,10 @@ public: // Get the current document manager static wxDocManager* GetDocumentManager() { return sm_docManager; } +#if WXWIN_COMPATIBILITY_2_6 // deprecated, use GetHistoryFilesCount() instead wxDEPRECATED( size_t GetNoHistoryFiles() const ); +#endif // WXWIN_COMPATIBILITY_2_6 protected: long m_flags; @@ -443,10 +445,12 @@ protected: DECLARE_NO_COPY_CLASS(wxDocManager) }; +#if WXWIN_COMPATIBILITY_2_6 inline size_t wxDocManager::GetNoHistoryFiles() const { return GetHistoryFilesCount(); } +#endif // WXWIN_COMPATIBILITY_2_6 // ---------------------------------------------------------------------------- // A default child frame @@ -580,8 +584,10 @@ public: const wxList& GetMenus() const { return m_fileMenus; } +#if WXWIN_COMPATIBILITY_2_6 // deprecated, use GetCount() instead wxDEPRECATED( size_t GetNoHistoryFiles() const ); +#endif // WXWIN_COMPATIBILITY_2_6 protected: // Last n files @@ -601,10 +607,12 @@ private: DECLARE_NO_COPY_CLASS(wxFileHistory) }; +#if WXWIN_COMPATIBILITY_2_6 inline size_t wxFileHistory::GetNoHistoryFiles() const { return m_fileHistoryN; } +#endif // WXWIN_COMPATIBILITY_2_6 #if wxUSE_STD_IOSTREAM // For compatibility with existing file formats: diff --git a/include/wx/event.h b/include/wx/event.h index be29607ecb..7087fa5002 100644 --- a/include/wx/event.h +++ b/include/wx/event.h @@ -1007,8 +1007,10 @@ public: // Get Y position wxCoord GetY() const { return m_y; } +#if WXWIN_COMPATIBILITY_2_6 // deprecated, Use GetKeyCode instead. wxDEPRECATED( long KeyCode() const ); +#endif // WXWIN_COMPATIBILITY_2_6 virtual wxEvent *Clone() const { return new wxKeyEvent(*this); } @@ -2921,10 +2923,12 @@ typedef void (wxEvtHandler::*wxMouseCaptureChangedEventFunction)(wxMouseCaptureC EVT_COMMAND_SCROLL_THUMBRELEASE(winid, func) \ EVT_COMMAND_SCROLL_CHANGED(winid, func) -// compatibility macros for the old name, to be deprecated in 2.8 -#define wxEVT_SCROLL_ENDSCROLL wxEVT_SCROLL_CHANGED -#define EVT_COMMAND_SCROLL_ENDSCROLL EVT_COMMAND_SCROLL_CHANGED -#define EVT_SCROLL_ENDSCROLL EVT_SCROLL_CHANGED +#if WXWIN_COMPATIBILITY_2_6 + // compatibility macros for the old name, deprecated in 2.8 + #define wxEVT_SCROLL_ENDSCROLL wxEVT_SCROLL_CHANGED + #define EVT_COMMAND_SCROLL_ENDSCROLL EVT_COMMAND_SCROLL_CHANGED + #define EVT_SCROLL_ENDSCROLL EVT_SCROLL_CHANGED +#endif // WXWIN_COMPATIBILITY_2_6 // Convenience macros for commonly-used commands #define EVT_CHECKBOX(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_CHECKBOX_CLICKED, winid, wxCommandEventHandler(func)) @@ -3022,4 +3026,3 @@ WXDLLIMPEXP_CORE wxWindow* wxFindFocusDescendant(wxWindow* ancestor); #endif // wxUSE_GUI #endif // _WX_EVENT_H__ - diff --git a/include/wx/filefn.h b/include/wx/filefn.h index d38c8ac285..4189de1bf1 100644 --- a/include/wx/filefn.h +++ b/include/wx/filefn.h @@ -463,15 +463,14 @@ WXDLLIMPEXP_BASE bool wxRmdir(const wxString& dir, int flags = 0); WXDLLIMPEXP_BASE wxFileKind wxGetFileKind(int fd); WXDLLIMPEXP_BASE wxFileKind wxGetFileKind(FILE *fp); +#if WXWIN_COMPATIBILITY_2_6 // compatibility defines, don't use in new code -// consider removal droping 2.4 compatibility -// #if WXWIN_COMPATIBILITY_2_4 wxDEPRECATED( inline bool wxPathExists(const wxChar *pszPathName) ); inline bool wxPathExists(const wxChar *pszPathName) { return wxDirExists(pszPathName); } -// #endif //WXWIN_COMPATIBILITY_2_4 +#endif //WXWIN_COMPATIBILITY_2_6 // ---------------------------------------------------------------------------- // separators in file names diff --git a/include/wx/fontdlg.h b/include/wx/fontdlg.h index 778dbd3a25..da2fba946d 100644 --- a/include/wx/fontdlg.h +++ b/include/wx/fontdlg.h @@ -43,12 +43,12 @@ public: const wxFontData& GetFontData() const { return m_fontData; } wxFontData& GetFontData() { return m_fontData; } +#if WXWIN_COMPATIBILITY_2_6 // deprecated interface, for compatibility only, don't use - wxFontDialogBase(wxWindow *parent, const wxFontData *data) - { m_parent = parent; InitFontData(data); } + wxDEPRECATED( wxFontDialogBase(wxWindow *parent, const wxFontData *data) ); - bool Create(wxWindow *parent, const wxFontData *data) - { InitFontData(data); return Create(parent); } + wxDEPRECATED( bool Create(wxWindow *parent, const wxFontData *data) ); +#endif // WXWIN_COMPATIBILITY_2_6 protected: virtual bool DoCreate(wxWindow *parent) { m_parent = parent; return true; } @@ -61,6 +61,15 @@ protected: DECLARE_NO_COPY_CLASS(wxFontDialogBase) }; +#if WXWIN_COMPATIBILITY_2_6 + // deprecated interface, for compatibility only, don't use +inline wxFontDialogBase::wxFontDialogBase(wxWindow *parent, const wxFontData *data) +{ m_parent = parent; InitFontData(data); } + +inline bool wxFontDialogBase::Create(wxWindow *parent, const wxFontData *data) +{ InitFontData(data); return Create(parent); } +#endif // WXWIN_COMPATIBILITY_2_6 + // ---------------------------------------------------------------------------- // platform-specific wxFontDialog implementation // ---------------------------------------------------------------------------- diff --git a/include/wx/gdicmn.h b/include/wx/gdicmn.h index b6faf8900d..f823993b03 100644 --- a/include/wx/gdicmn.h +++ b/include/wx/gdicmn.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: gdicmn.h +// Name: wx/gdicmn.h // Purpose: Common GDI classes, types and declarations // Author: Julian Smart // Modified by: @@ -503,8 +503,10 @@ public: // add a new colour to the database void AddColour(const wxString& name, const wxColour& colour); +#if WXWIN_COMPATIBILITY_2_6 // deprecated, use Find() instead wxDEPRECATED( wxColour *FindColour(const wxString& name) ); +#endif // WXWIN_COMPATIBILITY_2_6 #ifdef __WXPM__ diff --git a/include/wx/generic/dragimgg.h b/include/wx/generic/dragimgg.h index 6cfcee1bd3..72dde38d4d 100644 --- a/include/wx/generic/dragimgg.h +++ b/include/wx/generic/dragimgg.h @@ -100,13 +100,6 @@ public: Create(cursor); } - // Deprecated version of the above - wxGenericDragImage(const wxCursor& cursor, const wxPoint& cursorHotspot) - { - Init(); - Create(cursor, cursorHotspot); - } - wxGenericDragImage(const wxBitmap& image, const wxCursor& cursor = wxNullCursor) { Init(); @@ -114,14 +107,6 @@ public: Create(image, cursor); } - // Deprecated version of the above - wxGenericDragImage(const wxBitmap& image, const wxCursor& cursor, const wxPoint& cursorHotspot) - { - Init(); - - Create(image, cursor, cursorHotspot); - } - wxGenericDragImage(const wxIcon& image, const wxCursor& cursor = wxNullCursor) { Init(); @@ -129,14 +114,6 @@ public: Create(image, cursor); } - // Deprecated version of the above - wxGenericDragImage(const wxIcon& image, const wxCursor& cursor, const wxPoint& cursorHotspot) - { - Init(); - - Create(image, cursor, cursorHotspot); - } - wxGenericDragImage(const wxString& str, const wxCursor& cursor = wxNullCursor) { Init(); @@ -144,13 +121,17 @@ public: Create(str, cursor); } - // Deprecated version of the above - wxGenericDragImage(const wxString& str, const wxCursor& cursor, const wxPoint& cursorHotspot) - { - Init(); - - Create(str, cursor, cursorHotspot); - } +#if WXWIN_COMPATIBILITY_2_6 + // don't use in new code, use versions without hot spot parameter + wxDEPRECATED( wxGenericDragImage(const wxCursor& cursor, const wxPoint& cursorHotspot) ); + wxDEPRECATED( wxGenericDragImage(const wxBitmap& image, const wxCursor& cursor, const wxPoint& cursorHotspot) ); + wxDEPRECATED( wxGenericDragImage(const wxIcon& image, const wxCursor& cursor, const wxPoint& cursorHotspot) ); + wxDEPRECATED( wxGenericDragImage(const wxString& str, const wxCursor& cursor, const wxPoint& cursorHotspot) ); + wxDEPRECATED( bool Create(const wxCursor& cursor, const wxPoint& cursorHotspot) ); + wxDEPRECATED( bool Create(const wxBitmap& image, const wxCursor& cursor, const wxPoint& cursorHotspot) ); + wxDEPRECATED( bool Create(const wxIcon& image, const wxCursor& cursor, const wxPoint& cursorHotspot) ); + wxDEPRECATED( bool Create(const wxString& str, const wxCursor& cursor, const wxPoint& cursorHotspot) ); +#endif // WXWIN_COMPATIBILITY_2_6 #if wxUSE_TREECTRL wxGenericDragImage(const wxTreeCtrl& treeCtrl, wxTreeItemId& id) @@ -184,35 +165,15 @@ public: // Create a drag image with a virtual image (need to override DoDrawImage, GetImageRect) bool Create(const wxCursor& cursor = wxNullCursor); - bool Create(const wxCursor& cursor, const wxPoint& WXUNUSED(cursorHotspot)) - { - wxLogDebug(wxT("wxDragImage::Create: use of a cursor hotspot is now deprecated. Please omit this argument.")); - return Create(cursor); - } // Create a drag image from a bitmap and optional cursor bool Create(const wxBitmap& image, const wxCursor& cursor = wxNullCursor); - bool Create(const wxBitmap& image, const wxCursor& cursor, const wxPoint& WXUNUSED(cursorHotspot)) - { - wxLogDebug(wxT("wxDragImage::Create: use of a cursor hotspot is now deprecated. Please omit this argument.")); - return Create(image, cursor); - } // Create a drag image from an icon and optional cursor bool Create(const wxIcon& image, const wxCursor& cursor = wxNullCursor); - bool Create(const wxIcon& image, const wxCursor& cursor, const wxPoint& WXUNUSED(cursorHotspot)) - { - wxLogDebug(wxT("wxDragImage::Create: use of a cursor hotspot is now deprecated. Please omit this argument.")); - return Create(image, cursor); - } // Create a drag image from a string and optional cursor bool Create(const wxString& str, const wxCursor& cursor = wxNullCursor); - bool Create(const wxString& str, const wxCursor& cursor, const wxPoint& WXUNUSED(cursorHotspot)) - { - wxLogDebug(wxT("wxDragImage::Create: use of a cursor hotspot is now deprecated. Please omit this argument.")); - return Create(str, cursor); - } #if wxUSE_TREECTRL // Create a drag image for the given tree control item @@ -263,7 +224,7 @@ public: // Instead, paint the drag image's backing bitmap to be correct, and leave the window // to be updated only when dragging the objects away (thus giving a smoother appearance). virtual bool UpdateBackingFromWindow(wxDC& windowDC, wxMemoryDC& destDC, - const wxRect& sourceRect, const wxRect& destRect) const; + const wxRect& sourceRect, const wxRect& destRect) const; // Erase and redraw simultaneously if possible virtual bool RedrawImage(const wxPoint& oldPos, const wxPoint& newPos, bool eraseOld, bool drawNew); diff --git a/include/wx/generic/fontdlgg.h b/include/wx/generic/fontdlgg.h index e1a81c3d1a..485b99fdd3 100644 --- a/include/wx/generic/fontdlgg.h +++ b/include/wx/generic/fontdlgg.h @@ -54,9 +54,10 @@ public: virtual int ShowModal(); +#if WXWIN_COMPATIBILITY_2_6 // deprecated, for backwards compatibility only - wxGenericFontDialog(wxWindow *parent, const wxFontData *data) - : wxFontDialogBase(parent, data) { Init(); } + wxDEPRECATED( wxGenericFontDialog(wxWindow *parent, const wxFontData *data) ); +#endif // WXWIN_COMPATIBILITY_2_6 // Internal functions void OnCloseWindow(wxCloseEvent& event); @@ -108,4 +109,10 @@ WXDLLEXPORT int wxFontFamilyStringToInt(wxChar *family); WXDLLEXPORT int wxFontWeightStringToInt(wxChar *weight); WXDLLEXPORT int wxFontStyleStringToInt(wxChar *style); +#if WXWIN_COMPATIBILITY_2_6 + // deprecated, for backwards compatibility only +inline wxGenericFontDialog::wxGenericFontDialog(wxWindow *parent, const wxFontData *data) + :wxFontDialogBase(parent) { Init(); InitFontData(data); Create(parent); } +#endif // WXWIN_COMPATIBILITY_2_6 + #endif // _WX_GENERIC_FONTDLGG_H diff --git a/include/wx/generic/listctrl.h b/include/wx/generic/listctrl.h index 9d80b4f308..a35bc0e7a5 100644 --- a/include/wx/generic/listctrl.h +++ b/include/wx/generic/listctrl.h @@ -177,9 +177,10 @@ public: void RefreshItem(long item); void RefreshItems(long itemFrom, long itemTo); +#if WXWIN_COMPATIBILITY_2_6 // obsolete, don't use wxDEPRECATED( int GetItemSpacing( bool isSmall ) const ); - +#endif // WXWIN_COMPATIBILITY_2_6 virtual wxVisualAttributes GetDefaultAttributes() const { @@ -244,7 +245,7 @@ protected: virtual wxString OnGetItemText(long item, long column) const; // return the icon for the given item. In report view, OnGetItemImage will - // only be called for the first column. See OnGetItemColumnImage for + // only be called for the first column. See OnGetItemColumnImage for // details. virtual int OnGetItemImage(long item) const; diff --git a/include/wx/gtk/fontdlg.h b/include/wx/gtk/fontdlg.h index 9f3e37f2ec..e1ec055711 100644 --- a/include/wx/gtk/fontdlg.h +++ b/include/wx/gtk/fontdlg.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: fontdlgg.h +// Name: wx/gtk/fontdlgg.h // Purpose: wxFontDialog // Author: Robert Roebling // Created: @@ -29,9 +29,10 @@ public: // implementation only void SetChosenFont(const char *name); +#if WXWIN_COMPATIBILITY_2_6 // deprecated interface, don't use - wxFontDialog(wxWindow *parent, const wxFontData *data) - : wxFontDialogBase(parent, data) { Create(parent, data); } + wxDEPRECATED( wxFontDialog(wxWindow *parent, const wxFontData *data) ); +#endif // WXWIN_COMPATIBILITY_2_6 protected: // create the GTK dialog @@ -41,4 +42,10 @@ private: DECLARE_DYNAMIC_CLASS(wxFontDialog) }; +#if WXWIN_COMPATIBILITY_2_6 + // deprecated interface, don't use +inline wxFontDialog::wxFontDialog(wxWindow *parent, const wxFontData *data) + : wxFontDialogBase(parent) { InitFontData(data); Create(parent); } +#endif // WXWIN_COMPATIBILITY_2_6 + #endif diff --git a/include/wx/gtk1/fontdlg.h b/include/wx/gtk1/fontdlg.h index 3a9366edce..aebdeb52d3 100644 --- a/include/wx/gtk1/fontdlg.h +++ b/include/wx/gtk1/fontdlg.h @@ -29,9 +29,10 @@ public: // implementation only void SetChosenFont(const char *name); +#if WXWIN_COMPATIBILITY_2_6 // deprecated interface, don't use - wxFontDialog(wxWindow *parent, const wxFontData *data) - : wxFontDialogBase(parent, data) { Create(parent, data); } + wxDEPRECATED( wxFontDialog(wxWindow *parent, const wxFontData *data) ); +#endif // WXWIN_COMPATIBILITY_2_6 protected: // create the GTK dialog @@ -41,4 +42,10 @@ private: DECLARE_DYNAMIC_CLASS(wxFontDialog) }; +#if WXWIN_COMPATIBILITY_2_6 + // deprecated interface, don't use +inline wxFontDialog::wxFontDialog(wxWindow *parent, const wxFontData *data) + : wxFontDialogBase(parent) { InitFontData(data); Create(parent); } +#endif // WXWIN_COMPATIBILITY_2_6 + #endif diff --git a/include/wx/msw/fontdlg.h b/include/wx/msw/fontdlg.h index 24d11c8535..92d6078b45 100644 --- a/include/wx/msw/fontdlg.h +++ b/include/wx/msw/fontdlg.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: fontdlg.h +// Name: wx/msw/fontdlg.h // Purpose: wxFontDialog class // Author: Julian Smart // Modified by: @@ -27,14 +27,20 @@ public: virtual int ShowModal(); +#if WXWIN_COMPATIBILITY_2_6 // deprecated interface, don't use - wxFontDialog(wxWindow *parent, const wxFontData *data) - : wxFontDialogBase(parent, data) { Create(parent, data); } + wxDEPRECATED( wxFontDialog(wxWindow *parent, const wxFontData *data) ); +#endif // WXWIN_COMPATIBILITY_2_6 protected: DECLARE_DYNAMIC_CLASS_NO_COPY(wxFontDialog) }; +#if WXWIN_COMPATIBILITY_2_6 + // deprecated interface, don't use +inline wxFontDialog::wxFontDialog(wxWindow *parent, const wxFontData *data) + : wxFontDialogBase(parent) { InitFontData(data); Create(parent); } +#endif // WXWIN_COMPATIBILITY_2_6 + #endif // _WX_MSW_FONTDLG_H_ - diff --git a/include/wx/os2/fontdlg.h b/include/wx/os2/fontdlg.h index 4dff23ca4b..27031b6fcf 100644 --- a/include/wx/os2/fontdlg.h +++ b/include/wx/os2/fontdlg.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: fontdlg.h +// Name: wx/os2/fontdlg.h // Purpose: wxFontDialog class. Use generic version if no // platform-specific implementation. // Author: David Webster @@ -39,24 +39,22 @@ public: virtual int ShowModal(); +#if WXWIN_COMPATIBILITY_2_6 // // Deprecated interface, don't use // - wxFontDialog( wxWindow* pParent - ,const wxFontData* pData - ) - : wxFontDialogBase( pParent - ,pData - ) - { - Create( pParent - ,pData - ); - } + wxDEPRECATED( wxFontDialog( wxWindow* pParent, const wxFontData* pData ) ); +#endif // WXWIN_COMPATIBILITY_2_6 + protected: DECLARE_DYNAMIC_CLASS(wxFontDialog) }; // end of CLASS wxFontDialog +#if WXWIN_COMPATIBILITY_2_6 + // deprecated interface, don't use +inline wxFontDialog::wxFontDialog(wxWindow *parent, const wxFontData *data) + : wxFontDialogBase(parent) { InitFontData(data); Create(parent); } +#endif // WXWIN_COMPATIBILITY_2_6 + #endif // _WX_FONTDLG_H_ - diff --git a/include/wx/palmos/fontdlg.h b/include/wx/palmos/fontdlg.h index 4ed8628878..7fb66d71e5 100644 --- a/include/wx/palmos/fontdlg.h +++ b/include/wx/palmos/fontdlg.h @@ -27,14 +27,9 @@ public: virtual int ShowModal(); - // deprecated interface, don't use - wxFontDialog(wxWindow *parent, const wxFontData *data) - : wxFontDialogBase(parent, data) { Create(parent, data); } - protected: DECLARE_DYNAMIC_CLASS_NO_COPY(wxFontDialog) }; #endif // _WX_PALMOS_FONTDLG_H_ - diff --git a/samples/dialogs/dialogs.cpp b/samples/dialogs/dialogs.cpp index 55bc4b3f28..035c2e1557 100644 --- a/samples/dialogs/dialogs.cpp +++ b/samples/dialogs/dialogs.cpp @@ -504,7 +504,7 @@ void MyFrame::ChooseFontGeneric(wxCommandEvent& WXUNUSED(event) ) data.SetInitialFont(wxGetApp().m_canvasFont); data.SetColour(wxGetApp().m_canvasTextColour); - wxGenericFontDialog *dialog = new wxGenericFontDialog(this, &data); + wxGenericFontDialog *dialog = new wxGenericFontDialog(this, data); if (dialog->ShowModal() == wxID_OK) { wxFontData retData = dialog->GetFontData(); diff --git a/src/common/datetime.cpp b/src/common/datetime.cpp index 31d6a2ad18..5f7f6931e2 100644 --- a/src/common/datetime.cpp +++ b/src/common/datetime.cpp @@ -1811,6 +1811,7 @@ wxDateTime::SetToWeekOfYear(int year, wxDateTime_t numWeek, WeekDay wd) return dt; } +#if WXWIN_COMPATIBILITY_2_6 // use a separate function to avoid warnings about using deprecated // SetToTheWeek in GetWeek below static wxDateTime @@ -1848,6 +1849,7 @@ wxDateTime wxDateTime::GetWeek(wxDateTime_t numWeek, { return ::SetToTheWeek(GetYear(), numWeek, weekday, flags); } +#endif // WXWIN_COMPATIBILITY_2_6 wxDateTime& wxDateTime::SetToLastMonthDay(Month month, int year) diff --git a/src/common/event.cpp b/src/common/event.cpp index e0ea296ae2..a4f85d7d61 100644 --- a/src/common/event.cpp +++ b/src/common/event.cpp @@ -736,10 +736,12 @@ wxKeyEvent::wxKeyEvent(const wxKeyEvent& evt) #endif } +#if WXWIN_COMPATIBILITY_2_6 long wxKeyEvent::KeyCode() const { return m_keyCode; } +#endif // WXWIN_COMPATIBILITY_2_6 wxWindowCreateEvent::wxWindowCreateEvent(wxWindow *win) { diff --git a/src/common/gdicmn.cpp b/src/common/gdicmn.cpp index f2f3c71420..e2c0f65521 100644 --- a/src/common/gdicmn.cpp +++ b/src/common/gdicmn.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: gdicmn.cpp +// Name: src/common/gdicmn.cpp // Purpose: Common GDI classes // Author: Julian Smart // Modified by: @@ -488,6 +488,7 @@ wxString wxColourDatabase::FindName(const wxColour& colour) const // deprecated wxColourDatabase methods // ---------------------------------------------------------------------------- +#if WXWIN_COMPATIBILITY_2_6 wxColour *wxColourDatabase::FindColour(const wxString& name) { // This function is deprecated, use Find() instead. @@ -516,6 +517,7 @@ wxColour *wxColourDatabase::FindColour(const wxString& name) return new wxColour(s_col); } +#endif // WXWIN_COMPATIBILITY_2_6 // ============================================================================ // stock objects @@ -950,4 +952,3 @@ wxResourceCache::~wxResourceCache () node = node->GetNext (); } } - diff --git a/src/common/sizer.cpp b/src/common/sizer.cpp index b250c0c048..ea63c184c9 100644 --- a/src/common/sizer.cpp +++ b/src/common/sizer.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: sizer.cpp +// Name: src/common/sizer.cpp // Purpose: provide new wxSizer class for layout // Author: Robert Roebling and Robin Dunn, contributions by // Dirk Holtwick, Ron Lee @@ -473,6 +473,7 @@ bool wxSizerItem::IsShown() const return false; } +#if WXWIN_COMPATIBILITY_2_6 void wxSizerItem::SetOption( int option ) { SetProportion( option ); @@ -482,6 +483,7 @@ int wxSizerItem::GetOption() const { return GetProportion(); } +#endif // WXWIN_COMPATIBILITY_2_6 //--------------------------------------------------------------------------- @@ -503,10 +505,12 @@ wxSizerItem* wxSizer::Insert( size_t index, wxSizerItem *item ) return item; } +#if WXWIN_COMPATIBILITY_2_6 bool wxSizer::Remove( wxWindow *window ) { return Detach( window ); } +#endif // WXWIN_COMPATIBILITY_2_6 bool wxSizer::Remove( wxSizer *sizer ) { diff --git a/src/generic/dragimgg.cpp b/src/generic/dragimgg.cpp index fd104aad66..31c91dc092 100644 --- a/src/generic/dragimgg.cpp +++ b/src/generic/dragimgg.cpp @@ -79,6 +79,55 @@ void wxGenericDragImage::Init() m_pBackingBitmap = (wxBitmap*) NULL; } +#if WXWIN_COMPATIBILITY_2_6 +wxGenericDragImage::wxGenericDragImage(const wxCursor& cursor, const wxPoint& WXUNUSED(cursorHotspot)) +{ + Init(); + Create(cursor); +} + +wxGenericDragImage::wxGenericDragImage(const wxBitmap& image, const wxCursor& cursor, const wxPoint& WXUNUSED(cursorHotspot)) +{ + Init(); + + Create(image, cursor); +} + +wxGenericDragImage::wxGenericDragImage(const wxIcon& image, const wxCursor& cursor, const wxPoint& WXUNUSED(cursorHotspot)) +{ + Init(); + + Create(image, cursor); +} + +wxGenericDragImage::wxGenericDragImage(const wxString& str, const wxCursor& cursor, const wxPoint& WXUNUSED(cursorHotspot)) +{ + Init(); + + Create(str, cursor); +} + +bool wxGenericDragImage::Create(const wxCursor& cursor, const wxPoint& WXUNUSED(cursorHotspot)) +{ + return Create(cursor); +} + +bool wxGenericDragImage::Create(const wxBitmap& image, const wxCursor& cursor, const wxPoint& WXUNUSED(cursorHotspot)) +{ + return Create(image, cursor); +} + +bool wxGenericDragImage::Create(const wxIcon& image, const wxCursor& cursor, const wxPoint& WXUNUSED(cursorHotspot)) +{ + return Create(image, cursor); +} + +bool wxGenericDragImage::Create(const wxString& str, const wxCursor& cursor, const wxPoint& WXUNUSED(cursorHotspot)) +{ + return Create(str, cursor); +} +#endif // WXWIN_COMPATIBILITY_2_6 + // Attributes //////////////////////////////////////////////////////////////////////////// -- 2.45.2