Skip to content

XUICETheme

Description

One of the the most powerful features offered by the XUICodeEditor is the ability to customise its appearance. This is done through themes that are represented by the XUICETheme class.

Properties

Name Type Read-Only
Author String
AutocompleteHorizontalPadding Integer
AutocompleteOptionColor ColorGroup
AutocompleteOptionVerticalPadding Integer
AutocompletePopupBackgroundColor ColorGroup
AutocompletePopupBorderColor ColorGroup
AutocompletePopupBorderRadius Integer
AutocompletePrefixStyle XUICETokenStyle
AutocompleteVerticalPadding Integer
BackgroundColor ColorGroup
BlockLineColor ColorGroup
CaretColor ColorGroup
CurrentLineHighlightColor ColorGroup
CurrentLineNumberColor ColorGroup
DefaultStyle XUICETokenStyle
DelimitersBorderColor ColorGroup
DelimitersFillColor ColorGroup
DelimitersHaveBorder Boolean
DelimitersHaveFillColor Boolean
DelimitersHaveUnderline Boolean
DelimitersUnderlineColor ColorGroup
Description String
HasAutocompletePopupBorder Boolean
LineNumberColor ColorGroup
Name String
ScrollbarBackgroundColor ColorGroup
ScrollbarBorderColor ColorGroup
ScrollbarThumbColor ColorGroup
SelectedAutocompleteOptionBackgroundColor ColorGroup
SelectedAutocompleteOptionColor ColorGroup
SelectionColor ColorGroup
Styles Dictionary
UnmatchedBlockLineColor ColorGroup
Version XUISemanticVersion

Methods

Name Parameters Returns
AddTokenStyle styleName As String, style As XUICETokenStyle
AssertIsTokenDictionary d As Dictionary
AssertPathType d As Dictionary, path As String, type As String
AssertValidThemeDictionary d As Dictionary
Constructor
CreateTheme d As Dictionary XUICETheme
FromFile f As FolderItem XUICETheme
RemoveTokenStyle styleName As String Boolean
StyleForName styleName As String XUICETokenStyle
StyleForToken token As XUICELineToken XUICETokenStyle
StyleNames String()
ToTOML String

Constants

Name Type
DEFAULT_BLOCK_LINE_COLOR_LIGHT Color
DEFAULT_CURRENT_LINE_HIGHLIGHT_COLOR_DARK Color
DEFAULT_CURRENT_LINE_HIGHLIGHT_COLOR_LIGHT Color
DEFAULT_UNMATCHED_BLOCK_LINE_COLOR_DARK Color
DEFAULT_UNMATCHED_BLOCK_LINE_COLOR_LIGHT Color
TYPE_ARRAY String
TYPE_BOOLEAN String
TYPE_COLOR String
TYPE_COLORGROUP String
TYPE_DATETIME String
TYPE_DICTIONARY String
TYPE_DOUBLE String
TYPE_INTEGER String
TYPE_NIL String
TYPE_STRING String

DEFAULT_BLOCK_LINE_COLOR_LIGHT As Color The light mode default colour for block lines if none is provided by the theme.


DEFAULT_CURRENT_LINE_HIGHLIGHT_COLOR_DARK As Color The dark mode default colour for the current line highlight if none is provided by the theme.


DEFAULT_CURRENT_LINE_HIGHLIGHT_COLOR_LIGHT As Color The light mode default colour for the current line highlight if none is provided by the theme.


DEFAULT_UNMATCHED_BLOCK_LINE_COLOR_DARK As Color The dark mode default colour for unmatched block lines if none is provided by the theme.


DEFAULT_UNMATCHED_BLOCK_LINE_COLOR_LIGHT As Color The light mode default colour for unmatched block lines if none is provided by the theme.


TYPE_ARRAY As String Internally used when asserting if a theme is valid.


TYPE_BOOLEAN As String Internally used when asserting if a theme is valid.


TYPE_COLOR As String Internally used when asserting if a theme is valid.


TYPE_COLORGROUP As String Internally used when asserting if a theme is valid.


TYPE_DATETIME As String Internally used when asserting if a theme is valid.


TYPE_DICTIONARY As String Internally used when asserting if a theme is valid.


TYPE_DOUBLE As String Internally used when asserting if a theme is valid.


TYPE_INTEGER As String Internally used when asserting if a theme is valid.


TYPE_NIL As String Internally used when asserting if a theme is valid.


TYPE_STRING As String Internally used when asserting if a theme is valid.


Property Descriptions

Author As String

The name of this theme's author.


AutocompleteHorizontalPadding As Integer

The number of pixels to pad to the left and right of autocomplete options in the autocomplete popup.


AutocompleteOptionColor As ColorGroup

