![]() |
RTView®
User Guide |
Creating Style Sheets Style sheets allow you to set the values for object properties in your displays from one or more external (.rts) files. You can choose from a number of built-in style sheets or create your own. NOTE: Style sheet file names must use a .rts extension. NOTE: File names starting with rtv_ are reserved for SL use only. The syntax of .rts style sheet is very similar to that of a .css file:
styleClassName { propertyName:propertyValue; propertyName2:propertyValue2; }
styleClassName2 { propertyName:propertyValue; }
styleClassName3,styleClassName4,styleClassName5 { propertyName:propertyValue; }
If a property value contains any of the following characters, the entire value must be enclosed in quotations:
obj_bargraph { barProperties:"228,;46,;53,;101,;118,;161,;18,";
} To add a comment to your style sheet, start the line with a #. For example:
Style Class Names For example, look at style values set on an object from the General tab with the object class name obj_rect_il:
To apply a variety of styles to different instances of the same object class, edit the object's styleClass property in the Object Properties dialog. The value entered for styleClass must not contain spaces and must not start with rtv-. For example, suppose you want a few instances of the obj_rect_il to have a different background (bgColor). For those objects, you can enter a styleClass value of specialRect and add it to your style sheet as follows:
Style Groups
If an object is in one or more style groups, styles are applied in order of the most specific reference. For example, suppose you have a bar graph with the styleClassName set to special_bar.
If the same styleClassName or style group is specified more than once, or appears in more than one style sheet, the properties are merged. If the same property on the same object is specified more than once, the last reference takes precedence. For example, the following two style sheets end up applying the same style:
Object Properties Some object properties are only available if others are selected. For example, bgColor is only available if the bgVisFlag checkbox is selected. When including properties like this in a style sheet, always include the controlling property (bgVisFlag) before the dependent property (bgColor). The following Object Properties are not supported in style sheets: - anchor - command - commandCloseWindowOnSuccess - commandConfirm - commandConfirmText - dock - drillDownTarget - historyTableName - historyTableRowNameFlag - objName - objX - objY - styleClassName - varToSet - all properties in the Composite category on the composite object (i.e. obj_composite) Many property values are not formatted in style sheets as they are displayed in the Object Property list or require a dialog in the Display Builder to configure. To determine the correct method of formatting of a property value within a style sheet, do one of the following: 1. For color properties, add the object in the Display Builder and edit the selected color property. In the Color Dialog, hover the mouse over the color you want to use to see the tool tip. The first item in the tool tip is the color index number. This color index number should be used in the style sheet. For example if you hover over the first color (white), you will see it's index number is 0. Use a value of 0 to specify white. 2. For properties where the Display Builder presents a list of options, such as bgGradientMode, add the object in the Display Builder and edit the selected property. The list will show the index number as well as the option, as follows: 0 - None 1 - Diagonal Edge 2 - Diagonal Center 3 - Horizontal Edge 4 - Horizontal Center 5 - Vertical Edge 6 - Vertical Center The index number listed should be used in the style sheet. For example, use a value of 1 to specify a Diagonal Edge on the bgGradientMode property. NOTE: If the list does not show an index number, use the text value from the list. 3. For properties where the Display Builder presents a dialog, add the object in the Display Builder and edit the selected property. Use the dialog to configure the property the way that you want it in your style sheet. Click OK to close the dialog, then select the text from the Property Value field in the Object Properties dialog and copy (Ctrl+C ). For example if you select to edit barProperties on the Bar Graph, a dialog will open. If you choose white with the first fill pattern for the first bar and click OK, the Property Value field will contain the following text: 0,1;;;;;;. Paste this value into your style sheet. 4. For properties where the Display Builder presents a checkbox, use 0 for false (deselected) and 1 for true (selected). 5. For properties where the Display Builder allows you to type in a value, enter the same value in your style sheet. 6. For properties that end in Height or Width that are specified in the Display Builder as pixels, but stored using internal coordinates, divide the pixel value by 8. The following properties are exceptions to this rule: a. If a Width property name includes one of the following, do NOT divide by 8:
b. If a Height property name includes the following, do NOT divide by 8:
|
|
|
|