wx.ListCtrl Class Reference

Inheritance diagram for wx.ListCtrl:

wx.Control wx.Window wx.EvtHandler wx.Object wx.ListView

List of all members.

Public Types

enum  NEXT
enum  SymbolicColumnWidth

Public Member Functions

int AppendItemRow (params ListItem[] colItems)
bool Arrange (ListColumnFormat flag)
delegate IntPtr Callback_OnGetItemAttr (int item)
delegate int Callback_OnGetItemColumnImage (int item, int col)
delegate int Callback_OnGetItemImage (int item)
delegate IntPtr Callback_OnGetItemText (int item, int col)
void ClearAll ()
bool Create (Window parent, int id, Point pos, Size size, wx.WindowStyles style, string name)
bool DeleteAllColumns ()
bool DeleteAllItems ()
bool DeleteColumn (int col)
bool DeleteItem (int item)
void EditLabel (int item)
bool EnsureVisible (int item)
int FindItem (int start, Point pt, int direction)
int FindItem (int start, ClientData data)
int FindItem (int start, string str, bool partial)
bool GetColumn (int col, out ListItem item)
int GetColumnWidth (int col)
System.Collections.Generic.IEnumerator
< ListItem
GetEnumerator ()
ImageList GetImageList (wxImageList which)
bool GetItem (ListItem info)
Colour GetItemBackgroundColour (int item)
ClientData GetItemData (int item)
bool GetItemPosition (int item, out Point pos)
bool GetItemRect (int item, out Rectangle rect, int code)
ListItemState GetItemState (int item, ListItemState stateMask)
string GetItemText (int item)
Colour GetItemTextColour (int item)
int GetNextItem (int item, NEXT geometry, ListItemState state)
ListHitTest HitTest (Point point, int flags)
int InsertColumn (int col, string heading, wx.ListColumnFormat format, int width)
int InsertColumn (int col, string heading)
int InsertColumn (int col, ListItem info)
int InsertItem (int index, string label, int imageIndex)
int InsertItem (int index, int imageIndex)
int InsertItem (int index, string label)
int InsertItem (ListItem info)
int InsertItemRow (params ListItem[] colItems)
bool IsSetItemStateFlag (int item, ListItemState flags)
 ListCtrl (Window parent, Point pos, Size size, wx.WindowStyles style, string name)
 ListCtrl (Window parent, Point pos, Size size, wx.WindowStyles style)
 ListCtrl (Window parent, Point pos, Size size)
 ListCtrl (Window parent, Point pos)
 ListCtrl (Window parent, int id, Point pos, Size size, wx.WindowStyles style, string name)
 ListCtrl (Window parent, int id, Point pos, Size size, wx.WindowStyles style)
 ListCtrl (Window parent, int id, Point pos, Size size)
 ListCtrl (Window parent, int id, Point pos)
 ListCtrl (Window parent, int id)
 ListCtrl (Window parent)
 ListCtrl ()
 ListCtrl (IntPtr wxObject)
virtual ListItemAttr OnGetItemAttr (int item)
virtual int OnGetItemColumnImage (int item, int col)
virtual int OnGetItemImage (int item)
virtual string OnGetItemText (int item, int col)
void RefreshItem (int item)
void RefreshItems (int itemFrom, int itemTo)
bool ScrollList (int dx, int dy)
bool SetColumn (int col, ListItem item)
bool SetColumnWidth (int col, SymbolicColumnWidth width)
bool SetColumnWidth (int col, int width)
void SetImageList (ImageList imageList, wxImageList which)
int SetItem (int index, int col, wxString label, int imageId)
int SetItem (int index, int col, string label, int imageId)
int SetItem (int index, int col, string label)
bool SetItem (ListItem info)
void SetItemBackgroundColour (int item, Colour col)
bool SetItemData (int item, int data)
bool SetItemData (int item, ClientData data)
bool SetItemImage (int item, int image, int selImage)
bool SetItemPosition (int item, Point pos)
bool SetItemState (int item, ListItemState state, ListItemState stateMask)
void SetItemText (int index, string label)
void SetItemTextColour (int item, Colour col)
void SetSingleStyle (wx.WindowStyles style, bool add)
bool SortItems (wxListCtrlCompare fn, int data)
bool SortItemsAccordingToClientData (System.Collections.IComparer clientDataComparer)
delegate int wxListCtrlCompare (ClientData item1, ClientData item2, int sortData)

