\func{bool}{SetItemImage}{\param{long }{item}, \param{int }{image}}
Sets the image associated with the item. The image is an index into the
-image list associated with the list control.
+image list associated with the list control. In report view, this only sets
+the image for the first column.
\func{bool}{SetItemImage}{\param{long }{item}, \param{int }{image}, \param{int }{selImage}}
used.
+\membersection{wxListCtrl::SetItemColumnImage}\label{wxlistctrlsetitemcolumnimage}
+
+\func{bool}{SetItemImage}{\param{long }{item}, \param{long }{column}\param{int }{image}}
+
+Sets the image associated with the item. In report view, you can specify the column.
+The image is an index into the image list associated with the list control.
+
+
\membersection{wxListCtrl::SetItemPosition}\label{wxlistctrlsetitemposition}
\func{bool}{SetItemPosition}{\param{long }{item}, \param{const wxPoint\& }{pos}}
int GetItemState( long item, long stateMask ) const;
bool SetItemState( long item, long state, long stateMask);
bool SetItemImage( long item, int image, int selImage = -1 );
+ bool SetItemColumnImage( long item, long column, int image );
wxString GetItemText( long item ) const;
void SetItemText( long item, const wxString& str );
wxUIntPtr GetItemData( long item ) const;
// Sets the item image
bool SetItemImage(long item, int image, int selImage) ;
+ bool SetItemColumnImage(long item, long column, int image);
// Gets the item text
wxString GetItemText(long item) const ;
// Sets the item image
bool SetItemImage(long item, int image, int selImage) ;
+ bool SetItemColumnImage(long item, long column, int image);
// Gets the item text
wxString GetItemText(long item) const ;
// Sets the item image
bool SetItemImage(long item, int image, int selImage = -1) ;
+ bool SetItemColumnImage(long item, long column, int image);
// Gets the item text
wxString GetItemText(long item) const ;
,int nImage
,int lSelImage
);
+ bool SetItemColumnImage( long lItem
+ ,long lColumn
+ ,int nImage
+ );
//
// Item text
// Sets the item image
bool SetItemImage(long item, int image, int selImage) ;
+ bool SetItemColumnImage(long item, long column, int image);
// Gets the item text
wxString GetItemText(long item) const ;
m_listCtrl->SetColumnWidth( 1, wxLIST_AUTOSIZE );
m_listCtrl->SetColumnWidth( 2, wxLIST_AUTOSIZE );
+ // Set images in columns
+ m_listCtrl->SetItemColumnImage(1, 1, 0);
+
+ wxListItem info;
+ info.SetImage(0);
+ info.SetId(3);
+ info.SetColumn(2);
+ m_listCtrl->SetItem(info);
+
// test SetItemFont too
m_listCtrl->SetItemFont(0, *wxITALIC_FONT);
}
}
}
-int MyListCtrl::OnGetItemImage(long WXUNUSED(item)) const
+int MyListCtrl::OnGetItemColumnImage(long item, long column) const
{
- return 0;
+ if (!column)
+ return 0;
+
+ if (!(item %3) && column == 1)
+ return 0;
+
+ return -1;
}
wxListItemAttr *MyListCtrl::OnGetItemAttr(long item) const
void LogColEvent(const wxListEvent& event, const wxChar *eventName);
virtual wxString OnGetItemText(long item, long column) const;
- virtual int OnGetItemImage(long item) const;
+ virtual int OnGetItemColumnImage(long item, long column) const;
virtual wxListItemAttr *OnGetItemAttr(long item) const;
wxListItemAttr m_attr;
bool
wxGenericListCtrl::SetItemImage( long item, int image, int WXUNUSED(selImage) )
+{
+ return SetItemColumnImage(item, 0, image);
+}
+
+bool
+wxGenericListCtrl::SetItemColumnImage( long item, long column, int image )
{
wxListItem info;
info.m_image = image;
info.m_mask = wxLIST_MASK_IMAGE;
info.m_itemId = item;
+ info.m_col = column;
m_mainWin->SetItem( info );
return true;
}
// Sets the item image
bool wxListCtrl::SetItemImage(long item, int image, int WXUNUSED(selImage))
+{
+ return SetItemColumnImage(item, 0, image);
+}
+
+// Sets the item image
+bool wxListCtrl::SetItemColumnImage(long item, long column, int image)
{
wxListItem info;
info.m_mask = wxLIST_MASK_IMAGE;
info.m_image = image;
info.m_itemId = item;
+ info.m_col = column;
return SetItem(info);
}
long lItem
, int nImage
, int WXUNUSED(nSelImage))
+{
+ return SetItemColumnInfo(lItem, 0, nImage);
+} // end of wxListCtrl::SetItemImage
+
+// Sets the item image
+bool wxListCtrl::SetItemColumnImage (
+ long lItem
+, long lColumn
+, int nImage
{
wxListItem vInfo;
vInfo.m_mask = wxLIST_MASK_IMAGE;
vInfo.m_image = nImage;
vInfo.m_itemId = lItem;
+ vInfo.m_col = lColumn;
return SetItem(vInfo);
-} // end of wxListCtrl::SetItemImage
+} // end of wxListCtrl::SetItemColumnImage
// Gets the item text
wxString wxListCtrl::GetItemText (
return false;
}
+// Sets the item image
+bool wxListCtrl::SetItemColumnImage(long item, long column, int image)
+{
+ return false;
+}
+
// Gets the item text
wxString wxListCtrl::GetItemText(long item) const
{
// Sets the item image
bool SetItemImage(long item, int image, int selImage=-1) ;
+ bool SetItemColumnImage( long item, long column, int image );
// Gets the item text
wxString GetItemText(long item) const ;