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

GMCheckButton
ExtensionExtension

A ready made checkbox button, for creating graphical interfaces

Description

GMCheckButton is an easy to use toggle button, that acts as a checkbox.

It alternates between being checked and unchecked, and either displays a circle or a square.

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

Class Methods

.new

Creates a new instance of GMCheckButton.

By default, its graphical properties are defined by its associated GMStyle. It uses both outlineColor and outlineSize properties.

Returns:

a GMCheckButton 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.

.toggle

Toggles the button, changing its state and evaluating the associated action.

.toggleDisplay

Toggles the button display, changing its state without evaluating the associated action.

Graphical settings

.displaySymbol

Sets or gets the View's displayed symbol style, and refreshes the View.

Arguments:

aSymbol

The shape of the symbol will be a circle if set as \circle, a square otherwise.

.symbolRatio

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

Internal Methods

.draw

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

Arguments:

aFunction

Examples