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

GMStyle
ExtensionExtension

A palette class to apply styles to the Graphical Module's widgets

Description

GMStyle is a placeholder for widgets visual properties specifications, when using the Graphical Module Quark.

It allows to specify colors, border sizes, etc, and to apply those specifications to several widgets at once. Once a style is applied to a widget, modifying the style will update the widget automatically.

There will always be a default style accessible using GMStyle.default. This default style will be applied to any Graphical Module widget until a new style is applied to the widget.

Please note that every widget has different drawings needs, and is unlikely to use every GMStyle parameter. For example, a GMFaderSlider do not use the outlineSize parameter.

Class Methods

.new

Creates a new instance of GMStyle.

.default

Sets or gets the default instance of GMStyle, which is applied to all widgets by default when they are created. If you do not plan to use more than one style, you can use this instance instead of creating your own.

Setting a new default style won't apply the new style to previously created widgets which are tied to the precedent default style, which is likely to prevent their visual modification.

Returns:

the default GMStyle instance.

Instance Methods

.borderSize

Sets or gets the outer border size, in pixels.

.secondBorderSize

Sets or gets the middle border size, in pixels.

.thirdBorderSize

Sets or gets the inner border size, in pixels.

.borderColor

Sets or gets the outer border color.

.secondBorderColor

Sets or gets the middle border color.

.thirdBorderColor

Sets or gets the inner border color.

.mainColor

Sets or gets the style's main color. This color is usually used to highlight the relevant information inside a widget, and should contrast with other colors.

.secondColor

Sets or gets the style's second color. This color is usually used to display informations that are not as relevant as the ones highlighted with the mainColor.

.backColor

Sets or gets the style's back color. This color is usually used to fill irrelevant part of the widget, such as frames backgrounds.

.backgroundColor

Sets or gets the style's background color. This color is usually used to fill the widgets background.

.outlineSize

Sets or gets the width of every drawn line.

.outlineColor

Sets or gets the color of every drawn line.

.beatColor

Sets or gets the color associated to the notion of 'current beat'. This is used by rythm widgets to display which beat is currently playing.

.disabledColor

Sets or gets the color of disabled widgets.

.selectedColor

Sets or gets the color of selected widgets.

.selectedColor

Sets or gets the helpers color.

.font

Sets or gets the style's font.

.fontColor

Sets or gets the style's font color.

.fontColorDisabled

Sets or gets the style's font color for disabled widgets.

.valueFontColor

Sets or gets the font color used to display values on widget such as sliders.

.highlightColor

Sets or gets the reference color used to display beat helpers.

Internal Methods

.addListener

.removeListener

.refreshListeners

Examples

Use the style method of a widget to apply your newly created style :

You can also modify the default style to prototype quickly :

Here's a template code creating a new GMStyle, assigning values to it, and returning it. You can save it as a file inside your project, and use this.executeFile() to load it automatically :