Protected Member Functions

override void CallDTor ()

Properties

int ColumnCount [get]
int CountPerPage [get]
int ItemCount [get, set]
int SelectedItemCount [get]
System.Collections.Generic.ICollection
< ListItem
SelectedItems [get]
Colour TextColour [get, set]
wx.ListItem this [int index] [get, set]
int TopItem [get]
Rectangle ViewRect [get]

Events

event EventListener BeginDrag [add, remove]
event EventListener BeginLabelEdit [add, remove]
event EventListener BeginRightDrag [add, remove]
event EventListener CacheHint [add, remove]
event EventListener ColumnBeginDrag [add, remove]
event EventListener ColumnClick [add, remove]
event EventListener ColumnDragging [add, remove]
event EventListener ColumnEndDrag [add, remove]
event EventListener ColumnRightClick [add, remove]
event EventListener EndLabelEdit [add, remove]
event EventListener Insert [add, remove]
event EventListener ItemActivate [add, remove]
event EventListener ItemDelete [add, remove]
event EventListener ItemDeleteAll [add, remove]
event EventListener ItemDeselect [add, remove]
event EventListener ItemFocus [add, remove]
event EventListener ItemMiddleClick [add, remove]
event EventListener ItemRightClick [add, remove]
event EventListener ItemSelect [add, remove]
override event
EventListener 
KeyDown [add, remove]

Classes

class  ItemDataComparer
class  ItemEnumerator
class  SortCallback


Detailed Description

The list control. This is appropriate to display also large lists of data.
listctrlsmall.png

The list control in report mode.


Member Enumeration Documentation

enum wx::ListCtrl::NEXT

Flags for GetNextItem()

Enumerator:
ABOVE 
ALL 
BELOW 
LEFT 
RIGHT 

enum wx::ListCtrl::SymbolicColumnWidth

These are optional symbolic specifications of the column width. Refer to wx.ListCtrl.SetColumnWidth().

Enumerator:
AUTOSIZE  This will resize the column to the length of its longest item.
AUTOSIZE_USEHEADER  This will resize the column to the length of the header (Win32) or 80 pixels (other platforms).


Constructor & Destructor Documentation

wx.ListCtrl.ListCtrl ( IntPtr  wxObject  ) 

wx.ListCtrl.ListCtrl (  ) 

wx.ListCtrl.ListCtrl ( Window  parent  ) 

wx.ListCtrl.ListCtrl ( Window  parent,
int  id 
)

wx.ListCtrl.ListCtrl ( Window  parent,
int  id,
Point  pos 
)

wx.ListCtrl.ListCtrl ( Window  parent,
int  id,
Point  pos,
Size  size 
)

wx.ListCtrl.ListCtrl ( Window  parent,
int  id,
Point  pos,
Size  size,
wx.WindowStyles  style 
)

wx.ListCtrl.ListCtrl ( Window  parent,
int  id,
Point  pos,
Size  size,
wx.WindowStyles  style,
string  name 
)

wx.ListCtrl.ListCtrl ( Window  parent,
Point  pos 
)

wx.ListCtrl.ListCtrl ( Window  parent,
Point  pos,
Size  size 
)

wx.ListCtrl.ListCtrl ( Window  parent,
Point  pos,
Size  size,
wx.WindowStyles  style 
)

wx.ListCtrl.ListCtrl ( Window  parent,
Point  pos,
Size  size,
wx.WindowStyles  style,
string  name 
)


Member Function Documentation

int wx.ListCtrl.AppendItemRow ( params ListItem[]  colItems  ) 

