Site Navigation

User Guide

Reference

Packages

 

DESCRIPTION

[TBD]

METHODS

Common methods apply to most windows, controls and resources.

new

new(PARENT, %OPTIONS)

Creates a new TreeView object can also be called as PARENT->AddTreeView(%OPTIONS).

Class specific %OPTIONS are:

  -imagelist => IMAGELIST
  -tooltip => Win32::GUI::Tooltip
  -lines => 0/1
  -rootlines => 0/1
  -buttons => 0/1
       enables or disables the +/- buttons to expand/collapse tree items.
  -showselalways => 0/1
  -checkboxes => 0/1
  -trackselect => 0/1
  -disabledragdrop => 0/1
  -editlabels => 0/1
  -fullrowselect => 0/1
  -nonevenheight => 0/1
  -noscroll => 0/1
  -notooltips => 0/1
  -rtlreading => 0/1
  -singleexpand => 0/1

See also the common options.

BackColor

BackColor([COLOR])

Gets or sets the background color for the control.

ChangeItem

ChangeItem(NODE, %OPTIONS)

See SetItem()

Clear

Clear([NODE])

Deletes all nodes from the TreeView if no argument is given; otherwise, delete all nodes under the given NODE.

Collapse

Collapse(NODE)

Closes a NODE of the TreeView.

Count

Count()

See GetCount()

CreateDragImage

CreateDragImage(NODE)

Creates a dragging bitmap for the specified item in a tree view control.

DeleteAllItems

DeleteAllItems()

Deletes all nodes from the TreeView.

DeleteItem

DeleteItem(NODE)

Removes the specified NODE from the TreeView.

EditLabel

EditLabel(NODE)

Begins in-place editing of the specified item's text, replacing the text of the item with a single-line edit control containing the text.

EndEditLabelNow

EndEditLabelNow([FLAG_CANCEL=TRUE])

Ends the editing of a tree view item's label.

EnsureVisible

EnsureVisible(NODE)

Ensures that a tree view item is visible, expanding the parent item or scrolling the tree view control, if necessary.

Expand

Expand(NODE, [FLAG])

Expands or collapses the list of child items associated with the specified parent item.

FirstVisible

FirstVisible([NODE])

Set or Get first visible node.

GetBkColor

GetBkColor()

Retrieves the current background color of the TreeView

GetChild

GetChild(NODE)

Returns the handle of the first child node for the given NODE.

GetCount

GetCount()

Returns the number of nodes in the TreeView.

GetDropHilight

GetDropHilight()

Retrieves the tree view item that is the target of a drag-and-drop operation.

GetEditControl

GetEditControl()

Retrieves the handle to the edit control being used to edit a tree view item's text.

GetFirstVisible

GetFirstVisible()

Retrieves the first visible item in a TreeView.

GetImageList

GetImageList([TYPE=TVSIL_NORMAL])

Retrieves the handle to the normal or state image list associated with a TreeView. TYPE = TVSIL_NORMAL | TVSIL_STATE

GetIndent

GetIndent()

Retrieves the amount, in pixels, that child items are indented relative to their parent items.

GetInsertMarkColor

GetInsertMarkColor()

Retrieves the color used to draw the insertion mark for the tree view.

GetISearchString

GetISearchString(STRING)

Retrieves the incremental search string for a tree view control.

GetItem

GetItem(NODE)

Returns an associative array of information about the given NODE:

    -children
    -image
    -parent
    -selectedimage
    -state
    -text

GetItemHeight

GetItemHeight()

Retrieves the current height of the tree view items.

GetItemRect

GetItemRect(NODE,[FLAG=FALSE])

Retrieves the bounding rectangle for a tree view item and indicates whether the item is visible. If FLAG is TRUE, the bounding rectangle includes only the text of the item. Otherwise, it includes the entire line that the item occupies in the tree view control.

GetLastVisible

GetLastVisible()

