// Purpose: Generic list control
// Author: Robert Roebling
// Created: 01/02/97
-// Id:
+// RCS-ID: $Id$
// Copyright: (c) 1998 Robert Roebling and Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __LISTCTRLH_G__
#define __LISTCTRLH_G__
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-#pragma interface "listctrl.h"
-#endif
-
#include "wx/defs.h"
#include "wx/object.h"
+#ifdef __WXMAC__
+#include "wx/imaglist.h"
+#else
#include "wx/generic/imaglist.h"
+#endif
#include "wx/control.h"
#include "wx/timer.h"
const wxSize &size = wxDefaultSize,
long style = wxLC_ICON,
const wxValidator& validator = wxDefaultValidator,
- const wxString &name = wxT("listctrl") )
+ const wxString &name = wxListCtrlNameStr)
{
Create(parent, winid, pos, size, style, validator, name);
}
const wxSize &size = wxDefaultSize,
long style = wxLC_ICON,
const wxValidator& validator = wxDefaultValidator,
- const wxString &name = wxT("listctrl") );
+ const wxString &name = wxListCtrlNameStr);
bool GetColumn( int col, wxListItem& item ) const;
bool SetColumn( int col, wxListItem& item );
long SetItem( long index, int col, const wxString& label, int imageId = -1 );
int GetItemState( long item, long stateMask ) const;
bool SetItemState( long item, long state, long stateMask);
- bool SetItemImage( long item, int image, int selImage);
+ bool SetItemImage( long item, int image, int selImage = -1 );
wxString GetItemText( long item ) const;
void SetItemText( long item, const wxString& str );
- long GetItemData( long item ) const;
+ wxUIntPtr GetItemData( long item ) const;
bool SetItemData( long item, long data );
bool GetItemRect( long item, wxRect& rect, int code = wxLIST_RECT_BOUNDS ) const;
bool GetItemPosition( long item, wxPoint& pos ) const;
wxColour GetItemTextColour( long item ) const;
void SetItemBackgroundColour( long item, const wxColour &col);
wxColour GetItemBackgroundColour( long item ) const;
+ void SetItemFont( long item, const wxFont &f);
+ wxFont GetItemFont( long item ) const;
int GetSelectedItemCount() const;
wxColour GetTextColour() const;
void SetTextColour(const wxColour& col);
bool EnsureVisible( long item );
long FindItem( long start, const wxString& str, bool partial = false );
- long FindItem( long start, long data );
+ long FindItem( long start, wxUIntPtr data );
long FindItem( long start, const wxPoint& pt, int direction ); // not supported in wxGLC
long HitTest( const wxPoint& point, int& flags);
long InsertItem(wxListItem& info);
virtual void SetFocus();
virtual wxSize DoGetBestSize() const;
-
+
// implementation
// --------------
// return the text for the given column of the given item
virtual wxString OnGetItemText(long item, long column) const;
- // return the icon for the given item
+ // return the icon for the given item. In report view, OnGetItemImage will
+ // only be called for the first column. See OnGetItemColumnImage for
+ // details.
virtual int OnGetItemImage(long item) const;
+ // return the icon for the given item and column.
+ virtual int OnGetItemColumnImage(long item, long column) const;
+
// return the attribute for the item (may return NULL if none)
virtual wxListItemAttr *OnGetItemAttr(long item) const;
void ResizeReportView(bool showHeader);
DECLARE_EVENT_TABLE()
- DECLARE_DYNAMIC_CLASS(wxGenericListCtrl);
+ DECLARE_DYNAMIC_CLASS(wxGenericListCtrl)
};
#if !defined(__WXMSW__) || defined(__WXUNIVERSAL__)
const wxSize& size = wxDefaultSize,
long style = wxLC_ICON,
const wxValidator &validator = wxDefaultValidator,
- const wxString &name = wxT("listctrl") )
+ const wxString &name = wxListCtrlNameStr)
: wxGenericListCtrl(parent, winid, pos, size, style, validator, name)
{
}