This will change the Id of the provided items to the number of known items and then insert them. This is a convenience method to append items at the end of the current item list without regarding the ID of the items.

bool wx.ListCtrl.Arrange ( ListColumnFormat  flag  ) 

delegate IntPtr wx.ListCtrl.Callback_OnGetItemAttr ( int  item  ) 

delegate int wx.ListCtrl.Callback_OnGetItemColumnImage ( int  item,
int  col 
)

delegate int wx.ListCtrl.Callback_OnGetItemImage ( int  item  ) 

delegate IntPtr wx.ListCtrl.Callback_OnGetItemText ( int  item,
int  col 
)

override void wx.ListCtrl.CallDTor (  )  [protected, virtual]

This will be called by Dispose() to delete the C++ object. Overload this if you have to use another DTor.

Reimplemented from wx.Object.

void wx.ListCtrl.ClearAll (  ) 

bool wx.ListCtrl.Create ( Window  parent,
int  id,
Point  pos,
Size  size,
wx.WindowStyles  style,
string  name 
)

Reimplemented in wx.ListView.

bool wx.ListCtrl.DeleteAllColumns (  ) 

bool wx.ListCtrl.DeleteAllItems (  ) 

bool wx.ListCtrl.DeleteColumn ( int  col  ) 

bool wx.ListCtrl.DeleteItem ( int  item  ) 

void wx.ListCtrl.EditLabel ( int  item  ) 

bool wx.ListCtrl.EnsureVisible ( int  item  ) 

Ensures visibility of the designated item.

int wx.ListCtrl.FindItem ( int  start,
Point  pt,
int  direction 
)

int wx.ListCtrl.FindItem ( int  start,
ClientData  data 
)

int wx.ListCtrl.FindItem ( int  start,
string  str,
bool  partial 
)

bool wx.ListCtrl.GetColumn ( int  col,
out ListItem  item 
)

int wx.ListCtrl.GetColumnWidth ( int  col  ) 

System.Collections.Generic.IEnumerator<ListItem> wx.ListCtrl.GetEnumerator (  ) 

Returns an enumeration of all nodes. Refer to ListCtrlEnumerator.

ImageList wx.ListCtrl.GetImageList ( wxImageList  which  ) 

bool wx.ListCtrl.GetItem ( ListItem  info  ) 

Assigns the item corresponding to the ID, column, and property mask of info to info. This is for compatibility to wxWidgets only. Use the indexer if you prefer a more convenient and more standard way to ask for items.

info will be loaded with all properties of item sharing ID and column with info as designated by info.Mask.

Colour wx.ListCtrl.GetItemBackgroundColour ( int  item  ) 

ClientData wx.ListCtrl.GetItemData ( int  item  ) 

bool wx.ListCtrl.GetItemPosition ( int  item,
out Point  pos 
)

bool wx.ListCtrl.GetItemRect ( int  item,
out Rectangle  rect,
int  code 
)

ListItemState wx.ListCtrl.GetItemState ( int  item,
ListItemState  stateMask 
)

Item state. Only the bits of the mask will be queried.

         if (listCtrl.GetItemState(3, ListItemState.SELECTED)==ListItemState.SELECTED)
            System.Diagnostics.Trace.WriteLine("Item 3 has been selected.");
         

string wx.ListCtrl.GetItemText ( int  item  ) 

Colour wx.ListCtrl.GetItemTextColour ( int  item  ) 

int wx.ListCtrl.GetNextItem ( int  item,
NEXT  geometry,
ListItemState  state 
)

ListHitTest wx.ListCtrl.HitTest ( Point  point,
int  flags 
)

int wx.ListCtrl.InsertColumn ( int  col,
string  heading,
wx.ListColumnFormat  format,
int  width 
)

int wx.ListCtrl.InsertColumn ( int  col,
string  heading 
)

int wx.ListCtrl.InsertColumn ( int  col,
ListItem  info 
)

