Movicon Help on Line - Rel. 11.7.1301
The Style Sources in Symbols allow you to activate specific graphical styles for objects on screens based on a style source. In this way, the object will be able to inherit a style at runtime, which was previously defined by the programmer, independently from the one associated to the object in design mode. The Style Source Container can be activated by the logged in user from the active language or from a style source screen. This management allows specific graphical aspects of screens and their object contents to be changed when the project is in runtime mode. The properties which can be edited are:
background color
text and edge color
font
The style sources are acquired by a screen and by the objects it contains and acts as a style container. This container is not displayed at runtime due to the fact that it is only a source container. The controls placed on this screen will function as style generators. Each object from the style source screen will be a style source for the objects belonging to its category. Only the first control in the tab order for each object type will be considered and become the style source. For example, when inserting several display objects in the style container screen, only the first one in tab order will act as the style source.
Even though some objects in the same category are graphically different compared to the others that belong in their category, they will still inherit all the styles of the same source object.
The table below shows which categories the objects are grouped in:
Source Category |
Object |
basic |
"Basic Shapes" Category:
|
poly |
"Basic Shapes" Category:
|
Button |
"Buttons-Lights-Switches" Category:
"Advanced shapes":
|
Gauge |
"Sliders-Gauges-Meters-Displays":
|
Trend |
"Trends-Charts-Data Analysis" Category:
|
Chart |
"Trends-Charts-Data Analysis" Category:
|
GridBox |
"Advanced Shapes" Category:
|
ListBox |
"Advanced Shapes" Category
|
EmbView |
"Advanced Shapes" Category:
|
Edit |
"Advanced Shapes" Category:
|
TabObj |
"Advanced Shapes" Category
|
AlarmWnd |
"Advanced Shapes" Category:
|
HisLogWnd |
"Advanced Shapes" Category:
|
DLRWnd |
"Advanced Shapes" Category:
|
TraceDBWnd |
"Advanced Shapes" Category:
|
HourSelector |
"Advanced Shapes" Category:
|
IPCamera |
"Advanced Shapes" Category:
|
Style updates are only applied at Runtime. Therefore, symbols whose styles are edited will show with their original properties in design mode. Movicon will only apply modifications at Runtime. |
Using Style Sources
In order to manage the style references in symbols, you will need to follow the four steps when in design mode:
Create one or more style source screens to place source objects in.
Set the properties of style source objects ("background Color", "Edge-Text Color ", and "Text Font") and eventually of the screen ("Back Color") as required. These properties are those which will be propagated as style sources for the other symbols of the project.
The style source screen name must be inserted in the screen's, user's, user group's or string table language column's "Style Source Container" property. By doing this, the style source of the resource active at that moment will activate according to priority described below.
Enable the properties of the project's objects ("Style Source Back Color", Style Source Edge-Text Color" Style Source Font) and of eventual screens ("Back Color") which must inherit the styles in question from the style source screen.
For instance the three properties below are available for each object that can be placed on screen. When these properties are enabled, they will allow the object to inherit the style from the style source screen:
Style Source Back Color
Style Source Edge-Text Color
Style Source Font
However, a screen can only inherit a back color style as it only has the one property available to do this:
Style Source Back Color
When the style container source is active at runtime, a check will be run on all the screens loaded and any object that has been enabled with style properties will be modified to match the styles set in the source object. The style source can be activated in different modes. The style source activation procedure comes in order of priority as follows: when a screen is loaded, a check will be run for any style source container screens that have been assigned to the active user. If none have been assigned, the same check will be run on the user group which the active user belongs to. If none are found, another check will be run on to whether there is a style source screen for the currently active language. If this results futile, a final check will be run to verify whether a style source container screen has been assigned to the loaded screen, itself.
Style source containers are assigned to users, user groups, languages or screens by using the "Style Container Source" which is available in each one of these resources.
When more than one resource has been assigned a Style Resource Container screen, the active style source will be considered by in the priority order described above. If, for instance, a user is active and has been assigned a style resource container screen, this screen will be used as the style's source. When the user logs off, the style source container screen will then be used by the currently active language if enabled to do so. Otherwise, it will be used by the active screen if enabled to do so. If no other style resource screen is activated, the last style loaded will remain active.
The style source is acquired by screens and the objects they contain not only in the screen loading phase but also after they have been loaded. Therefore, when opening a screen, its objects may have a certain graphical aspect that may change to another type if a user, who has been assigned with a different style source container screen, logs in.
Once the project is running in runtime mode, the styles of the objects in the style source container window can be modified using the "DrawCmdTarget" basic script functions. When doing this, all the modifications will be inherited by the objects which use the style source container window in the project. |
Assigning the actual screen as its "Style Source Container" in project design mode will generate the following error in the log file: "Cannot find the Style Symbols resource container 'Screen1" |
Only the colors from the back ("Back" property) and edge-text (Edge-Text property) are inherited. The colors inherent to other properties, such as the Alarm Window Log colors or the Gauge Warning Zone, are not inherited by the styles management. |