SetWebTheme Method (RUNTIME)


PLB Web Only, 10.6

 

The SetWebTheme method alters the default runtime settings that are applied to give specific web object visual styles. The visual styles are achieved by applying HTML with CSS classes to PL/B web objects using jQueryUI themes and BootStrap 5 styles. The overall affect is to provide consistent PL/B web object visual presentations with minimal user program logic. This method uses the following format:

 

[label]

{object}.SetWebTheme

[GIVING {return}] USING [*Theme=]{theme}[:

 

 

[*Context=]{context}][:

 

 

[*Options=]{options}

 

Where:

label

Optional. A Program Execution Label.

object

Required. A RUNTIME object.

return

Optional. A Numeric Variable that receives the method result.

theme

Optional. A Numeric Variable or decimal number that specifies the jQuery theme number used as default.

context

Required. A Numeric Variable or decimal number that specifies the BootStrap 5 context number used as default.

options

Optional. A Numeric variable or decimal number that specifies a bit mask value where each bit can invoke special method behaviors.

Flags Affected: EOS, OVER, ZERO

Note the following:

  1. This method dynamically changes the HTML classes. Each class in the class string must be separated by a space.

  2. The EOS and OVER flags are always cleared.

  3. The ZERO flag is always set to TRUE with a return value of zero.

  4. The {theme} only replaces colors that are set to the default. A non-default background, text, or border color is not changed.

  5. The {theme} values are as follows:

  6.  

    Value

    JQueryUI Theme Name

    0

    Default or Base

    1

    Black Tie

    2

    Blitzer

    3

    Cupertino

    4

    Dark Hive

    5

    Dot Luv

    6

    Eggplant

    7

    Excite Blue

    8

    Flick

    9

    Hot Sneaks

    10

    Humanity

    11

    Le Frog

    12

    Mint Choc

    13

    Overcast

    14

    Pepper Grinder

    15

    Redmond

    16

    Smoothness

    17

    South Street

    18

    Start

    19

    Sunny

    20

    Swanky Purse

    21

    Trontastic

    22

    UI Darkness

    23

    UI Lightness

    24

    Vader

     

  7. See this JQuery UI link under 'Gallery' to see an example of the themes:

  8. https://jqueryui.com/themeroller

  9. The {context} values are defined as follows and the definitions are found in the 'plbequ.inc':

  10.  

    Value

    Keyword

    0

     $OC_DEFAULT

    1

    $OC_DANGER

    2

    $OC_DARK

    3

    $OC_INFO

    4

    $OC_LIGHT

    5

    $OC_PRIMARY

    6

    $OC_SECONDARY

    7

    $OC_SUCCESS

    8

    $OC_WARNING

     

  11. See these links for more information on context presentations:

  12. https://getbootstrap.com/docs/5.0/components/list-group /#contextual-classes

     

    https://getbootstrap.com/docs/5.0/components/buttons/

     

  13. The {options} bit mask values are defined as follows:

 

Value

Keyword

This option bit value ...

0x1

$BS5_OPTION_GRADIENT

allows the runtime to apply the BootStrap 5 'bg-gradient' classes to the PL/B web objects to enhance the background color visual styles. See this link for more information:

https://getbootstrap.com/docs/5.0/utilities/background/#background-gradient

0x2

$BS5_OPTION_PROGRESS

allows the runtime to apply a BootStrap 5 style to the PL/B PROGRESS web objects.

0x4

$BS5_OPTION_NO_WINBORDER

converts all WINDOW WINTYPEs of $FIXEDSINGLE or $FIXED3D to $NOBORDER on a PL/B Web Server.

Examples when using PL/B Web Objects:

 

Run RUNTIME

.

. Enable the BootStrap 5 Gradient and Progress options

.

        Run.SetWebTheme USING Options=3

.

       .... Load program with PL/B Web objects

.

. Set/Change the program theme as desired/needed.

 .

       Run.SetWebTheme USING *CONTEXT=$OC_PRIMARY:

                       *THEME=19 //Sunny theme

 

 

See Also: RUNTIME, RUNTIME Methods, Method Syntax

 



PL/B Language Reference SetFileTimes Method (RUNTIME) SignalChild Method (RUNTIME)