From b31989e20882186006e2b2c4b8062ba8394b539d Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Mon, 22 Jul 2002 23:03:03 +0000 Subject: [PATCH] Added wxListCtrl to derive from wxGenericListCtrl, ditto for wxImageList git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16254 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/generic/imaglist.h | 20 ++++++++++++++++++++ include/wx/generic/listctrl.h | 26 ++++++++++++++++++++++++-- include/wx/imaglist.h | 9 +++------ include/wx/listctrl.h | 7 ++----- src/generic/imaglist.cpp | 9 +++++++++ src/generic/listctrl.cpp | 9 +++++++++ 6 files changed, 67 insertions(+), 13 deletions(-) diff --git a/include/wx/generic/imaglist.h b/include/wx/generic/imaglist.h index a953bad4e4..337d045258 100644 --- a/include/wx/generic/imaglist.h +++ b/include/wx/generic/imaglist.h @@ -84,5 +84,25 @@ private: DECLARE_DYNAMIC_CLASS(wxGenericImageList) }; +#if !defined(__WXMSW__) || defined(__WIN16__) || defined(__WXUNIVERSAL__) +/* + * wxImageList has to be a real class or we have problems with + * the run-time information. + */ + +class WXDLLEXPORT wxImageList: public wxGenericImageList +{ + DECLARE_DYNAMIC_CLASS(wxImageList) + +public: + wxImageList() {} + + wxImageList( int width, int height, bool mask = TRUE, int initialCount = 1 ) + : wxGenericImageList(width, height, mask, initialCount) + { + } +}; +#endif // !__WXMSW__ || __WIN16__ || __WXUNIVERSAL__ + #endif // __IMAGELISTH_G__ diff --git a/include/wx/generic/listctrl.h b/include/wx/generic/listctrl.h index 8ac82905be..0576e00126 100644 --- a/include/wx/generic/listctrl.h +++ b/include/wx/generic/listctrl.h @@ -220,7 +220,29 @@ private: DECLARE_DYNAMIC_CLASS(wxGenericListCtrl); }; +#if !defined(__WXMSW__) || defined(__WIN16__) || defined(__WXUNIVERSAL__) +/* + * wxListCtrl has to be a real class or we have problems with + * the run-time information. + */ -#endif // __LISTCTRLH_G__ +class WXDLLEXPORT wxListCtrl: public wxGenericListCtrl +{ + DECLARE_DYNAMIC_CLASS(wxListCtrl) + +public: + wxListCtrl() {} + + wxListCtrl(wxWindow *parent, wxWindowID id = -1, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = wxLC_ICON, + const wxValidator &validator = wxDefaultValidator, + const wxString &name = "listctrl" ) + : wxGenericListCtrl(parent, id, pos, size, style, validator, name) + { + } +}; +#endif // !__WXMSW__ || __WIN16__ || __WXUNIVERSAL__ -// vi:sts=4:sw=4:et +#endif // __LISTCTRLH_G__ diff --git a/include/wx/imaglist.h b/include/wx/imaglist.h index 6558755bc7..8a752751d7 100644 --- a/include/wx/imaglist.h +++ b/include/wx/imaglist.h @@ -1,13 +1,10 @@ #ifndef _WX_IMAGLIST_H_BASE_ #define _WX_IMAGLIST_H_BASE_ -#if defined(__WIN32__) +#if defined(__WIN32__) && !defined(__WXUNIVERSAL__) #include "wx/msw/imaglist.h" -#endif -#include "wx/generic/imaglist.h" -#if !defined(__WIN32__) - #define wxImageList wxGenericImageList - #define sm_classwxImageList sm_classwxGenericImageList +#else + #include "wx/generic/imaglist.h" #endif #endif diff --git a/include/wx/listctrl.h b/include/wx/listctrl.h index daaf070e45..e633113110 100644 --- a/include/wx/listctrl.h +++ b/include/wx/listctrl.h @@ -315,11 +315,8 @@ private: #if defined(__WIN32__) && !defined(__WXUNIVERSAL__) #include "wx/msw/listctrl.h" -#endif -#include "wx/generic/listctrl.h" -#if !defined(__WIN32__) || defined(__WXUNIVERSAL__) - #define wxListCtrl wxGenericListCtrl - #define sm_classwxListCtrl sm_classwxGenericListCtrl +#else + #include "wx/generic/listctrl.h" #endif // ---------------------------------------------------------------------------- diff --git a/src/generic/imaglist.cpp b/src/generic/imaglist.cpp index 4aea721b37..b70f3e23bf 100644 --- a/src/generic/imaglist.cpp +++ b/src/generic/imaglist.cpp @@ -28,6 +28,15 @@ IMPLEMENT_DYNAMIC_CLASS(wxGenericImageList, wxObject) +#if !defined(__WXMSW__) || defined(__WIN16__) || defined(__WXUNIVERSAL__) +/* + * wxImageList has to be a real class or we have problems with + * the run-time information. + */ + +IMPLEMENT_DYNAMIC_CLASS(wxImageList, wxGenericImageList) +#endif + wxGenericImageList::wxGenericImageList( int width, int height, bool mask, int initialCount ) { (void)Create(width, height, mask, initialCount); diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index 89639c5b35..6cfc4bec2c 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -4521,6 +4521,15 @@ BEGIN_EVENT_TABLE(wxGenericListCtrl,wxControl) EVT_IDLE(wxGenericListCtrl::OnIdle) END_EVENT_TABLE() +#if !defined(__WXMSW__) || defined(__WIN16__) || defined(__WXUNIVERSAL__) +/* + * wxListCtrl has to be a real class or we have problems with + * the run-time information. + */ + +IMPLEMENT_DYNAMIC_CLASS(wxListCtrl, wxGenericListCtrl) +#endif + wxGenericListCtrl::wxGenericListCtrl() { m_imageListNormal = (wxGenericImageList *) NULL; -- 2.45.2