From e409b62aaf6b333803027645ecc77de6c92cae2d Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Mon, 2 Oct 2006 17:38:30 +0000 Subject: [PATCH] listctrl header cleanup git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41568 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/generic/listctrl.h | 26 ++++++-------------------- include/wx/listbase.h | 9 +-------- include/wx/listctrl.h | 6 ++---- include/wx/mac/carbon/listctrl.h | 8 -------- include/wx/msw/listctrl.h | 9 +-------- src/common/datacmn.cpp | 1 - src/common/listctrlcmn.cpp | 6 ++++++ src/generic/listctrl.cpp | 19 ++++++------------- src/mac/carbon/listctrl_mac.cpp | 10 +++------- src/msw/listctrl.cpp | 3 ++- 10 files changed, 27 insertions(+), 70 deletions(-) diff --git a/include/wx/generic/listctrl.h b/include/wx/generic/listctrl.h index 7011156080..07cec7f0c8 100644 --- a/include/wx/generic/listctrl.h +++ b/include/wx/generic/listctrl.h @@ -8,21 +8,13 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifndef __LISTCTRLH_G__ -#define __LISTCTRLH_G__ - -#include "wx/defs.h" -#include "wx/object.h" -#include "wx/imaglist.h" - -#include "wx/control.h" -#include "wx/timer.h" -#include "wx/dcclient.h" -#include "wx/scrolwin.h" -#include "wx/settings.h" -#include "wx/listctrl.h" +#ifndef _WX_GENERIC_LISTCTRL_H_ +#define _WX_GENERIC_LISTCTRL_H_ + #include "wx/textctrl.h" +class WXDLLIMPEXP_CORE wxImageList; + #if wxUSE_DRAG_AND_DROP class WXDLLEXPORT wxDropTarget; #endif @@ -36,15 +28,9 @@ class WXDLLEXPORT wxDropTarget; // internal classes //----------------------------------------------------------------------------- -class WXDLLEXPORT wxListHeaderData; -class WXDLLEXPORT wxListItemData; - class WXDLLEXPORT wxListHeaderWindow; class WXDLLEXPORT wxListMainWindow; -class WXDLLEXPORT wxListRenameTimer; -class WXDLLEXPORT wxListTextCtrl; - //----------------------------------------------------------------------------- // wxListCtrl //----------------------------------------------------------------------------- @@ -286,4 +272,4 @@ public: }; #endif // !__WXMSW__ || __WXUNIVERSAL__ -#endif // __LISTCTRLH_G__ +#endif // _WX_GENERIC_LISTCTRL_H_ diff --git a/include/wx/listbase.h b/include/wx/listbase.h index 84bb31b99f..33cc52f924 100644 --- a/include/wx/listbase.h +++ b/include/wx/listbase.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: wx/listctrl.h +// Name: wx/listbase.h // Purpose: wxListCtrl class // Author: Vadim Zeitlin // Modified by: @@ -12,14 +12,9 @@ #ifndef _WX_LISTBASE_H_BASE_ #define _WX_LISTBASE_H_BASE_ -#include "wx/defs.h" - -#if wxUSE_LISTCTRL - #include "wx/colour.h" #include "wx/font.h" #include "wx/gdicmn.h" - #include "wx/event.h" // ---------------------------------------------------------------------------- @@ -492,7 +487,5 @@ typedef void (wxEvtHandler::*wxListEventFunction)(wxListEvent&); #define EVT_LIST_SET_INFO(id, fn) wx__DECLARE_LISTEVT(SET_INFO, id, fn) #endif -#endif // wxUSE_LISTCTRL - #endif // _WX_LISTCTRL_H_BASE_ diff --git a/include/wx/listctrl.h b/include/wx/listctrl.h index d92e26d7b0..f8385b6ab5 100644 --- a/include/wx/listctrl.h +++ b/include/wx/listctrl.h @@ -28,14 +28,12 @@ extern WXDLLEXPORT_DATA(const wxChar) wxListCtrlNameStr[]; // include the wxListCtrl class declaration // ---------------------------------------------------------------------------- -#if !defined(__WXMSW__) || defined(__WXUNIVERSAL__) - #include "wx/generic/listctrl.h" -#endif - #if defined(__WIN32__) && !defined(__WXUNIVERSAL__) #include "wx/msw/listctrl.h" #elif defined(__WXMAC__) #include "wx/mac/carbon/listctrl.h" +#else + #include "wx/generic/listctrl.h" #endif // ---------------------------------------------------------------------------- diff --git a/include/wx/mac/carbon/listctrl.h b/include/wx/mac/carbon/listctrl.h index d77061e7c5..d61a9c55fd 100644 --- a/include/wx/mac/carbon/listctrl.h +++ b/include/wx/mac/carbon/listctrl.h @@ -12,17 +12,11 @@ #ifndef _WX_LISTCTRL_H_ #define _WX_LISTCTRL_H_ -#include "wx/control.h" -#include "wx/event.h" -#include "wx/imaglist.h" #include "wx/generic/listctrl.h" class wxMacDataBrowserListCtrlControl; class wxMacListControl; -// type of compare function for wxListCtrl sort operation -typedef int (*wxListCtrlCompare)(long item1, long item2, long sortData); - class WXDLLEXPORT wxListCtrl: public wxControl { DECLARE_DYNAMIC_CLASS(wxListCtrl) @@ -343,7 +337,5 @@ protected: int m_count; // for virtual lists, store item count }; -typedef void (wxEvtHandler::*wxListEventFunction)(wxListEvent&); - #endif // _WX_LISTCTRL_H_ diff --git a/include/wx/msw/listctrl.h b/include/wx/msw/listctrl.h index 4bb1855f5e..81a0f2fa08 100644 --- a/include/wx/msw/listctrl.h +++ b/include/wx/msw/listctrl.h @@ -12,15 +12,10 @@ #ifndef _WX_LISTCTRL_H_ #define _WX_LISTCTRL_H_ -#if wxUSE_LISTCTRL - #include "wx/control.h" -#include "wx/event.h" -#include "wx/hash.h" -#include "wx/textctrl.h" - class WXDLLEXPORT wxImageList; +class WXDLLIMPEXP_CORE wxTextCtrl; /* The wxListCtrl can show lists of items in four different modes: @@ -439,6 +434,4 @@ private: DECLARE_NO_COPY_CLASS(wxListCtrl) }; -#endif // wxUSE_LISTCTRL - #endif // _WX_LISTCTRL_H_ diff --git a/src/common/datacmn.cpp b/src/common/datacmn.cpp index 15667bb34c..0529ce3836 100644 --- a/src/common/datacmn.cpp +++ b/src/common/datacmn.cpp @@ -46,7 +46,6 @@ extern WXDLLEXPORT_DATA(const wxChar) wxDialogNameStr[] = wxT("dialog"); extern WXDLLEXPORT_DATA(const wxChar) wxFrameNameStr[] = wxT("frame"); extern WXDLLEXPORT_DATA(const wxChar) wxStaticBoxNameStr[] = wxT("groupBox"); extern WXDLLEXPORT_DATA(const wxChar) wxListBoxNameStr[] = wxT("listBox"); -extern WXDLLEXPORT_DATA(const wxChar) wxListCtrlNameStr[] = wxT("listCtrl"); extern WXDLLEXPORT_DATA(const wxChar) wxStaticTextNameStr[] = wxT("staticText"); extern WXDLLEXPORT_DATA(const wxChar) wxStaticBitmapNameStr[] = wxT("staticBitmap"); extern WXDLLEXPORT_DATA(const wxChar) wxNotebookNameStr[] = wxT("notebook"); diff --git a/src/common/listctrlcmn.cpp b/src/common/listctrlcmn.cpp index 88fdb5767b..36387bcdc4 100644 --- a/src/common/listctrlcmn.cpp +++ b/src/common/listctrlcmn.cpp @@ -18,8 +18,13 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" + +#if wxUSE_LISTCTRL + #include "wx/listctrl.h" +const wxChar wxListCtrlNameStr[] = wxT("listCtrl"); + // ListCtrl events DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_BEGIN_DRAG) DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_BEGIN_RDRAG) @@ -46,3 +51,4 @@ DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_ITEM_ACTIVATED) DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_ITEM_FOCUSED) DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_CACHE_HINT) +#endif // wxUSE_LISTCTRL diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index b6ca0aa425..952596d171 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -23,34 +23,27 @@ #if wxUSE_LISTCTRL -// under Win32 we always use the native version and also may use the generic -// one, however some things should be done only if we use only the generic -// version -#if (defined(__WIN32__) && !defined(__WXUNIVERSAL__)) || defined(__WXMAC__) - #define HAVE_NATIVE_LISTCTRL -#endif - -// if we have the native control, wx/listctrl.h declares it and not this one #include "wx/listctrl.h" -#ifndef HAVE_NATIVE_LISTCTRL +#if (!defined(__WXMSW__) || defined(__WXUNIVERSAL__)) && !defined(__WXMAC__) // if we have a native version, its implementation file does all this IMPLEMENT_DYNAMIC_CLASS(wxListItem, wxObject) IMPLEMENT_DYNAMIC_CLASS(wxListView, wxListCtrl) IMPLEMENT_DYNAMIC_CLASS(wxListEvent, wxNotifyEvent) IMPLEMENT_DYNAMIC_CLASS(wxListCtrl, wxGenericListCtrl) -#endif // HAVE_NATIVE_LISTCTRL/!HAVE_NATIVE_LISTCTRL +#endif #ifndef WX_PRECOMP + #include "wx/scrolwin.h" + #include "wx/timer.h" + #include "wx/settings.h" #include "wx/dynarray.h" - #include "wx/app.h" #include "wx/dcscreen.h" - #include "wx/textctrl.h" - #include "wx/listbox.h" #include "wx/math.h" #endif +#include "wx/imaglist.h" #include "wx/selstore.h" #include "wx/renderer.h" diff --git a/src/mac/carbon/listctrl_mac.cpp b/src/mac/carbon/listctrl_mac.cpp index 6e5848c6a4..46d53fe1bc 100644 --- a/src/mac/carbon/listctrl_mac.cpp +++ b/src/mac/carbon/listctrl_mac.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: src/msw/listctrl.cpp +// Name: src/mac/listctrl_mac.cpp // Purpose: wxListCtrl // Author: Julian Smart // Modified by: Agron Selimaj @@ -26,19 +26,15 @@ #if wxUSE_LISTCTRL +#include "wx/listctrl.h" + #ifndef WX_PRECOMP - #include "wx/app.h" #include "wx/intl.h" - #include "wx/log.h" - #include "wx/settings.h" - #include "wx/dcclient.h" - #include "wx/textctrl.h" #endif #include "wx/mac/uma.h" #include "wx/imaglist.h" -#include "wx/listctrl.h" #include "wx/sysopt.h" #define wxMAC_ALWAYS_USE_GENERIC_LISTCTRL wxT("mac.listctrl.always_use_generic") diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index d3adde8fd1..a0301aec4a 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -26,6 +26,8 @@ #if wxUSE_LISTCTRL +#include "wx/listctrl.h" + #ifndef WX_PRECOMP #include "wx/msw/wrapcctl.h" // include "properly" #include "wx/app.h" @@ -37,7 +39,6 @@ #endif #include "wx/imaglist.h" -#include "wx/listctrl.h" #include "wx/msw/private.h" -- 2.45.2