vanhoekplugins

  1. 6 weeks ago

    Alfred V

    Jan 9 Pre-Release Testers

    Lexing Plugin version 4.0.0 is available at vanhoekplugins.com.

    MacOS Mojave (macOS 10.14) uses semantic colors, as does windows-10, to adapt to light or dark mode. To set up this LexingControl, that at its base uses colors for syntax highlighting, the plugin defines two additional classes, providing semantic (catalog) colors for light-dark mode awarenesses.

    Setting up the Lexing control in the Xojo IDE is easy. The color types for fore and back colors of text and line numbers, the caret color and other marginView colors in the IDE is replaced as Integer-enumerations as seen by the popups. They indicate the semantic or catalog colors.

    Yet these properties can take colors when cast to a UInt32 data type.

    To support the theme changes, Lexing control comes with two novel events: "ThemeChange() as Boolean" and "ThemeSetup() as Boolean".

    Instead of setting up coloring in the Open event, you should move your code to the ThemeSetup event and call coloring in the ThemeChange event.

    Accompanied with this plugin are two data-type classes, XSColor and its subclass SemanticColor. XSColor is a cross-platform approach, while the SemanticColor type is specific for macOS and windows. While there are other sources, such as CSTrueColors, it would be worth checking out our implementation.

    Given LexingControl with XSColor and SemanticColor, supporting light and dark mode on macOS and high-contrast on windows with the ability to color text in ways you might not imagine, we suggest to download the demo version of this novel plugin. Those who have a license for the previous version can request the upgrade discount.

    Check it out. Development of the LexingControl rested heavily on the creation of the XSColor and SemanticColor classes and the subsequent creation of a sample project that grouped the colors in categories. This helped also in the sublimation of the color type as 0xFFAACCDD into an Integer. LexingControl in the IDE may be a good example of how Xojo controls could be visually improved in design time when it comes to assigning colors, while abandoning the rule to set colors to black to support catalog/named colors.

    Alfred van Hoek

  2. 2 weeks ago

    Alfred V

    Feb 2 Pre-Release Testers

    An updated version is available at vanhoekplugins.com .

    November 2018 - February 2019
    A major overhaul, not necessarily breaking existing code, has been necessary with respect to assigning colors. If one encounters a compiler error “expected color” but got “Integer”, cast the “integer” to a UInt32 type, which is compatible with the type “Color”.

    To provide support to the LexingControl, XSColor data type (now inherits XSColorControl) and its companion SemanticColor (subclass of XSColor) provide a number of shared methods to access the catalog (named) colors that are semantic and change their appearances between dark-mode/high-contrast and light-mode/turned-off-high-contrast.

    These colors are used in the LexingControl as enumerated colors (Integer-type), while in code you can assign any other hard-code colors when cast to the UInt32 type.

    XSColor and SemanticColor, introduced in January 2019, has been expanded by the XSColorControl to provide composite and blending features based on and defined by https://www.w3.org/TR/compositing .

    These are:
    /* Porter-Duff compositing operations */
    /* http://www.w3.org/TR/2014/CR-compositing-1-20140220/#porterduffcompositingoperators */
    XSColorOperationClear,
    XSColorOperationCopy,
    XSColorOperationSourceOver,
    XSColorOperationSourceIn,
    XSColorOperationSourceOut,
    XSColorOperationSourceAtop,
    XSColorOperationDestinationOver,
    XSColorOperationDestinationIn,
    XSColorOperationDestinationOut,
    XSColorOperationDestinationAtop,
    XSColorOperationXOR,
    XSColorOperationPlusDarker,
    XSColorOperationPlusLighter,

    /* Separable blend-modes */
    /* http://www.w3.org/TR/2014/CR-compositing-1-20140220/#blendingseparable */
    XSColorOperationMultiply,
    XSColorOperationScreen,
    XSColorOperationOverlay,
    XSColorOperationDarken,
    XSColorOperationLighten,
    XSColorOperationColorDodge,
    XSColorOperationColorBurn,
    XSColorOperationSoftLight,
    XSColorOperationHardLight,
    XSColorOperationDifference,
    XSColorOperationExclusion,

    /* Non-separable blend-modes */
    /* http://www.w3.org/TR/2014/CR-compositing-1-20140220/#blendingnonseparable */
    XSColorOperationHue,
    XSColorOperationSaturation,
    XSColorOperationColor,
    XSColorOperationLuminosity

    A project based on these features has been developed and comes with the current plugin:

    -image-

    -image-

    LexingControl underwent further improvements and some changes for optimization and look and feel. Documentation still need updates, but the sample projects should provide for the current lack of it.
    To obtain info of the list of classes, controls, properties, methods, enumerations, navigate to the help menu in the Xojo IDE and choose plugins, provided you have installed the plugin in the plugins folder of Xojo.

    The plugin is compatible with macOS 10.12 and higher, macOS 10.14 is recommended (and also in 32-bit mode). The plugin is also high-contrast aware on windows 7 and higher, while windows 10 is recommended. Note that Xojo is currently very limited in displaying its controls on windows-high-contrast, and therefore the new sample project looks quite bad with high-contrast.

  3. Tim J

    Feb 5 Pre-Release Testers, Xojo Pro Dehydrating in AZ

    @Alfred - Your link is taking us to an unconfigured web page...

  4. Alfred V

    Feb 5 Pre-Release Testers

    @Tim J @Alfred - Your link is taking us to an unconfigured web page...

    !@#$%.
    vanhoekplugins

    Thanks

  5. Jeff T

    Feb 5 Midlands of England, Europe

    I feel I should know, but:
    What is it for?

  6. Tim J

    Feb 5 Pre-Release Testers, Xojo Pro Dehydrating in AZ

    Primarily an editor control with syntax color coding. A few other goodies, as well.

  7. Alfred V

    Feb 5 Pre-Release Testers

    @Jeff T I feel I should know, but:
    What is it for?

    The plugin comes with the LexingControl, which is an editor that is different from the usual editors. Usual editors allow for justification of text, but are limited when it comes to create code-editing features.

    LexingControl provide syntax coloring of code for over 100 different languages, allows the display of line numbers and above all provide necessary coloring of words depending on the language used. You can also customize LexingControl by implementing your own way of coloring.

    In addition to LexingControl, and with the advent of dark and light modes for macOS 10.14 (and high-contrast for windows 10), new classes come with the plugin, specifically designed to let colors change when the appearance of a windows or macOS is changed at the system level. Hard-coded colors have become something of the past. They now should be defined as semantic colors. XSColor and its companions provide these semantic colors primarily for use with the LexingControl, but can easily be used for other purposes at your liking.

    Checkout two projects that comes with the plugin that don't use the LexingControl.

or Sign Up to reply!