UltimateListCtrl

(08-May-2009)

UltimateListCtrl is a class that mimics the behaviour of wx.ListCtrl, with almost the same base functionalities plus some more enhancements. This class does not rely on the native control, as it is a full owner-drawn list control.

In addition to the standard wx.ListCtrl behaviour this class supports:


Appearance

  • Multiple images for items/subitems;
  • Font, colour, background, custom renderers and formatting for items and subitems;
  • Ability to add persistent data to an item using SetPyData and GetPyData: the data  can be any Python object and not necessarily an integer as in wx.ListCtrl;
  • CheckBox-type items and subitems;
  • RadioButton-type items and subitems;
  • Overflowing items/subitems, a la wxGrid, i.e. an item/subitem may overwrite neighboring items/subitems if its text would not normally fit in the space allotted to it;
  • Hyperlink-type items and subitems: they look like an hyperlink, with the proper mouse cursor on hovering;
  • Multiline text items and subitems;
  • Variable row heights depending on the item/subitem kind/text/window;
  • User defined item/subitem renderers: these renderer classes *must* implement the methods `DrawSubItem`, `GetLineHeight` and `GetSubItemWidth` (see the demo);
  • Enabling/disabling items (together with their plain or grayed out icons);
  • Whatever non-toplevel widget can be attached next to an item/subitem;
  • Column headers are fully customizable in terms of icons, colour, font, alignment etc...;
  • Column headers can have their own checkbox/radiobutton;
  • Column footers are fully customizable in terms of icons, colour, font, alignment etc...;
  • Column footers can have their own checkbox/radiobutton;
  • Ability to hide/show columns;
  • Default selection style, gradient (horizontal/vertical) selection style and Windows  Vista selection style.


Styles

  • A ULC_TILE style, in which each item appears as a full-sized icon with a label of one or more lines beside it (partially implemented);


Extra Styles

  • ULC_NO_HIGHLIGHT: No highlight when an item is selected;
  • ULC_STICKY_HIGHLIGHT: Items are selected by simply hovering on them, with no need to click on them;
  • ULC_STICKY_NOSELEVENT: Don't send a selection event when using ULC_STICKY_HIGHLIGHT extra style;
  • ULC_SEND_LEFTCLICK: Send a left click event when an item is selected;
  • ULC_AUTO_CHECK_CHILD: When a column header has a checkbox associated, auto-check all the subitems in that column;
  • ULC_AUTO_TOGGLE_CHILD: When a column header has a checkbox associated, toggle all the subitems in that column;
  • ULC_SHOW_TOOLTIPS: Show tooltips for ellipsized items/subitems (text too long to be shown in the available space) containing the full item/subitem text;
  • ULC_HOT_TRACKING: Enable hot tracking of items on mouse motion;
  • ULC_BORDER_SELECT: Changes border color whan an item is selected, instead of  highlighting the item;
  • ULC_TRACK_SELECT: Enables hot-track selection in a list control. Hot track selection  means that an item is automatically selected when the cursor remains over the item for a certain period of time. The delay is retrieved on Windows using the win32api call win32gui.SystemParametersInfo(win32con.SPI_GETMOUSEHOVERTIME), and is defaulted to 400ms on other platforms. This extra style applies to all views of UltimateListCtrl;
  • ULC_HEADER_IN_ALL_VIEWS: Show column headers in all view modes;
  • ULC_NO_FULL_ROW_SELECT: When an item is selected, the only the item in the first column is highlighted;
  • ULC_FOOTER: Show a footer too (only when header is present);


And a lot more. Check the demo for an almost complete review of the functionalities.




Download UltimateListCtrl

Python Files