int wx.ListCtrl.InsertItem ( int  index,
string  label,
int  imageIndex 
)

Inserts an item presenting image and text label and returns the index of the new item or -1 if insertion failed.

int wx.ListCtrl.InsertItem ( int  index,
int  imageIndex 
)

Inserts an item presenting an image and returns the index of the new item or -1 if insertion failed.

int wx.ListCtrl.InsertItem ( int  index,
string  label 
)

Inserts an item and returns the index of the new item or -1 if insertion failed.

int wx.ListCtrl.InsertItem ( ListItem  info  ) 

Inserts an item and returns the index of the new item or -1 if insertion failed.

int wx.ListCtrl.InsertItemRow ( params ListItem[]  colItems  ) 

This will insert a new item assuming each of the arguments to represent a column value. The first column item will be used for column 0, the second for column 1, and so forth. The method will adjust the column attribute of the arguments.

bool wx.ListCtrl.IsSetItemStateFlag ( int  item,
ListItemState  flags 
)

True iff all flags have been set for item item.

Is equivalent to

         this.GetItemState(item, flags)==flags
         

virtual ListItemAttr wx.ListCtrl.OnGetItemAttr ( int  item  )  [virtual]

virtual int wx.ListCtrl.OnGetItemColumnImage ( int  item,
int  col 
) [virtual]

Return the index of the icon of the designated item and the designated column in the used image list. Overload this for virtual lists.

This standard implementation will return an undefined index (-1) for "do no show any item image".

virtual int wx.ListCtrl.OnGetItemImage ( int  item  )  [virtual]

Return the index of the icon of the designated item in the used image list. Overload this for virtual lists.

This standard implementation will return an undefined index (-1) for "do no show any item image".

virtual string wx.ListCtrl.OnGetItemText ( int  item,
int  col 
) [virtual]

Overload this to provide the name of a virtually represented item. The default implementation returns an empty string. So, don't be surprised if you get an empty list because you didn't implement this.

void wx.ListCtrl.RefreshItem ( int  item  ) 

void wx.ListCtrl.RefreshItems ( int  itemFrom,
int  itemTo 
)

bool wx.ListCtrl.ScrollList ( int  dx,
int  dy 
)

Scrolls the list control. If in icon, small icon or report view mode, dx specifies the number of pixels to scroll. If in list view mode, dx specifies the number of columns to scroll. dy always specifies the number of pixels to scroll vertically.

NB: This method is currently only implemented in the Windows version.

Try EnsureVisible().

bool wx.ListCtrl.SetColumn ( int  col,
ListItem  item 
)

bool wx.ListCtrl.SetColumnWidth ( int  col,
SymbolicColumnWidth  width 
)

bool wx.ListCtrl.SetColumnWidth ( int  col,
int  width 
)

void wx.ListCtrl.SetImageList ( ImageList  imageList,
wxImageList  which 
)

Defines the image list to be used by instances of wx.ImageItem added to this list.

Parameters:
which defines which of the internal image lists will be set, e.g. by wx.wxImageList.wxIMAGE_LIST_SMALL.

int wx.ListCtrl.SetItem ( int  index,
int  col,
wxString  label,
int  imageId 
)

int wx.ListCtrl.SetItem ( int  index,
int  col,
string  label,
int  imageId 
)

int wx.ListCtrl.SetItem ( int  index,
int  col,
string  label 
)

bool wx.ListCtrl.SetItem ( ListItem  info  ) 

Assigns item info to the control. This will change the properties of the item of this control sharing the ID with info. The method will select those properties of info that are compatible with the property mask of info. This is for compatibility to wxWidgets only. Use the indexer if you prefer the standard way to set for items.

void wx.ListCtrl.SetItemBackgroundColour ( int  item,
Colour  col 
)

bool wx.ListCtrl.SetItemData ( int  item,
int  data 
)

bool wx.ListCtrl.SetItemData ( int  item,
ClientData  data 
)

bool wx.ListCtrl.SetItemImage ( int  item,
int  image,
int  selImage 
)

