WEBSTYLE Property
PLBCMP GUI Only, 10.7
The WEBSTYLE property allows multiple HTML inline styles to be applied to a Web Object when the object is created. This property also allows a variety of HTML inline styles to be applied when PL/B Web objects are created using PLF and PWF forms. The property uses the following format:
WEBSTYLE={style}
Note the following:
WEBSTYLE may be used in CREATE, SETPROP or GETPROP statements.
This property only takes affect when it is used in the CREATE statement. Once created, the mode remains in effect until the object is destroyed. The SETPROP stores the WEBSTYLE string data but the HTML inline styles do not take immediate affect The GETPROP returns the last WEBSTYLE string stored for the Web Object.
When the WEBSTYLE inline styles are applied by a CREATE operation, the actual interpretation and presentation of the Web object is strictly controlled by the web browser engine being used. Beware, the final presentation may have some style conflict(s) that cause unexpected results. In some cases, the 'CSS The !important Rule' can be used to elevate the inline style to force its usage.
Example of HTML inline style using '!important'
The {style} is a literal or character variable containing one or more attributes formatted as expected for HTML inline styles. The {style} string is formatted the same as expected for the 'HTML style Attributes' where each style definition is described as follows:
Style_Definitions: One or more CSS properties and separated by semicolons. (e.g. style="color:blue;text-align:center")
See the following links for more format details: https://www.w3schools.com/html/html_css.asp
Understanding HTML Styles including inline styles: https://www.w3schools.com/html/html_styles.asp
Setting the style of an HTML element: https://www.w3schools.com/TAGS/att_global_style.asp
Using style attribute definition and usage: https://www.w3schools.com/css/css_important.asp
Description of 'CSS The !important Rule'.
Example PL/B WebStyle property string using CREATE:
|
Win |
WINDOW |
|
|
nVar |
FORM |
2 |
|
ButtonWv |
BUTTON |
|
|
bStyle |
INIT |
"color:red;": |
|
|
|
"text-align:center;": |
|
|
|
"border: 3px solid forestgreen;" |
|
. |
|
|
|
|
WINHIDE |
|
|
|
SETMODE |
*WEBMODEPLF=3 |
|
|
CREATE |
WIN=50:400:50:400, WEBOBJECT=1 |
|
. |
|
|
|
|
CREATE |
Win;ButtonWv=50:80:50:150: |
|
|
|
"Exit": |
|
|
|
WEBOBJECT=1: |
|
|
|
WEBSTYLE=bStyle //Inline style |
|
|
ACTIVATE |
ButtonWv,Exit,nVar |
|
. |
|
|
|
|
SETPROP |
WIN, VISIBLE=1 |
|
. |
|
|
|
|
LOOP |
|
|
|
WAITEVENT |
|
|
|
REPEAT |
|
|
. |
|
|
|
Exit |
|
|
|
|
STOP |
|
When using the PL/B 'designer', set the WebStyle property for a Web object by specifying the HTML inline style parameters.
Example of designer WebStyle property string:
See Also: Object Properties, Object IO Instructions, Object Definitions
![]() |