The colour of the text of unselected options in the autocomplete popup.


AutocompleteOptionVerticalPadding As Integer

The number of pixels to pad above and below autocomplete options in the autocomplete popup.


AutocompletePopupBackgroundColor As ColorGroup

The colour to use for the background of the autocomplete popup.


AutocompletePopupBorderColor As ColorGroup

If the autocomplete popup has a border then this is its colour.


AutocompletePopupBorderRadius As Integer

The border radius of the autocomplete popup.


AutocompletePrefixStyle As XUICETokenStyle

The style to use for the autocompletion prefix.


AutocompleteVerticalPadding As Integer

The number of pixels to pad above the first and below the last autocomplete options in the autocomplete popup.


BackgroundColor As ColorGroup

The colour to use for the editor's background.


BlockLineColor As ColorGroup

The colour to use for block lines.


CaretColor As ColorGroup

The colour of the editor's caret.


CurrentLineHighlightColor As ColorGroup

The colour to use to highlight the current line in the editor (if enabled).


CurrentLineNumberColor As ColorGroup

The colour of the line number of the current line.


DefaultStyle As XUICETokenStyle

The default token style.


DelimitersBorderColor As ColorGroup

If drawing current delimiters and DelimitersHaveBorderColor = True` then this is the colour of their border.


DelimitersFillColor As ColorGroup

If drawing current delimiters and DelimitersHaveFillColor = True then this is the colour their background will be.


DelimitersHaveBorder As Boolean

If True then when the current delimiters are drawn they should have a border of color DelimitersBorderColor.


DelimitersHaveFillColor As Boolean

If True then when drawing the current delimiters, they should have a background fill color of DelimitersFillColor.


DelimitersHaveUnderline As Boolean

If True then when the current delimiters are drawn they should be underlined with DelimitersUnderlineColor.


DelimitersUnderlineColor As ColorGroup

If drawing current delimiters and DelimitersHaveUnderline = True` then this is the colour of the underline.


Description As String

A description of this theme.


HasAutocompletePopupBorder As Boolean

True if the autocomplete popup has a border.


LineNumberColor As ColorGroup

The colour of the line numbers.


Name As String

This theme's name.


ScrollbarBackgroundColor As ColorGroup

The colour of the background of the scrollbar track. Only relevant on Windows and Linux.


ScrollbarBorderColor As ColorGroup

The colour of the border of the scrollbar track. Only relevant on Windows and Linux.


ScrollbarThumbColor As ColorGroup

The colour of the thumb of the scrollbar track. Only relevant on Windows and Linux.


SelectedAutocompleteOptionBackgroundColor As ColorGroup

The background colour for the currently selected option in the autocomplete popup.


SelectedAutocompleteOptionColor As ColorGroup

The colour of the text of the currently selected option in the autocomplete popup.


SelectionColor As ColorGroup

The colour to use for the background of selected text.


Styles As Dictionary

This theme's styles. Key = Style name, Value = MCETokenStyle.


UnmatchedBlockLineColor As ColorGroup

The colour to use for block lines that are unmatched.


Version As XUISemanticVersion

This theme's version.


Method Descriptions

AddTokenStyle(styleName As String, style As XUICETokenStyle)

Adds a token style to this theme.

Assumes styleName is not empty and style is not Nil.


AssertIsTokenDictionary(d As Dictionary) This method is shared.

Asserts that d is a valid token dictionary. Raises an InvalidArgumentException if it's not.


AssertPathType(d As Dictionary, path As String, type As String) This method is shared.

Asserts that d contains path and the terminal key of path is the correct type. Raises an InvalidArgumentException if not.


AssertValidThemeDictionary(d As Dictionary) This method is shared.

Asserts that d contains the required properties for a valid theme. Raises an InvalidArgumentException if not.


Constructor()

Default constructor.


CreateTheme(d As Dictionary) As XUICETheme This method is shared.

Returns a theme constructed from a validated theme dictionary d.

Assumes that d has already been validated using AssertValidThemeDictionary.


FromFile(f As FolderItem) As XUICETheme This method is shared.

Loads a theme from a TOML theme file.


RemoveTokenStyle(styleName As String) As Boolean

Removes the style styleName from this theme if it exists. Returns True if successful or False if there is not style with that name.


StyleForName(styleName As String) As XUICETokenStyle

Returns the style with the specified name or Nil if it doesn't exist.


StyleForToken(token As XUICELineToken) As XUICETokenStyle

Returns the style to use for the passed token type.

If the requested primary style is not found then we try the fallback style. If that's not found we return the default style.


StyleNames() As String()

Returns an array of all the styles defined in this theme.


ToTOML() As String

Converts this theme to TOML that can be written to disk.