Home | Trees | Index | Help |
|
---|
Package wx :: Package lib :: Module customtreectrl |
|
Description =========== CustomTreeCtrl is a class that mimics the behaviour of wx.TreeCtrl, 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 tree control. Apart of the base functionalities of CustomTreeCtrl (described below), in addition to the standard wx.TreeCtrl behaviour this class supports: * CheckBox-type items: checkboxes are easy to handle, just selected or unselected state with no particular issues in handling the item's children; * RadioButton-type items: since I elected to put radiobuttons in CustomTreeCtrl, I needed some way to handle them, that made sense. So, I used the following approach: - All peer-nodes that are radiobuttons will be mutually exclusive. In other words, only one of a set of radiobuttons that share a common parent can be checked at once. If a radiobutton node becomes checked, then all of its peer radiobuttons must be unchecked. - If a radiobutton node becomes unchecked, then all of its child nodes will become inactive. * Hyperlink-type items: they look like an hyperlink, with the proper mouse cursor on hovering. * Multiline text items. * Enabling/disabling items (together with their plain or grayed out icons). * Whatever non-toplevel widget can be attached next to an item. * Default selection style, gradient (horizontal/vertical) selection style and Windows Vista selection style. * Customized drag and drop images built on the fly. * Setting the CustomTreeCtrl item buttons to a personalized imagelist. * Setting the CustomTreeCtrl check/radio item icons to a personalized imagelist. * Changing the style of the lines that connect the items (in terms of wx.Pen styles). * Using an image as a CustomTreeCtrl background (currently only in "tile" mode). And a lot more. Check the demo for an almost complete review of the functionalities. Base Functionalities ==================== CustomTreeCtrl supports all the wx.TreeCtrl styles, except: - TR_EXTENDED: supports for this style is on the todo list (Am I sure of this?). Plus it has 3 more styles to handle checkbox-type items: - TR_AUTO_CHECK_CHILD : automatically checks/unchecks the item children; - TR_AUTO_CHECK_PARENT : automatically checks/unchecks the item parent; - TR_AUTO_TOGGLE_CHILD: automatically toggles the item children. All the methods available in wx.TreeCtrl are also available in CustomTreeCtrl. Events ====== All the events supported by wx.TreeCtrl are also available in CustomTreeCtrl, with a few exceptions: - EVT_TREE_GET_INFO (don't know what this means); - EVT_TREE_SET_INFO (don't know what this means); - EVT_TREE_ITEM_MIDDLE_CLICK (not implemented, but easy to add); - EVT_TREE_STATE_IMAGE_CLICK: no need for that, look at the checking events below. Plus, CustomTreeCtrl supports the events related to the checkbutton-type items: - EVT_TREE_ITEM_CHECKING: an item is being checked; - EVT_TREE_ITEM_CHECKED: an item has been checked. And to hyperlink-type items: - EVT_TREE_ITEM_HYPERLINK: an hyperlink item has been clicked (this event is sent after the EVT_TREE_SEL_CHANGED event). Supported Platforms =================== CustomTreeCtrl has been tested on the following platforms: * Windows (Windows XP); * GTK (Thanks to Michele Petrazzo); * Mac OS (Thanks to John Jackson). Latest Revision: Andrea Gavana @ 02 Mar 2007, 22.30 CET Version 0.9
Classes | |
---|---|
CommandTreeEvent |
CommandTreeEvent is a special subclassing of wx.PyCommandEvent. |
CustomTreeCtrl |
|
DragImage |
This class handles the creation of a custom image in case of item drag and drop. |
GenericTreeItem |
This class holds all the information and methods for every single item in CustomTreeCtrl. |
TreeEvent |
|
TreeFindTimer |
Timer used to clear CustomTreeCtrl._findPrefix if no key was pressed for a sufficiently long time. |
TreeItemAttr |
Creates the item attributes (text colour, background colour and font). |
TreeRenameTimer |
Timer used for enabling in-place edit. |
TreeTextCtrl |
Control used for in-place edit. |
Function Summary | |
---|---|
A simple replacement of wx.RendererNative.DrawTreeItemButton. | |
Translate the key or mouse event flag to the type of selection we are dealing with. | |
GetCheckedBitmap()
| |
GetCheckedData()
| |
GetCheckedImage()
| |
GetFlaggedBitmap()
| |
GetFlaggedData()
| |
GetFlaggedImage()
| |
GetNotCheckedBitmap()
| |
GetNotCheckedData()
| |
GetNotCheckedImage()
| |
GetNotFlaggedBitmap()
| |
GetNotFlaggedData()
| |
GetNotFlaggedImage()
| |
Convert the given image (in place) to a grayed-out version, appropriate for a 'disabled' appearance. | |
Make a pixel grayed-out. |
Variable Summary | |
---|---|
str |
__version__ = '0.8'
|
PyEventBinder |
EVT_TREE_BEGIN_DRAG = <wx._core.PyEventBinder object at ...
|
PyEventBinder |
EVT_TREE_BEGIN_LABEL_EDIT = <wx._core.PyEventBinder obje...
|
PyEventBinder |
EVT_TREE_BEGIN_RDRAG = <wx._core.PyEventBinder object at...
|
PyEventBinder |
EVT_TREE_DELETE_ITEM = <wx._core.PyEventBinder object at...
|
PyEventBinder |
EVT_TREE_END_DRAG = <wx._core.PyEventBinder object at 0x...
|
PyEventBinder |
EVT_TREE_END_LABEL_EDIT = <wx._core.PyEventBinder object...
|
PyEventBinder |
EVT_TREE_GET_INFO = <wx._core.PyEventBinder object at 0x...
|
PyEventBinder |
EVT_TREE_ITEM_ACTIVATED = <wx._core.PyEventBinder object...
|
PyEventBinder |
EVT_TREE_ITEM_CHECKED = <wx._core.PyEventBinder object a...
|
PyEventBinder |
EVT_TREE_ITEM_CHECKING = <wx._core.PyEventBinder object ...
|
PyEventBinder |
EVT_TREE_ITEM_COLLAPSED = <wx._core.PyEventBinder object...
|
PyEventBinder |
EVT_TREE_ITEM_COLLAPSING = <wx._core.PyEventBinder objec...
|
PyEventBinder |
EVT_TREE_ITEM_EXPANDED = <wx._core.PyEventBinder object ...
|
PyEventBinder |
EVT_TREE_ITEM_EXPANDING = <wx._core.PyEventBinder object...
|
PyEventBinder |
EVT_TREE_ITEM_GETTOOLTIP = <wx._core.PyEventBinder objec...
|
PyEventBinder |
EVT_TREE_ITEM_HYPERLINK = <wx._core.PyEventBinder object...
|
PyEventBinder |
EVT_TREE_ITEM_MENU = <wx._core.PyEventBinder object at 0...
|
PyEventBinder |
EVT_TREE_ITEM_MIDDLE_CLICK = <wx._core.PyEventBinder obj...
|
PyEventBinder |
EVT_TREE_ITEM_RIGHT_CLICK = <wx._core.PyEventBinder obje...
|
PyEventBinder |
EVT_TREE_KEY_DOWN = <wx._core.PyEventBinder object at 0x...
|
PyEventBinder |
EVT_TREE_SEL_CHANGED = <wx._core.PyEventBinder object at...
|
PyEventBinder |
EVT_TREE_SEL_CHANGING = <wx._core.PyEventBinder object a...
|
PyEventBinder |
EVT_TREE_SET_INFO = <wx._core.PyEventBinder object at 0x...
|
PyEventBinder |
EVT_TREE_STATE_IMAGE_CLICK = <wx._core.PyEventBinder obj...
|
int |
TREE_HITTEST_ABOVE = 1 |
int |
TREE_HITTEST_BELOW = 2 |
int |
TREE_HITTEST_NOWHERE = 4 |
int |
TREE_HITTEST_ONITEM = 16464 |
int |
TREE_HITTEST_ONITEMBUTTON = 8 |
int |
TREE_HITTEST_ONITEMCHECKICON = 16384 |
int |
TREE_HITTEST_ONITEMICON = 16 |
int |
TREE_HITTEST_ONITEMINDENT = 32 |
int |
TREE_HITTEST_ONITEMLABEL = 64 |
int |
TREE_HITTEST_ONITEMLOWERPART = 4096 |
int |
TREE_HITTEST_ONITEMRIGHT = 128 |
int |
TREE_HITTEST_ONITEMSTATEICON = 256 |
int |
TREE_HITTEST_ONITEMUPPERPART = 2048 |
int |
TREE_HITTEST_TOLEFT = 512 |
int |
TREE_HITTEST_TORIGHT = 1024 |
int |
wxEVT_TREE_BEGIN_DRAG = 10019 |
int |
wxEVT_TREE_BEGIN_LABEL_EDIT = 10021 |
int |
wxEVT_TREE_BEGIN_RDRAG = 10020 |
int |
wxEVT_TREE_DELETE_ITEM = 10023 |
int |
wxEVT_TREE_END_DRAG = 10036 |
int |
wxEVT_TREE_END_LABEL_EDIT = 10022 |
int |
wxEVT_TREE_GET_INFO = 10024 |
int |
wxEVT_TREE_ITEM_ACTIVATED = 10033 |
int |
wxEVT_TREE_ITEM_CHECKED = 10297 |
int |
wxEVT_TREE_ITEM_CHECKING = 10296 |
int |
wxEVT_TREE_ITEM_COLLAPSED = 10028 |
int |
wxEVT_TREE_ITEM_COLLAPSING = 10029 |
int |
wxEVT_TREE_ITEM_EXPANDED = 10026 |
int |
wxEVT_TREE_ITEM_EXPANDING = 10027 |
int |
wxEVT_TREE_ITEM_GETTOOLTIP = 10038 |
int |
wxEVT_TREE_ITEM_HYPERLINK = 10298 |
int |
wxEVT_TREE_ITEM_MENU = 10039 |
int |
wxEVT_TREE_ITEM_MIDDLE_CLICK = 10035 |
int |
wxEVT_TREE_ITEM_RIGHT_CLICK = 10034 |
int |
wxEVT_TREE_KEY_DOWN = 10032 |
int |
wxEVT_TREE_SEL_CHANGED = 10030 |
int |
wxEVT_TREE_SEL_CHANGING = 10031 |
int |
wxEVT_TREE_SET_INFO = 10025 |
int |
wxEVT_TREE_STATE_IMAGE_CLICK = 10037 |
Function Details |
---|
DrawTreeItemButton(win, dc, rect, flags)A simple replacement of wx.RendererNative.DrawTreeItemButton. |
EventFlagsToSelType(style, shiftDown=False, ctrlDown=False)Translate the key or mouse event flag to the type of selection we are dealing with. |
GrayOut(anImage)Convert the given image (in place) to a grayed-out version, appropriate for a 'disabled' appearance. |
MakeGray((r, g, b), factor, maskColor)Make a pixel grayed-out. If the pixel matches the maskcolor, it won't be changed. |
Variable Details |
---|
__version__
|
EVT_TREE_BEGIN_DRAG
|
EVT_TREE_BEGIN_LABEL_EDIT
|
EVT_TREE_BEGIN_RDRAG
|
EVT_TREE_DELETE_ITEM
|
EVT_TREE_END_DRAG
|
EVT_TREE_END_LABEL_EDIT
|
EVT_TREE_GET_INFO
|
EVT_TREE_ITEM_ACTIVATED
|
EVT_TREE_ITEM_CHECKED
|
EVT_TREE_ITEM_CHECKING
|
EVT_TREE_ITEM_COLLAPSED
|
EVT_TREE_ITEM_COLLAPSING
|
EVT_TREE_ITEM_EXPANDED
|
EVT_TREE_ITEM_EXPANDING
|
EVT_TREE_ITEM_GETTOOLTIP
|
EVT_TREE_ITEM_HYPERLINK
|
EVT_TREE_ITEM_MENU
|
EVT_TREE_ITEM_MIDDLE_CLICK
|
EVT_TREE_ITEM_RIGHT_CLICK
|
EVT_TREE_KEY_DOWN
|
EVT_TREE_SEL_CHANGED
|
EVT_TREE_SEL_CHANGING
|
EVT_TREE_SET_INFO
|
EVT_TREE_STATE_IMAGE_CLICK
|
TREE_HITTEST_ABOVE
|
TREE_HITTEST_BELOW
|
TREE_HITTEST_NOWHERE
|
TREE_HITTEST_ONITEM
|
TREE_HITTEST_ONITEMBUTTON
|
TREE_HITTEST_ONITEMCHECKICON
|
TREE_HITTEST_ONITEMICON
|
TREE_HITTEST_ONITEMINDENT
|
TREE_HITTEST_ONITEMLABEL
|
TREE_HITTEST_ONITEMLOWERPART
|
TREE_HITTEST_ONITEMRIGHT
|
TREE_HITTEST_ONITEMSTATEICON
|
TREE_HITTEST_ONITEMUPPERPART
|
TREE_HITTEST_TOLEFT
|
TREE_HITTEST_TORIGHT
|
wxEVT_TREE_BEGIN_DRAG
|
wxEVT_TREE_BEGIN_LABEL_EDIT
|
wxEVT_TREE_BEGIN_RDRAG
|
wxEVT_TREE_DELETE_ITEM
|
wxEVT_TREE_END_DRAG
|
wxEVT_TREE_END_LABEL_EDIT
|
wxEVT_TREE_GET_INFO
|
wxEVT_TREE_ITEM_ACTIVATED
|
wxEVT_TREE_ITEM_CHECKED
|
wxEVT_TREE_ITEM_CHECKING
|
wxEVT_TREE_ITEM_COLLAPSED
|
wxEVT_TREE_ITEM_COLLAPSING
|
wxEVT_TREE_ITEM_EXPANDED
|
wxEVT_TREE_ITEM_EXPANDING
|
wxEVT_TREE_ITEM_GETTOOLTIP
|
wxEVT_TREE_ITEM_HYPERLINK
|
wxEVT_TREE_ITEM_MENU
|
wxEVT_TREE_ITEM_MIDDLE_CLICK
|
wxEVT_TREE_ITEM_RIGHT_CLICK
|
wxEVT_TREE_KEY_DOWN
|
wxEVT_TREE_SEL_CHANGED
|
wxEVT_TREE_SEL_CHANGING
|
wxEVT_TREE_SET_INFO
|
wxEVT_TREE_STATE_IMAGE_CLICK
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1.20050511.rpd on Thu Mar 22 12:09:54 2007 | http://epydoc.sf.net |