Package wx :: Class ListCtrl
[frames | no frames]

Type ListCtrl

object --+                
         |                
    Object --+            
             |            
    EvtHandler --+        
                 |        
            Window --+    
                     |    
               Control --+
                         |
                        ListCtrl

Known Subclasses:
ListView

Proxy of C++ ListCtrl class
Method Summary
Control __init__(self, parent, id, pos, size, style, validator, name)
Create a Control.
  __repr__(self)
  Append(self, entry)
Append an item to the list control.
bool Arrange(self, flag)
  AssignImageList(self, imageList, which)
  ClearAll(self)
  ClearColumnImage(self, col)
bool Create(self, parent, id, pos, size, style, validator, name)
Do the 2nd phase and create the GUI control.
bool DeleteAllColumns(self)
bool DeleteAllItems(self)
bool DeleteColumn(self, col)
bool DeleteItem(self, item)
  EditLabel(self, item)
bool EnsureVisible(self, item)
long FindItem(self, start, str, partial)
long FindItemAtPos(self, start, pt, direction)
long FindItemData(self, start, data)
  Focus(self, idx)
Focus and show the given item
VisualAttributes GetClassDefaultAttributes(variant)
Get the default attributes for this class. (Static method)
ListItem GetColumn(self, col)
int GetColumnCount(self)
int GetColumnWidth(self, col)
int GetCountPerPage(self)
  GetFirstSelected(self, *args)
return first selected item, or -1 when none
  GetFocusedItem(self)
get the currently focused item or -1 if none
ImageList GetImageList(self, which)
ListItem GetItem(self, itemId, col)
Colour GetItemBackgroundColour(self, item)
int GetItemCount(self)
long GetItemData(self, item)
Point GetItemPosition(self, item)
Rect GetItemRect(self, item, code)
Size GetItemSpacing(self)
int GetItemState(self, item, stateMask)
String GetItemText(self, item)
Colour GetItemTextColour(self, item)
Window GetMainWindow(self)
long GetNextItem(self, item, geometry, state)
  GetNextSelected(self, item)
return subsequent selected items, or -1 when no more
int GetSelectedItemCount(self)
Colour GetTextColour(self)
long GetTopItem(self)
Rect GetViewRect(self)
(item, where) HitTest(point)
in the second return value (see wx.LIST_HITTEST flags.)
bool InReportView(self)
long InsertColumn(self, col, heading, format, width)
long InsertColumnInfo(self, col, info)
long InsertColumnItem(self, col, info)
long InsertImageItem(self, index, imageIndex)
long InsertImageStringItem(self, index, label, imageIndex)
long InsertItem(self, info)
long InsertStringItem(self, index, label)
  IsSelected(self, idx)
return True if the item is selected
bool IsVirtual(self)
  RefreshItem(self, item)
  RefreshItems(self, itemFrom, itemTo)
bool ScrollList(self, dx, dy)
  Select(self, idx, on)
[de]select an item
bool SetBackgroundColour(self, col)
Sets the background colour of the window.
bool SetColumn(self, col, item)
  SetColumnImage(self, col, image)
bool SetColumnWidth(self, col, width)
bool SetForegroundColour(self, col)
Sets the foreground colour of the window.
  SetImageList(self, imageList, which)
bool SetItem(self, info)
  SetItemBackgroundColour(self, item, col)
  SetItemCount(self, count)
bool SetItemData(self, item, data)
bool SetItemImage(self, item, image, selImage)
bool SetItemPosition(self, item, pos)
  SetItemSpacing(self, spacing, isSmall)
bool SetItemState(self, item, state, stateMask)
  SetItemText(self, item, str)
  SetItemTextColour(self, item, col)
  SetSingleStyle(self, style, add)
long SetStringItem(self, index, col, label, imageId)
  SetTextColour(self, col)
  SetWindowStyleFlag(self, style)
Sets the style of the window.
bool SortItems(self, func)

Instance Method Details

__init__(self, parent, id=-1, pos=DefaultPosition, size=DefaultSize, style=LC_ICON, validator=DefaultValidator, name=ListCtrlNameStr)
(Constructor)

Create a Control. Normally you should only call this from a subclass' __init__ as a plain old wx.Control is not very useful.
Parameters:
parent
           (type=Window)
id
           (type=int)
pos
           (type=Point)
size
           (type=Size)
style
           (type=long)
validator
           (type=Validator)
name
           (type=String)
Returns:
Control
Overrides:
wx.Control.__init__ (inherited documentation)

Append(self, entry)

Append an item to the list control. The entry parameter should be a sequence with an item for each column

Create(self, parent, id=-1, pos=DefaultPosition, size=DefaultSize, style=LC_ICON, validator=DefaultValidator, name=ListCtrlNameStr)

Do the 2nd phase and create the GUI control.
Parameters:
parent
           (type=Window)
id
           (type=int)
pos
           (type=Point)
size
           (type=Size)
style
           (type=long)
validator
           (type=Validator)
name
           (type=String)
Returns:
bool
Overrides:
wx.Control.Create

Focus(self, idx)

Focus and show the given item

GetFirstSelected(self, *args)

return first selected item, or -1 when none

GetFocusedItem(self)

get the currently focused item or -1 if none

GetNextSelected(self, item)

return subsequent selected items, or -1 when no more

HitTest(point)

Determines which item (if any) is at the specified point, giving
in the second return value (see wx.LIST_HITTEST flags.)
Parameters:
point
           (type=Point)
Returns:
(item, where)
Overrides:
wx.Window.HitTest

IsSelected(self, idx)

return True if the item is selected

Select(self, idx, on=1)

[de]select an item

SetBackgroundColour(self, col)

Sets the background colour of the window. Returns True if the colour was changed. The background colour is usually painted by the default EVT_ERASE_BACKGROUND event handler function under Windows and automatically under GTK. Using wx.NullColour will reset the window to the default background colour.

Note that setting the background colour may not cause an immediate refresh, so you may wish to call ClearBackground or Refresh after calling this function.

Using this function will disable attempts to use themes for this window, if the system supports them. Use with care since usually the themes represent the appearance chosen by the user to be used for all applications on the system.

Parameters:
col
           (type=Colour)
Returns:
bool
Overrides:
wx.Window.SetBackgroundColour

SetForegroundColour(self, col)

Sets the foreground colour of the window. Returns True is the colour was changed. The interpretation of foreground colour is dependent on the window class; it may be the text colour or other colour, or it may not be used at all.
Parameters:
col
           (type=Colour)
Returns:
bool
Overrides:
wx.Window.SetForegroundColour

SetWindowStyleFlag(self, style)

Sets the style of the window. Please note that some styles cannot be changed after the window creation and that Refresh() might need to be called after changing the others for the change to take place immediately.
Parameters:
style
           (type=long)
Overrides:
wx.Window.SetWindowStyleFlag

Static Method Details

GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL)

Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard control -- which is a much better idea than hard coding specific colours or fonts which might look completely out of place on the user's system, especially if it uses themes.

The variant parameter is only relevant under Mac currently and is ignore under other platforms. Under Mac, it will change the size of the returned font. See wx.Window.SetWindowVariant for more about this.

Parameters:
variant
           (type=int)
Returns:
VisualAttributes

Generated by Epydoc 2.1.20040428.rpd on Tue Apr 26 14:24:17 2005 http://epydoc.sf.net