]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/listctrl.cpp
A few little tweaks
[wxWidgets.git] / src / generic / listctrl.cpp
index 3b9727dd864989005a96761bddb5164fbf3146f9..2fee597386e3d1c462f448747de644673204b663 100644 (file)
@@ -4492,38 +4492,6 @@ void wxListMainWindow::GetVisibleLinesRange(size_t *from, size_t *to)
 
 IMPLEMENT_DYNAMIC_CLASS(wxListItem, wxObject)
 
-wxListItem::wxListItem()
-{
-    m_attr = NULL;
-
-    Clear();
-}
-
-void wxListItem::Clear()
-{
-    m_mask = 0;
-    m_itemId = 0;
-    m_col = 0;
-    m_state = 0;
-    m_stateMask = 0;
-    m_image = -1;
-    m_data = 0;
-    m_format = wxLIST_FORMAT_CENTRE;
-    m_width = 0;
-    m_text.clear();
-
-    ClearAttributes();
-}
-
-void wxListItem::ClearAttributes()
-{
-    if (m_attr)
-    {
-        delete m_attr;
-        m_attr = NULL;
-    }
-}
-
 // -------------------------------------------------------------------------------------
 // wxListCtrl
 // -------------------------------------------------------------------------------------
@@ -4837,6 +4805,38 @@ int wxListCtrl::GetItemSpacing( bool isSmall ) const
     return m_mainWin->GetItemSpacing( isSmall );
 }
 
+void wxListCtrl::SetItemTextColour( long item, const wxColour &col )
+{
+    wxListItem info;
+    info.m_itemId = item;
+    info.SetTextColour( col );
+    m_mainWin->SetItem( info );
+}
+
+wxColour wxListCtrl::GetItemTextColour( long item ) const
+{
+    wxListItem info;
+    info.m_itemId = item;
+    m_mainWin->GetItem( info );
+    return info.GetTextColour();
+}
+
+void wxListCtrl::SetItemBackgroundColour( long item, const wxColour &col )
+{
+    wxListItem info;
+    info.m_itemId = item;
+    info.SetBackgroundColour( col );
+    m_mainWin->SetItem( info );
+}
+
+wxColour wxListCtrl::GetItemBackgroundColour( long item ) const
+{
+    wxListItem info;
+    info.m_itemId = item;
+    m_mainWin->GetItem( info );
+    return info.GetBackgroundColour();
+}
+
 int wxListCtrl::GetSelectedItemCount() const
 {
     return m_mainWin->GetSelectedItemCount();
@@ -5067,7 +5067,7 @@ bool wxListCtrl::SortItems( wxListCtrlCompare fn, long data )
 // event handlers
 // ----------------------------------------------------------------------------
 
-void wxListCtrl::OnSize(wxSizeEvent& event)
+void wxListCtrl::OnSize(wxSizeEvent& WXUNUSED(event))
 {
     if ( !m_mainWin )
         return;
@@ -5211,19 +5211,19 @@ void wxListCtrl::SetFocus()
 // virtual list control support
 // ----------------------------------------------------------------------------
 
-wxString wxListCtrl::OnGetItemText(long item, long col) const
+wxString wxListCtrl::OnGetItemText(long WXUNUSED(item), long WXUNUSED(col)) const
 {
     // this is a pure virtual function, in fact - which is not really pure
     // because the controls which are not virtual don't need to implement it
-    wxFAIL_MSG( _T("not supposed to be called") );
+    wxFAIL_MSG( _T("wxListCtrl::OnGetItemText not supposed to be called") );
 
     return wxEmptyString;
 }
 
-int wxListCtrl::OnGetItemImage(long item) const
+int wxListCtrl::OnGetItemImage(long WXUNUSED(item)) const
 {
     // same as above
-    wxFAIL_MSG( _T("not supposed to be called") );
+    wxFAIL_MSG( _T("wxListCtrl::OnGetItemImage not supposed to be called") );
 
     return -1;
 }
@@ -5265,3 +5265,5 @@ void wxListCtrl::Thaw()
 }
 
 #endif // wxUSE_LISTCTRL
+
+// vi:sts=4:sw=4:et