Retrieves the last expanded item in a tree view control.

GetNextItem

GetNextItem(ITEM,FLAG)

Retrieves the tree view item that bears the specified relationship to a specified item.

FLAG specifying the item to retrieve :

 TVGN_CARET           = Retrieves the currently selected item.
 TVGN_CHILD           = Retrieves the first child item of the item specified by the hitem parameter.
 TVGN_DROPHILITE      = Retrieves the item that is the target of a drag-and-drop operation.
 TVGN_FIRSTVISIBLE    = Retrieves the first visible item.
 TVGN_NEXT            = Retrieves the next sibling item.
 TVGN_NEXTVISIBLE     = Retrieves the next visible item that follows the specified item. The specified item must be visible.
 TVGN_PARENT          = Retrieves the parent of the specified item.
 TVGN_PREVIOUS        = Retrieves the previous sibling item.
 TVGN_PREVIOUSVISIBLE = Retrieves the first visible item that precedes the specified item. The specified item must be visible.
 TVGN_ROOT            = Retrieves the topmost or very first item of the tree view control.

GetNextSibling

GetNextSibling(NODE)

Returns the handle of the next sibling node for the given NODE.

GetNextVisible

GetNextVisible(NODE)

Retrieves the next visible item that follows a specified item in a tree view control.

GetParent

GetParent(NODE)

Returns the handle of the parent node for the given NODE.

NOTE: With no NODE parameter this is the standard GetParent() method, returning the parent window.

GetPrevSibling

GetPrevSibling(NODE)

Returns the handle of the previous sibling node for the given NODE.

GetPrevVisible

GetPrevVisible(NODE)

Retrieves the first visible item that precedes a specified item in a TreeView.

GetRoot

GetRoot()

Returns the handle of the TreeView root node.

GetScrollTime

GetScrollTime()

Retrieves the maximum scroll time for the TreeView.

GetSelection

GetSelection()

Returns the handle of the currently selected node.

GetTextColor

GetTextColor()

Retrieves the current text color of the control.

GetToolTips

GetToolTips()

Retrieves the handle to the child tooltip control used by a TreeView.

GetUnicodeFormat

GetUnicodeFormat()

Retrieves the UNICODE character format flag for the control.

GetVisibleCount

GetVisibleCount()

Obtains the number of items that can be fully visible in the client window of a TreeView.

HitTest

HitTest(X, Y)

Determines the location of the specified point relative to the client area of a TreeView.

Indent

Indent([VALUE])

Set or Get Indent value.

InsertItem

InsertItem(%OPTIONS)

Inserts a new node in the TreeView.

Allowed %OPTIONS are:

    -bold => 0/1, default 0
    -image => NUMBER
        index of an image from the associated ImageList
    -item => NUMBER
        handle of the node after which the new node is to be inserted,
        or one of the following special values:
            0xFFFF0001: at the beginning of the list
            0xFFFF0002: at the end of the list
            0xFFFF0003: in alphabetical order
        the default value is at the end of the list
    -parent => NUMBER
        handle of the parent node for the new node
    -selected => 0/1, default 0
    -selectedimage => NUMBER
        index of an image from the associated ImageList
    -text => STRING
        the text for the node

ItemCheck

ItemCheck(NODE, [VALUE])

Set or Get node checked state.

ItemInfo

ItemInfo(NODE)

See GetItem()

Reset

Reset()

See DeleteAllItems()

Select

Select(NODE, [FLAG=TVGN_CARET])

Selects the given NODE in the TreeView. If NODE is 0 (zero), the selected item, if any, is deselected.

Optional FLAG parameter

 TVGN_CARET        = Sets the selection to the given item.
 TVGN_DROPHILITE   = Redraws the given item in the style used to indicate the target of a drag-and-drop operation.
 TVGN_FIRSTVISIBLE = Ensures that the specified item is visible, and, if possible, displays it at the top of the control's window.

