]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/listctrl.cpp
macro naming changes
[wxWidgets.git] / src / msw / listctrl.cpp
index bffa880aa60a29a0c964e9adcbdb077cfd1c400b..af488d4e4122621c8aaf21f11a8e5d18ad06c0e2 100644 (file)
@@ -214,15 +214,65 @@ DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_ITEM_FOCUSED)
 DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_CACHE_HINT)
 
 #if wxUSE_EXTENDED_RTTI
+WX_DEFINE_FLAGS( wxListCtrlStyle )
+
+wxBEGIN_FLAGS( wxListCtrlStyle )
+    // new style border flags, we put them first to
+    // use them for streaming out
+    wxFLAGS_MEMBER(wxBORDER_SIMPLE)
+    wxFLAGS_MEMBER(wxBORDER_SUNKEN)
+    wxFLAGS_MEMBER(wxBORDER_DOUBLE)
+    wxFLAGS_MEMBER(wxBORDER_RAISED)
+    wxFLAGS_MEMBER(wxBORDER_STATIC)
+    wxFLAGS_MEMBER(wxBORDER_NONE)
+    
+    // old style border flags
+    wxFLAGS_MEMBER(wxSIMPLE_BORDER)
+    wxFLAGS_MEMBER(wxSUNKEN_BORDER)
+    wxFLAGS_MEMBER(wxDOUBLE_BORDER)
+    wxFLAGS_MEMBER(wxRAISED_BORDER)
+    wxFLAGS_MEMBER(wxSTATIC_BORDER)
+    wxFLAGS_MEMBER(wxNO_BORDER)
+
+    // standard window styles
+    wxFLAGS_MEMBER(wxTAB_TRAVERSAL)
+    wxFLAGS_MEMBER(wxCLIP_CHILDREN)
+    wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW)
+    wxFLAGS_MEMBER(wxWANTS_CHARS)
+    wxFLAGS_MEMBER(wxNO_FULL_REPAINT_ON_RESIZE)
+    wxFLAGS_MEMBER(wxALWAYS_SHOW_SB )
+    wxFLAGS_MEMBER(wxVSCROLL)
+    wxFLAGS_MEMBER(wxHSCROLL)
+
+    wxFLAGS_MEMBER(wxLC_LIST)
+    wxFLAGS_MEMBER(wxLC_REPORT)
+    wxFLAGS_MEMBER(wxLC_ICON)
+    wxFLAGS_MEMBER(wxLC_SMALL_ICON)
+    wxFLAGS_MEMBER(wxLC_ALIGN_TOP)
+    wxFLAGS_MEMBER(wxLC_ALIGN_LEFT)
+    wxFLAGS_MEMBER(wxLC_AUTOARRANGE)
+    wxFLAGS_MEMBER(wxLC_USER_TEXT)
+    wxFLAGS_MEMBER(wxLC_EDIT_LABELS)
+    wxFLAGS_MEMBER(wxLC_NO_HEADER)
+    wxFLAGS_MEMBER(wxLC_SINGLE_SEL)
+    wxFLAGS_MEMBER(wxLC_SORT_ASCENDING)
+    wxFLAGS_MEMBER(wxLC_SORT_DESCENDING)
+    wxFLAGS_MEMBER(wxLC_VIRTUAL)
+
+wxEND_FLAGS( wxListCtrlStyle )
+
 IMPLEMENT_DYNAMIC_CLASS_XTI(wxListCtrl, wxControl,"wx/listctrl.h")
 
-WX_BEGIN_PROPERTIES_TABLE(wxListCtrl)
-WX_END_PROPERTIES_TABLE()
+wxBEGIN_PROPERTIES_TABLE(wxListCtrl)
+    wxEVENT_PROPERTY( TextUpdated , wxEVT_COMMAND_TEXT_UPDATED , wxCommandEvent ) 
+
+    wxPROPERTY_FLAGS( WindowStyle , wxListCtrlStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
+wxEND_PROPERTIES_TABLE()
 
-WX_BEGIN_HANDLERS_TABLE(wxListCtrl)
-WX_END_HANDLERS_TABLE()
+wxBEGIN_HANDLERS_TABLE(wxListCtrl)
+wxEND_HANDLERS_TABLE()
 
-WX_CONSTRUCTOR_5( wxListCtrl , wxWindow* , Parent , wxWindowID , Id , wxPoint , Position , wxSize , Size , long , WindowStyle ) 
+wxCONSTRUCTOR_5( wxListCtrl , wxWindow* , Parent , wxWindowID , Id , wxPoint , Position , wxSize , Size , long , WindowStyle ) 
 
 /*
  TODO : Expose more information of a list's layout etc. via appropriate objects (à la NotebookPageInfo)
@@ -1456,16 +1506,17 @@ long wxListCtrl::InsertItem(wxListItem& info)
         if (info.m_mask & wxLIST_MASK_DATA)
             data->lParam = info.m_data;
 
-    // check whether it has any custom attributes
-    if ( info.HasAttributes() )
-    {
+        // check whether it has any custom attributes
+        if ( info.HasAttributes() )
+        {
             // take copy of attributes
             data->attr = new wxListItemAttr(*info.GetAttributes());
-    }
+        }
     };
 
     long rv = ListView_InsertItem(GetHwnd(), & item);
-    m_count += 1;
+
+    m_count++;
     wxASSERT_MSG( m_count == ListView_GetItemCount(GetHwnd()),
                   wxT("m_count should match ListView_GetItemCount"));