SuperCollider CLASSES

EZScroller

Show a subset of items on gui elements
Inherits from: Object

Description

EZScroller is a vertical slider that allows displaying different subsets of a dynamically changing list of objects on a fixed number of views by scrolling.

EZScroller is used JITLib guis like NodeProxyEditor, ProxyMixer, TdefAllGui, and PdefAllGui.

Class Methods

Inherited class methods

Undocumented class methods

*new (w, bounds, maxItems, numItems, action, initVal: 0)

Instance Methods

Inherited instance methods

Undocumented instance methods

-action

-action = value

-adjust

-decrement

-doAction

-enabled

-enabled = flag

-increment

-maxItems

-maxItems = val

-numItems

-numItems = val

-remove

-slider

-spec

-value

-value = val

-valueAction = val

-visible

-visible = flag

Examples

(
w = Window.new("EZScroller test", Rect(100, 400,200, 100)).front;
// 5 displays
v = { |i| DragBoth.new(w, Rect(0, i * 20, 100, 20)) }.dup(5);
// 12 items
a = (1..12);

e = EZScroller(w, Rect(100,0,14,100), v.size, a.size, { |sc|
    var startIndex = sc.value.asInteger.postcs;
    v.do { |drag, i| drag.object_( a[ (startIndex) + i] ? ""); };
    e.visible_(sc.numItems > sc.maxItems); // hide when not useful
});
e.doAction;
)
// change list a, update ezscroller
a = (1..4); e.numItems_(a.size); e.doAction;

a = (1..8); e.numItems_(a.size); e.doAction;