SelectDropTarget

SelectDropTarget(NODE)

Redraws a specified tree view control item in the style used to indicate the target of a drag-and-drop operation.

SelectedItem

SelectedItem()

See GetSelection()

SelectItem

SelectItem(NODE)

Selects the specified tree view item.

SelectSetFirstVisible

SelectSetFirstVisible(NODE)

Scrolls the tree view control vertically to ensure that the specified item is visible. If possible, the specified item becomes the first visible item at the top of the control's window.

SetBkColor

SetBkColor(COLOR)

Sets the background color for the control.

SetImageList

SetImageList(IMAGELIST, [TYPE])

Sets the normal or state image list for a tree view control and redraws the control using the new images.

SetIndent

SetIndent(VALUE)

Sets the width of indentation for a tree view control and redraws the control to reflect the new width.

SetInsertMark

SetInsertMark(NODE,[FLAG_AFTER=FALSE])

Sets the insertion mark in a tree view control.

SetInsertMarkColor

SetInsertMarkColor(COLOR)

Sets the color used to draw the insertion mark for the tree view.

SetItem

SetItem(NODE, %OPTIONS)

Change most of the options used when the item was created (see InsertItem()). Allowed %OPTIONS are:

    -bold
    -image
    -selected
    -selectedimage
    -text

SetItemHeight

SetItemHeight(HEIGHT)

Sets the height of the tree view items.

SetScrollTime

SetScrollTime(TIME)

Sets the maximum scroll time for the tree view control.

SetTextColor

SetTextColor(COLOR)

Sets the text color of the control.

SetToolTips

SetToolTips(TOOLTIP)

Sets a tree view control's child tooltip control.

SetUnicodeFormat

SetUnicodeFormat(FLAG)

Sets the UNICODE character format flag for the control.

Sort

Sort(NODE)

See SortChildren()

SortChildren

SortChildren(NODE)

Sorts the childs of the specified NODE in the TreeView.

TextColor

TextColor([COLOR])

Gets or sets the text color for the control.

VisibleCount

VisibleCount()

See GetVisibleCount()

EVENTS

Common events apply to most windows and controls.

BeginLabelEdit

BeginLabelEdit(NODE)

Sent when the user is about to edit the specified NODE of the TreeView The event should return 0 to prevent the action, 1 to allow it.

For a treeview to receive this event, -editlabels need to be set to true.

Collapse

Collapse(NODE)

Sent when the user closes the specified NODE of the TreeView.

Collapsing

Collapsing(NODE)

Sent when the user is about to close the specified NODE of the TreeView. The event should return 0 to prevent the action, 1 to allow it.

EndLabelEdit

EndLabelEdit(NODE,TEXT)

Sent when the user has finished editing a label in the TreeView control. You have explicitly set the text of the node to reflect the new changes. If the user cancels the edit, the text is undef.

Expand

Expand(NODE)

Sent when the user opens the specified NODE of the TreeView.

Expanding

Expanding(NODE)

Sent when the user is about to open the specified NODE of the TreeView The event should return 0 to prevent the action, 1 to allow it.

KeyDown

KeyDown(KEY)

Sent when the user presses a key while the TreeView control has focus; KEY is the ASCII code of the key being pressed.

NodeClick

NodeClick(NODE)

Sent when the user clicks on the specified NODE of the TreeView.

VERSION

Documentation for Win32::GUI v1.06 created 13 Feb 2008

This document is autogenerated by the build process. Edits made here will be lost. Edit docs/per_package.tpl instead.

SUPPORT

Homepage: http://perl-win32-gui.sourceforge.net/.

For further support join the users mailing list(perl-win32-gui-users@lists.sourceforge.net) from the website at http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users. There is a searchable list archive at http://sourceforge.net/mail/.

COPYRIGHT and LICENCE

Copyright (c) 1997..2008 Aldo Calpini. All rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.