Haiku API Bindings
OutlineListView
Not logged in

Documentation | InterfaceKit | OutlineListView

SYNOPSIS

Perl

use HaikuR1::OutlineListView qw(B_SINGLE_SELECTION_LIST B_MULTIPLE_SELECTION_LIST B_POP_UP_BEHAVIOR B_NO_OP B_REPLACE_OP B_MOVE_OP B_SWAP_OP);

my $listview = HaikuR1::OutlineListView->new(
    frame => $frame,
    name => $name,
    type => $type,
    resizingMode => $resizingMode,
    flags => $flags,
);
$window->AddChild($listview);

Python

from HaikuR1.InterfaceKit import OutlineListView, B_SINGLE_SELECTION_LIST, B_MULTIPLE_SELECTION_LIST, B_POP_UP_BEHAVIOR, B_NO_OP, B_REPLACE_OP, B_MOVE_OP, B_SWAP_OP

listview = OutlineListView(
    frame = frame,
    name = name,
    type = type,
    resizingMode = resizingMode,
    flags = flags,
)
window.AddChild(listview)

DESCRIPTION

Exposes the BOutlineListView object.

For more information on OutlineListView, see the Be Book class description, the Be Book overview, and the Haiku Book class description.

METHODS

Constructor

Creates an OutlineListView.

Perl

HaikuR1::OutlineListView->new(
    frame => $frame,
    name => $name,
    type => $type,
    resizingMode => $resizingMode,
    flags => $flags,
);
HaikuR1::OutlineListView->new($archive);

Python

OutlineListView(
    frame = frame,
    name = name,
    type = type,
    resizingMode = resizingMode,
    flags = flags,
)
OutlineListView(archive)

AddUnder

Add an item under an existing item.

This method can also be called as a hook.

Perl

$outlinelistview->AddUnder($item, $superItem);

Python

outlinelistview.AddUnder(item, superItem)

Expanding and collapsing

Expand

Collapse

IsExpanded

These methods do what you expect.

Note that Expand and Collapse take a ListItem, while IsExpanded takes an index.

Perl

$outlinelistview->Expand($item);
$outlinelistview->Collapse($item);
$outlinelistview->IsExpanded($fullListIndex);

Python

outlinelistview.Expand(item)
outlinelistview.Collapse(item)
outlinelistview.IsExpanded(fullListIndex)

Full list operations

FullListItemAt

FullListIndexOf

FullListFirstItem

FullListLastItem

FullListHasItem

FullListCountItems

FullListCurrentSelection

FullListIsEmpty

FullListDoForEach

FullListSortItems

These methods are like the similarly named methods without the FullList prefix. They operate on the entire list, not just the visible items.

Perl

$outlinelistview->FullListItemAt($fullListIndex, $class);
$outlinelistview->FullListIndexOf($point);
$outlinelistview->FullListIndexOf($item);
$outlinelistview->FullListFirstItem($class);
$outlinelistview->FullListLastItem($class);
$outlinelistview->FullListHasItem($item);
$outlinelistview->FullListCountItems();
$outlinelistview->FullListCurrentSelection($index);
$outlinelistview->FullListIsEmpty();
$outlinelistview->FullListDoForEach($func);
$outlinelistview->FullListDoForEach($func, $arg);
$outlinelistview->FullListSortItems($cmp);

Python

outlinelistview.FullListItemAt(fullListIndex, class)
outlinelistview.FullListIndexOf(point)
outlinelistview.FullListIndexOf(item)
outlinelistview.FullListFirstItem(class)
outlinelistview.FullListLastItem(class)
outlinelistview.FullListHasItem(item)
outlinelistview.FullListCountItems()
outlinelistview.FullListCurrentSelection(index)
outlinelistview.FullListIsEmpty()
outlinelistview.FullListDoForEach(func)
outlinelistview.FullListDoForEach(func, arg)
outlinelistview.FullListSortItems(cmp)

Subitem operations

EachItemUnder

SortItemsUnder

CountItemsUnder

ItemUnderAt

These methods are similar to DoForEach and SortItems, except that they act on the items under a given item.

Perl

$outlinelistview->EachItemUnder(
    superItem => $superItem,
    oneLevelOnly => $oneLevelOnly,
    func => $func,
    arg => $arg,
);
$outlinelistview->SortItemsUnder($superItem, $oneLevelOnly, $cmp);
$outlinelistview->CountItemsUnder($superItem, $oneLevelOnly);
$outlinelistview->ItemUnderAt($superItem, $oneLevelOnly, $index);

Python

outlinelistview.EachItemUnder(
    superItem = superItem,
    oneLevelOnly = oneLevelOnly,
    func = func,
    arg = arg,
)
outlinelistview.SortItemsUnder(superItem, oneLevelOnly, cmp)
outlinelistview.CountItemsUnder(superItem, oneLevelOnly)
outlinelistview.ItemUnderAt(superItem, oneLevelOnly, index)

Superitem

Returns the parent item for the given item.

Perl

$outlinelistview->Superitem($item);

Python

outlinelistview.Superitem(item)

ARCHIVABLE INTERFACE

OutlineListView inherits the methods and hooks of Archivable.

HANDLER INTERFACE

OutlineListView inherits the methods and hooks of Handler.

VIEW INTERFACE

OutlineListView inherits the methods and hooks of View.

LISTVIEW INTERFACE

OutlineListView inherits the methods and hooks of ListView.

The following differ from the ListView version:

ItemAt

IndexOf

FirstItem

LastItem

HasItem

CountItems

CurrentSelection

IsEmpty

DoForEach

SortItems

These methods operate only on the visible items. That is, the indexes they accept or return are indexes into the set of visible items.

HOOKS

DrawItem

Called when the an item needs to be drawn.

Perl

$outlinelistview->DrawItem($item, $itemRect, $complete);

Python

outlinelistview.DrawItem(item, itemRect, complete)

DrawLatch

Called when the item needs to draw the "latch", the symbol that indicates whether the item is expanded or collapsed.

Perl

$outlinelistview->DrawLatch(
    itemRect => $itemRect,
    level => $level,
    collapsed => $collapsed,
    highlighted => $highlighted,
    misTracked => $misTracked,
);

Python

outlinelistview.DrawLatch(
    itemRect = itemRect,
    level = level,
    collapsed = collapsed,
    highlighted = highlighted,
    misTracked = misTracked,
)

ExpandOrCollapse

Called when an item is expanded or collapsed.

Perl

$outlinelistview->ExpandOrCollapse($superItem, $expand);

Python

outlinelistview.ExpandOrCollapse(superItem, expand)

LatchRect

Called when the item is drawn to determine how much space is needed for the latch.

You should return the frame Rect for the latch.

Perl

$outlinelistview->LatchRect($itemRect, $level);

Python

outlinelistview.LatchRect(itemRect, level)

SCRIPTING SUITE

OutlineListView inherits the following suites: