From: Vadim Zeitlin Date: Sat, 7 Jan 2012 15:09:37 +0000 (+0000) Subject: Replace 3 copies of wxListCtrl mode tests with a single one in wxListCtrlBase. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/a9bd911fde1c5ff922b2e6bf0aeacad3ae6beb82 Replace 3 copies of wxListCtrl mode tests with a single one in wxListCtrlBase. Move InReportView() and IsVirtual() into the base class as they were the same in all the implementations. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70281 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/generic/listctrl.h b/include/wx/generic/listctrl.h index 63de1ff1ac..5b8de4c7c6 100644 --- a/include/wx/generic/listctrl.h +++ b/include/wx/generic/listctrl.h @@ -140,12 +140,6 @@ public: bool ScrollList( int dx, int dy ); bool SortItems( wxListCtrlCompare fn, wxIntPtr data ); - // are we in report mode? - bool InReportView() const { return HasFlag(wxLC_REPORT); } - - // are we in virtual report mode? - bool IsVirtual() const { return HasFlag(wxLC_VIRTUAL); } - // do we have a header window? bool HasHeader() const { return InReportView() && !HasFlag(wxLC_NO_HEADER); } diff --git a/include/wx/listbase.h b/include/wx/listbase.h index 8246ad83c8..55849b3c76 100644 --- a/include/wx/listbase.h +++ b/include/wx/listbase.h @@ -383,6 +383,10 @@ class WXDLLIMPEXP_CORE wxListCtrlBase : public wxControl { public: wxListCtrlBase() { } + + // Convenient functions for testing the list control mode: + bool InReportView() const { return HasFlag(wxLC_REPORT); } + bool IsVirtual() const { return HasFlag(wxLC_VIRTUAL); } }; // ---------------------------------------------------------------------------- diff --git a/include/wx/msw/listctrl.h b/include/wx/msw/listctrl.h index dd11f1e4a4..c4cb6597ac 100644 --- a/include/wx/msw/listctrl.h +++ b/include/wx/msw/listctrl.h @@ -256,12 +256,6 @@ public: void SetImageList(wxImageList *imageList, int which); void AssignImageList(wxImageList *imageList, int which); - // are we in report mode? - bool InReportView() const { return HasFlag(wxLC_REPORT); } - - // are we in virtual report mode? - bool IsVirtual() const { return HasFlag(wxLC_VIRTUAL); } - // refresh items selectively (only useful for virtual list controls) void RefreshItem(long item); void RefreshItems(long itemFrom, long itemTo); diff --git a/include/wx/osx/listctrl.h b/include/wx/osx/listctrl.h index 681775f0ca..0e9fcf1226 100644 --- a/include/wx/osx/listctrl.h +++ b/include/wx/osx/listctrl.h @@ -160,11 +160,6 @@ class WXDLLIMPEXP_CORE wxListCtrl: public wxListCtrlBase // list or report view long GetTopItem() const ; - // are we in report mode? - bool InReportView() const { return HasFlag(wxLC_REPORT); } - - bool IsVirtual() const { return HasFlag(wxLC_VIRTUAL); } - // Add or remove a single window style void SetSingleStyle(long style, bool add = true) ;