SuperCollider CLASSES

EZGui

An abstract superclass for EZ widget wrappers
Inherits from: Object

Description

Users will not normally directly create instances of EZGui, but only use it through its subclasses. It provides the basic mechanisms for various EZ widget wrappers. It also provides a standard for EZ GUI Classes, and new EZ Classes should subclass EZGUI to help keep a consistent user interface.

Class Methods

Inherited class methods

Instance Methods

Accessing Instance Variables

-view

Returns the enclosing CompositeView.

-bounds

Returns the bounds of the enclosing CompositeView.

-label: METHOD NOT FOUND!

Sets/gets it the label. Will add the label view if none was initially created.

Arguments:

string

An Instance of String.

-window

Returns the window if you used the popUp window function.

Accessing GUI options

-alwaysOnTop

-alwaysOnTop = bool

Makes the popup window always on top, if there is one.

Arguments:

bool

An Instance of Boolean. Default is false.

-visible

-visible = bool

Sets/gets it the component views are visible.

Arguments:

bool

An Instance of Boolean. Default is true.

-enabled

-enabled = bool

Sets/gets if the list is enabled.

Arguments:

bool

An Instance of Boolean. Default is true.

-onClose

-onClose = func

Sets/gets the onClose function of either view or window, depending on whether the EZ view used a popup window.

Arguments:

func

An Instance of Function or FunctionList.

-font = font

Arguments:

font

An instance of Font.

Subclassing

EZGui provides a standard and basic tools for most EZ classes. If you make a new EZ class, then subclass EZGui, and override the necessary methods. If your class only has a label and a widget, chances are, you need to override nothing, but only need to write the new and init class methods. See existing subclasses of EZGui for examples of this. You may also want to override the following:

-widget

Returns the active widget. Subclasses will typically refer to it or ignore it, e.g.:

MyEZClass{
    myOtherMethods{}
    ....
    listView{ ^widget }
}

-action

-action = value

Gets/sets the action of the EZ class instance.

Arguments:

(func)

An Instance of Function or FunctionList.

-value

-value = val

Gets/sets the value of the widget. Does not perform the action.

Arguments:

val

An integer.

-valueAction = val

Gets/sets the value of the widget. Performs do action.

Arguments:

val

An integer.

-doAction

Performs this.action.value(this).

Internal Utilities

-prSubViewBounds (rect, hasLabel)

This calculates the bounds of the subviews and the gaps. It returns an array of Rects, which depends on how many subview there are. Subclasses override this if they have more than one widget.

-prMakeView (parentView, bounds)

Called by init. Returns [view, bounds]. The container is either the enclosing Container, or a pop up window with a container.

-prSetViewParams: METHOD NOT FOUND!

Only defined by some subclasses. Sets the resize and align of all the views, according to the state of layout.

-prMakeMarginGap (parentView, argMargin, argGap)

Called in the init method of all subclasses. Sets the margin and gap of view. By default, it tries to get its parent's gap, otherwise it defaults to 2@2. Setting argGap overrides these.

Inherited instance methods

Undocumented instance methods

-labelView

-labelView = value

-layout

-remove

-valueActionIfChanged = val

From extension in /Applications/SuperCollider.app/Contents/Resources/SCClassLibrary/Common/GUI/Base/extValueActionIfChanged.sc