]> git.saurik.com Git - wxWidgets.git/blobdiff - src/xrc/xh_listc.cpp
synthesize NM_RCLICK ourselves now that def window proc doesn't do it as we don't...
[wxWidgets.git] / src / xrc / xh_listc.cpp
index ee21109f221e7a8fddc0c426215bfe0467d6aa2a..4a0c1f252a0c076fe95c62b14abb4a5196b1732e 100644 (file)
@@ -1,14 +1,14 @@
 /////////////////////////////////////////////////////////////////////////////
 // Name:        xh_listc.cpp
-// Purpose:     XML resource for wxListCtrl
+// Purpose:     XRC resource for wxListCtrl
 // Author:      Brian Gavin
 // Created:     2000/09/09
 // RCS-ID:      $Id$
 // Copyright:   (c) 2000 Brian Gavin
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
-#ifdef __GNUG__
+
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "xh_listc.h"
 #endif
 
     #pragma hdrstop
 #endif
 
+#if wxUSE_XRC
+
 #include "wx/textctrl.h"
 #include "wx/xrc/xh_listc.h"
 #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 = new wxListCtrl(m_parentAsWindow,
-                                    GetID(),
-                                    GetPosition(), GetSize(),
-                                    GetStyle(),
-                                    wxDefaultValidator,
-                                    GetName());
-    /* TODO: columns definition */
-    
+{
+    XRC_MAKE_INSTANCE(list, wxListCtrl)
+
+    list->Create(m_parentAsWindow,
+                 GetID(),
+                 GetPosition(), GetSize(),
+                 GetStyle(),
+                 wxDefaultValidator,
+                 GetName());
+
+    // FIXME: add columns definition
+
     SetupWindow(list);
-    
+
     return list;
 }
 
-
-
 bool wxListCtrlXmlHandler::CanHandle(wxXmlNode *node)
 {
     return IsOfClass(node, wxT("wxListCtrl"));
 }
+
+#endif // wxUSE_XRC