X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f25881804583790351480098b50f4ce1b924e697..e8d9821d754585e579a0a7e9aeb2fd7913706d05:/src/xrc/xh_listc.cpp diff --git a/src/xrc/xh_listc.cpp b/src/xrc/xh_listc.cpp index de3635dede..64eec4e746 100644 --- a/src/xrc/xh_listc.cpp +++ b/src/xrc/xh_listc.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: xh_listc.cpp +// Name: src/xrc/xh_listc.cpp // Purpose: XRC resource for wxListCtrl // Author: Brian Gavin // Created: 2000/09/09 @@ -7,10 +7,6 @@ // Copyright: (c) 2000 Brian Gavin // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "xh_listc.h" -#endif // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -19,55 +15,63 @@ #pragma hdrstop #endif -#include "wx/textctrl.h" +#if wxUSE_XRC && wxUSE_LISTCTRL + #include "wx/xrc/xh_listc.h" + +#ifndef WX_PRECOMP + #include "wx/textctrl.h" +#endif + #include "wx/listctrl.h" -wxListCtrlXmlHandler::wxListCtrlXmlHandler() -: wxXmlResourceHandler() +IMPLEMENT_DYNAMIC_CLASS(wxListCtrlXmlHandler, wxXmlResourceHandler) + +wxListCtrlXmlHandler::wxListCtrlXmlHandler() +: wxXmlResourceHandler() { - ADD_STYLE(wxLC_LIST); - ADD_STYLE(wxLC_REPORT); - ADD_STYLE(wxLC_ICON); - ADD_STYLE(wxLC_SMALL_ICON); - ADD_STYLE(wxLC_ALIGN_TOP); - ADD_STYLE(wxLC_ALIGN_LEFT); - ADD_STYLE(wxLC_AUTOARRANGE); - ADD_STYLE(wxLC_USER_TEXT); - ADD_STYLE(wxLC_EDIT_LABELS); - ADD_STYLE(wxLC_NO_HEADER); - ADD_STYLE(wxLC_SINGLE_SEL); - ADD_STYLE(wxLC_SORT_ASCENDING); - ADD_STYLE(wxLC_SORT_DESCENDING); + XRC_ADD_STYLE(wxLC_LIST); + XRC_ADD_STYLE(wxLC_REPORT); + XRC_ADD_STYLE(wxLC_ICON); + XRC_ADD_STYLE(wxLC_SMALL_ICON); + XRC_ADD_STYLE(wxLC_ALIGN_TOP); + XRC_ADD_STYLE(wxLC_ALIGN_LEFT); + XRC_ADD_STYLE(wxLC_AUTOARRANGE); + XRC_ADD_STYLE(wxLC_USER_TEXT); + XRC_ADD_STYLE(wxLC_EDIT_LABELS); + XRC_ADD_STYLE(wxLC_NO_HEADER); + XRC_ADD_STYLE(wxLC_SINGLE_SEL); + XRC_ADD_STYLE(wxLC_SORT_ASCENDING); + XRC_ADD_STYLE(wxLC_SORT_DESCENDING); + XRC_ADD_STYLE(wxLC_VIRTUAL); + XRC_ADD_STYLE(wxLC_HRULES); + XRC_ADD_STYLE(wxLC_VRULES); + XRC_ADD_STYLE(wxLC_NO_SORT_HEADER); AddWindowStyles(); } - wxObject *wxListCtrlXmlHandler::DoCreateResource() -{ - wxListCtrl *list = wxStaticCast(m_instance, wxListCtrl); +{ + XRC_MAKE_INSTANCE(list, wxListCtrl) - if (!list) - list = new wxListCtrl; + list->Create(m_parentAsWindow, + GetID(), + GetPosition(), GetSize(), + GetStyle(), + wxDefaultValidator, + GetName()); - list->Create(m_parentAsWindow, - GetID(), - GetPosition(), GetSize(), - GetStyle(), - wxDefaultValidator, - GetName()); + // FIXME: add columns definition - /* TODO: columns definition */ - SetupWindow(list); - + return list; } - - bool wxListCtrlXmlHandler::CanHandle(wxXmlNode *node) { return IsOfClass(node, wxT("wxListCtrl")); } + +#endif // wxUSE_XRC && wxUSE_LISTCTRL