bool wx.ListCtrl.SetItemPosition ( int  item,
Point  pos 
)

bool wx.ListCtrl.SetItemState ( int  item,
ListItemState  state,
ListItemState  stateMask 
)

void wx.ListCtrl.SetItemText ( int  index,
string  label 
)

void wx.ListCtrl.SetItemTextColour ( int  item,
Colour  col 
)

void wx.ListCtrl.SetSingleStyle ( wx.WindowStyles  style,
bool  add 
)

bool wx.ListCtrl.SortItems ( wxListCtrlCompare  fn,
int  data 
)

Sort the contained list items with respect to fn. Refer to remarks on wxListCtrlCompare.

bool wx.ListCtrl.SortItemsAccordingToClientData ( System.Collections.IComparer  clientDataComparer  ) 

Sort according to the order of client data as specified by the comparer. This assumes that all items have assigned client data assigned and that this data implements System.IComparable. Missing or non-comparable client data will be replaced by the item's name.

delegate int wx.ListCtrl.wxListCtrlCompare ( ClientData  item1,
ClientData  item2,
int  sortData 
)

The corresponding wxWidgets function type uses int data to designate items and sort data. However, C typically identifies int and long on 32 bit architectures. Apparently, C# does not so. It is apparently unwise to use long in native C interfaces since this data type does not have a standard size_t.


Property Documentation

int wx.ListCtrl.ColumnCount [get]

int wx.ListCtrl.CountPerPage [get]

int wx.ListCtrl.ItemCount [get, set]

int wx.ListCtrl.SelectedItemCount [get]

System.Collections.Generic.ICollection<ListItem> wx.ListCtrl.SelectedItems [get]

Returns a list of selected items.

Colour wx.ListCtrl.TextColour [get, set]

wx.ListItem wx.ListCtrl.this[int index] (  )  [get, set]

Gets and sets the item at the designated position. If you assign an item using this indexer, the ID of this item will change to index. The mask will also be set to wx.ListItemMask.ALL.

int wx.ListCtrl.TopItem [get]

Rectangle wx.ListCtrl.ViewRect [get]

This only works in icon mode and returns an unspecific reactangle otherwise.


Event Documentation

event EventListener wx.ListCtrl.BeginDrag [add, remove]

event EventListener wx.ListCtrl.BeginLabelEdit [add, remove]

event EventListener wx.ListCtrl.BeginRightDrag [add, remove]

event EventListener wx.ListCtrl.CacheHint [add, remove]

event EventListener wx.ListCtrl.ColumnBeginDrag [add, remove]

event EventListener wx.ListCtrl.ColumnClick [add, remove]

event EventListener wx.ListCtrl.ColumnDragging [add, remove]

event EventListener wx.ListCtrl.ColumnEndDrag [add, remove]

event EventListener wx.ListCtrl.ColumnRightClick [add, remove]

event EventListener wx.ListCtrl.EndLabelEdit [add, remove]

event EventListener wx.ListCtrl.Insert [add, remove]

event EventListener wx.ListCtrl.ItemActivate [add, remove]

event EventListener wx.ListCtrl.ItemDelete [add, remove]

event EventListener wx.ListCtrl.ItemDeleteAll [add, remove]

event EventListener wx.ListCtrl.ItemDeselect [add, remove]

event EventListener wx.ListCtrl.ItemFocus [add, remove]

event EventListener wx.ListCtrl.ItemMiddleClick [add, remove]

event EventListener wx.ListCtrl.ItemRightClick [add, remove]

event EventListener wx.ListCtrl.ItemSelect [add, remove]

override event EventListener wx.ListCtrl.KeyDown [add, remove]

Adds a listener to the wx.Event.wxEVT_KEY_DOWN.

Reimplemented from wx.Window.


Manual of the wx.NET   (c) 2003-2011 the wx.NET project at   Get wx.NET at SourceForge.net. Fast, secure and Free Open Source software downloads