AGW Logo

customtreectrl functions

This is the description of standalone Python functions in the customtreectrl module.

method_summary Functions Summary


ChopText Chops the input text if its size does not fit in max_size, by cutting the text and adding ellipsis at the end.
DrawTreeItemButton Draw the expanded/collapsed icon for a tree control item.
EventFlagsToSelType Translate the key or mouse event flag to the type of selection we are dealing with.
MakeDisabledBitmap Creates a disabled-looking bitmap starting from the input one.

API Functions API



ChopText(dc, text, max_size)[source]

Chops the input text if its size does not fit in max_size, by cutting the text and adding ellipsis at the end.

Parameters:
  • dc – a wx.DC device context;
  • text – the text to chop;
  • max_size – the maximum size in which the text should fit.

Note

This method is used exclusively when CustomTreeCtrl has the TR_ELLIPSIZE_LONG_ITEMS style set.

New in version 0.9.3.



DrawTreeItemButton(win, dc, rect, flags)[source]

Draw the expanded/collapsed icon for a tree control item.

Parameters:
  • win – an instance of wx.Window;
  • dc – an instance of wx.DC;

  • rect (wx.Rect) – the client rectangle where to draw the tree item button;
  • flags (integer) – contains wx.CONTROL_EXPANDED bit for expanded tree items.

Note

This is a simple replacement of wx.RendererNative.DrawTreeItemButton.

Note

This method is never used in wxPython versions newer than 2.6.2.1.



EventFlagsToSelType(style, shiftDown=False, ctrlDown=False)[source]

Translate the key or mouse event flag to the type of selection we are dealing with.

Parameters:
  • style (integer) – the main CustomTreeCtrl window style flag;
  • shiftDown (bool) – True if the Shift key is pressed, False otherwise;
  • ctrlDown (bool) – True if the Ctrl key is pressed, False otherwise;
Returns:

A 3-elements tuple, with the following elements:

  • is_multiple: True if CustomTreeCtrl has the TR_MULTIPLE flag set, False otherwise;
  • extended_select: True if the Shift key is pressend and if CustomTreeCtrl has the TR_MULTIPLE flag set, False otherwise;
  • unselect_others: True if the Ctrl key is pressend and if CustomTreeCtrl has the TR_MULTIPLE flag set, False otherwise.



MakeDisabledBitmap(original)[source]

Creates a disabled-looking bitmap starting from the input one.

Parameters:original – an instance of wx.Bitmap to be greyed-out.
Returns:An instance of wx.Bitmap, containing a disabled-looking representation of the original item image.
Tree

Table Of Contents

Previous topic

TreeTextCtrl

Next topic

SVN Revision 67457 For customtreectrl