GMRecordButton:
Filter:
GraphicalModule/Classes (extension) | GUI > Graphical Module

GMRecordButton
ExtensionExtension

A simple recording button for creating graphical interfaces

Description

GMRecordButton is an easy to use button.

It natively alternates between two visual symbols related to the idea of recording a sound. When recording, the button is slowly blinking.

It only responds to mouse down clicks, and does not discriminate button identifiers.

By default, it allows to record the default server, using default parameters, using this Function :

You can override this by any custom Function.

Class Methods

.new

Creates a new instance of GMRecordButton.

By default, its graphical properties are defined by its associated GMStyle. In fact, the visual properties of this View are hardcoded, and the only available settings are the borders parameters.

Returns:

a GMRecordButton instance.

Instance Methods

Interaction

.action

Sets or gets the Function to be triggered when the button is pressed down. This Function takes the current state of the button as a boolean as argument, i.e. pressing it down once will call the Function passing true as argument, pressing it down a second time will call the Function passing false as argument, etc.

Arguments:

aFunction

A Function with one argument, the state of the button as a Boolean.

.mouseDownAction

Sets or gets the Function to be triggered when the button is pressed down. This Function takes the current state of the button as a boolean as argument, i.e. pressing it down once will call the Function passing true as argument, pressing it down a second time will call the Function passing false as argument, etc. Equivalent to .action .

Arguments:

aFunction

A Function with one argument, the state of the button as a Boolean.

.setDisplay

Allows to animate the button without triggering the associated action (for example in response to a keyboard event). Passing true as argument will animate the button if not animated already, passing false will stop the animation if not stopped already. Visual updates are internally deferred so the method can be called within a clock context.

.symbolRatio

Sets or gets the symbol size relative to its smallest axis, and refreshes the View.

.isRecording

Gets the internal state of the GMRecordButton.

Internal Methods

.draw

The function associated to the View's drawFunc. Shouldn't be modified, use UserView instead.

Arguments:

aFunction

Examples