yjqww6
Yet another tree widget for Racket. It uses functional cursors to represent the nodes of the tree.
constructor
[ [wheel-stepwheel-step]]...superclass-args...)The wheel-step argument controls the speed of scrolling.method
(send a-tree-widget get-root )→root-cursor?
Returns a cursor representing the root of the tree.Set the root of the tree.method
(send a-tree-widget append-item cv[expand?])→void?
v:any/cAppends an item v to the children of c. All the cursors acquired previously will be invalidated.method
vv:any/cPrepends an item v to the children of c. All the cursors acquired previously will be invalidated.method
ivv:any/cInserts an item v as the ith child of c. All the cursors acquired previously will be invalidated.method
(send a-tree-widget update-item civ)→void?
v:any/cUpdates the ith child of c to v. All the cursors acquired previously will be invalidated.method
(send a-tree-widget delete-item ci)→void?
Deletes the ith child of c. All the cursors acquired previously will be invalidated.method
(send a-tree-widget expand-item cexpand?)→void?
expand?:boolean?Changes the expanding status of c to expand?. All the cursors acquired previously will be invalidated.method
(send a-tree-widget reset-items )→void
Resets the tree to empty. All the cursors acquired previously will be invalidated.method
(send a-tree-widget on-positions-changed )→void?
Called after the tree is modified.Default Implementation: Calls refresh .
method
(send a-tree-widget paint-item cvxy)→void?
v:any/cPaints the item v represented by cursor c at specific dc location.method
(send a-tree-widget compute-item-size v)
v:any/cOverrides compute-item-size in tree<%> .Computes the width, height and children indentation of item v.Default Implementation: Returns (values 110).
method
(send a-tree-widget locate-item xy)→(or/c #fnode-cursor? )
Finds out the item at specific location (dc coordinates). If x is #f, only y is considered.method
(send a-tree-widget make-indices-cursor indices)
Constructs an cursor from indices, which should be only used to modify the tree immediately. Equivalent towhen used to modify the tree.
interface
method
(send a-tree get-root )→root-cursor?
Returns a cursor representing the root of the tree.Set the root of the tree.method
v:any/cComputes the width, height and children indentation of item v.method
(send a-tree on-positions-changed )→void?
Called after the tree is modified.
mixin
tree-mixin :(class? . -> .class? )
class
superclass:object%
constructor
( new tree-updater% [treetree])→(is-a?/c tree-updater% )
Constructs a tree-updater% associated with tree.method
v[ expand?v:any/cmethod
v[ expand?v:any/cmethod
iv[ expand?v:any/cmethod
(send a-tree-updater update-item tiv)→root-cursor?
v:any/cmethod
(send a-tree-updater delete-item ti)→root-cursor?
method
(send a-tree-updater expand-item texpand?)→root-cursor?
expand?:boolean?method
(send a-tree-updater update-children tf)→root-cursor?
tree:root-cursor?Set the root of associated tree<%> to tree.method
(send a-tree-updater empty-tree )→root-cursor?
procedure
( root-cursor? v)→boolean?
v:any/c
procedure
( node-cursor? v)→boolean?
v:any/c
procedure
( indices-cursor? v)→boolean?
v:any/c
procedure
( generic-cursor? v)→boolean?
v:any/c
procedure
( cursor-equal? ab)→boolean?
a:cursor?b:cursor?
procedure
( cursor-valid? tc)→boolean?
c:cursor?
procedure
( cursor-children c)→(listof node-cursor? )
c:cursor?
procedure
c:cursor?
procedure
c:cursor?
procedure
( cursor-get-child ci)→node-cursor?
c:cursor?
procedure
procedure
( node-cursor-value c)→any/c
procedure
procedure
procedure
procedure
procedure
( root-cursor-locate-item cxy)→(or/c #fnode-cursor? )
procedure
y-starty-end)y-start:exact-nonnegative-integer?