Template

 

Remarks Properties Methods DynProperties Samples

ED
avaliable
RT
avaliable

Remarks:Top

The template contains general information on the outer appearance of the pictures. Each picture is linked to a template. The VBA object for the templates contains the most important information, e.g. name and position on the screen.

Properties:Top

BackgroundColor BackgroundImage BackgroundImageStyle
BorderStyle Bottom Left
Name Parent RelativePos
Right ShowForeground ShowMinimize
ShowSysMenu ShowTitle Style
Top    

Methods:Top

CheckIn CheckOut Copy
DynPropertiesEnum[GET] DynProperties[GET] DynProperties[PUT]
Export Get Import
IsCheckedOut IsDifferent IsLocked
Save UndoCheckOut  

DynProperties:Top

Name Type Description
AltPixelHorz Long

Horizontal movement [pixel]

Only active if you select relative to the element at Positioning.

By entering a positive or negative numerical value, you can move the alternative reference point horizontally.

Default: 2

More in the online help

AltPixelVert Long

Vertical movement [pixel]

Only active if you select relative to the element at Positioning.

By entering a positive or negative numerical value, you can move the alternative reference point vertically.

Default: 2

More in the online help

AltPosHorz Long

Horizontal

Only active if you select relative to the element at Positioning.

Select the desired alternative reference point at the element from the dropdown list. The alternative reference point will be used if it is not possible to position the template at the preferred reference point when loading the template. Choose between left or right.

Default: Left

More in the online help

AltPosVert Long

Vertical

Only active if you select relative to the element at Positioning.

Select the desired alternative reference point at the element from the dropdown list. The alternative reference point will be used if it is not possible to position the template at the preferred reference point when loading the template. Choose between top or bottom.

Default: top

More in the online help

AltRefHorz Long

Alternative horizontal

Only active if you select relative to the element at Positioning.

Select the desired alternative reference point for the template from the dropdown list. The alternative reference point will be used if it is not possible to position the template at the preferred reference point when loading the template. Choose between left, right or centered.

Default: Left

More in the online help

AltRefVert Long

Alternative vertical

Only active if you select relative to the element at Positioning.

Select the desired alternative reference point for the template from the dropdown list. The alternative reference point will be used if it is not possible to position the template at the preferred reference point when loading the template. Choose between top, bottom or centered.

Default: top

More in the online help

BackgroundColor ZT_COLOR

Background color

Background color as default for all pictures based on this template.

Read more in the online manual

BackgroundPicture ZT_FILE

Graphics file

Selection of the background picture as default for all pictures based on this template.

ATTENTION: Only pictures added to the project under "Files/Graphics" are available.

Read more in the online manual

BackgroundPictureStyle Long

Alignment

Only available, after a picture has been selected:
Display type of the background picture:
normal: original bitmap size in the top left corner.
centered: original bitmap size in the center.
stretched: bitmap size streched to the size of the picture.
tiled: original bitmap size in tiles.
Default: normal.

Read more in the online manual

BorderStyle Long

Border type

Border style of the picture.
Bold frame: Display a bold frame around the picture. The size of the picture can be chnaged in the Runtime.
No frame: No frame is displayed.
Thin frame: Display a thin frame around the picture.
Default: No frame.

Read more in the online manual

CloseOnClickOutside Boolean

Close after losing focus

Controls the behavior of the template when losing focus. If you click next to the template, it will automatically close.

Active: The template is closed if you left-click next to it.

Default: inactive

PixelHorz Long

Horizontal movement [pixel]

Only active if you select relative to the element at Positioning.

By entering a positive or negative numerical value, you can move the reference point horizontally.

Default: 2

More in the online help

PixelVert Long

Vertical movement [pixel]

Only active if you select relative to the element at Positioning.

By entering a positive or negative numerical value, you can move the reference point vertically.

Default: 2

More in the online help

PosBottom Long

Bottom [pixels]

Y coordinate of the bottom right corner of the template in pixels (referring to the current screen resolution).
Minimum: -2147483648.
Maximum: 2147483647.
Default: Maximum of current screen resolution.

ATTENTION: We recommend to define templates not larger than 32000*32000 pixels to avoid graphical problems.

Read more in the online manual

PosHorz Long

Horizontal

Only active if you select relative to the element at Positioning.

Select the desired reference point at the element from the dropdown list. When the template is loaded, this reference point will be considered. Choose between left or right.

Default: Left

More in the online help

PosLeft Long

Left [pixels]

X coordinate of the top left corner of the template in pixels (referring to the current screen resolution).
Minimum: -2147483648.
Maximum: 2147483647.
Default: 0.

ATTENTION: We recommend to define templates not larger than 32000*32000 pixels to avoid graphical problems.

Read more in the online manual

PosRight Long

Right [pixels]

X coordinate of the bottom right corner of the template in pixels (referring to the current screen resolution).
Minimum: -2147483648.
Maximum: 2147483647.
Default: Maximum of current screen resolution.

ATTENTION: We recommend to define templates not larger than 32000*32000 pixels to avoid graphical problems.

Read more in the online manual

PosTop Long

Top [pixels]

Y coordinate of the top left corner of the template in pixels (referring to the current screen resolution).
Minimum: -2147483648.
Maximum: 2147483647.
Default: 0.

ATTENTION: We recommend to define templates not larger than 32000*32000 pixels to avoid graphical problems.

Read more in the online manual

PosType Long

Positioning

Determines the position of the template (of the pictures based on it) in the Runtime. This feature is especially useful for keyboard windows and popup windows: You can place pictures at the exact location of the mouse pointer or the element, from which the picture is loaded. You can choose from the following locations for placing the template during Runtime:

use absolute position: Positions the template at the coordinates defined in Position.

relative to the mouse pointer: The picture is placed in relation to the reference point of the template. The reference point of the template is positioned at the current location of the mouse pointer. You can define the reference point in Reference point of template. The reference point is marked as a red dot in the template editor. Example: If the reference point is at the top left side, the template will be loaded to the bottom right side of the reference point.
If the picture cannot be displayed completely at the configured position, the position will be moved until the complete picture is inside the displayed area of the screen.

relative to the element: Positions the reference point of the template relative to the element, from which the picture switch was initiated (e.g. a button or a combined element). Here you can define both the reference point of the template (in Reference point of template) and the reference point of the element (in Reference point of element) including the distances to the element. The reference point of the template will always be placed on the calculated reference point of the element in the Runtime.
If the template cannot be loaded at that position, because that would place the picture outside of the visible screen, the alternative reference points will be used. You can configure alternative reference points for the template in Reference point of template and for the element in Alternative reference point of element.
Example: you have a button at the right border of the screen and try to position a popup window on its right side: reference point of element: right/centered; reference point of template: left/centered. In the Runtime, the popup window will appear on the right side of the button, centered to the middle of the button. The popup window will not cover the button.
You use the same template also for a button on the left screen border. There may not be enough room on the right side to completely display the popup window. Therefore, the alternative position will be used. For this, you have to set the alternative reference point for the element to: left/centered and the alternative reference point of the template to right/centered.

Default: use absolute position

More in the online help

PosVert Long

Vertical

Only active if you select relative to the element at Positioning.

Select the desired reference point at the element from the dropdown list. When the template is loaded, this reference point will be considered. Choose between top or bottom.

Default: top

More in the online help

RefHorz Long

Horizontal

Only active if you select relative to element or relative to mouse pointer at Positioning.

Select the desired reference point for the template from the dropdown list. Choose between left, right or centered.

Default: Left

More in the online help

RefVert Long

Vertical

Only active if you select relative to element or relative to mouse pointer at Positioning.

Select the desired reference point for the template from the dropdown list. Choose between top, bottom or centered.

Default: top

More in the online help

ShowForeground Boolean

Always in the foreground

Active: No other picture overlaps this area in online operation. Pictures in the background can still be operated.
Inactive: Pictures of this template can be overlaped by other pictures.
Default: inactive.

Read more in the online manual

ShowMinimize Boolean

Min/Max Buttons

Only available, if the title is active:
Active: Display Windows symbol field in the title bar.
Inactive: Display no symbol field.
Default: inactive.

Read more in the online manual

ShowSysMenu Boolean

System menu

Only available, if the title is active:
Active: Display Windows system menu in the title bar.
Inactive: No system menu is displayed.
Default: inactive.

Read more in the online manual

ShowTitle Boolean

Title

Only available, if a frame is active for the template:
Active: Display Windows title bars for the pictures of this template. The pictures can be moved in the Runtime.
Inactive: Display no title bar.
Default: inactive.

Read more in the online manual

Style Long Window style
TemplateName String

Name

Unique name of the template.
Default: Template_x (where x is a consecutive number).
Maximum: 30 characters.

ATTENTION: This property is not available for language switching.

Read more in the online manual

   

Top

Name Type Description
AltPixelHorz Long

Horizontal movement [pixel]

Only active if you select relative to the element at Positioning.

By entering a positive or negative numerical value, you can move the alternative reference point horizontally.

Default: 2

More in the online help

AltPixelVert Long

Vertical movement [pixel]

Only active if you select relative to the element at Positioning.

By entering a positive or negative numerical value, you can move the alternative reference point vertically.

Default: 2

More in the online help

AltPosHorz Long

Horizontal

Only active if you select relative to the element at Positioning.

Select the desired alternative reference point at the element from the dropdown list. The alternative reference point will be used if it is not possible to position the template at the preferred reference point when loading the template. Choose between left or right.

Default: Left

More in the online help

AltPosVert Long

Vertical

Only active if you select relative to the element at Positioning.

Select the desired alternative reference point at the element from the dropdown list. The alternative reference point will be used if it is not possible to position the template at the preferred reference point when loading the template. Choose between top or bottom.

Default: top

More in the online help

AltRefHorz Long

Alternative horizontal

Only active if you select relative to the element at Positioning.

Select the desired alternative reference point for the template from the dropdown list. The alternative reference point will be used if it is not possible to position the template at the preferred reference point when loading the template. Choose between left, right or centered.

Default: Left

More in the online help

AltRefVert Long

Alternative vertical

Only active if you select relative to the element at Positioning.

Select the desired alternative reference point for the template from the dropdown list. The alternative reference point will be used if it is not possible to position the template at the preferred reference point when loading the template. Choose between top, bottom or centered.

Default: top

More in the online help

BackgroundColor ZT_COLOR

Background color

Background color as default for all pictures based on this template.

Read more in the online manual

BackgroundPicture ZT_FILE

Graphics file

Selection of the background picture as default for all pictures based on this template.

ATTENTION: Only pictures added to the project under "Files/Graphics" are available.

Read more in the online manual

BackgroundPictureStyle Long

Alignment

Only available, after a picture has been selected:
Display type of the background picture:
normal: original bitmap size in the top left corner.
centered: original bitmap size in the center.
stretched: bitmap size streched to the size of the picture.
tiled: original bitmap size in tiles.
Default: normal.

Read more in the online manual

BorderStyle Long

Border type

Border style of the picture.
Bold frame: Display a bold frame around the picture. The size of the picture can be chnaged in the Runtime.
No frame: No frame is displayed.
Thin frame: Display a thin frame around the picture.
Default: No frame.

Read more in the online manual

CloseOnClickOutside Boolean

Close after losing focus

Controls the behavior of the template when losing focus. If you click next to the template, it will automatically close.

Active: The template is closed if you left-click next to it.

Default: inactive

PixelHorz Long

Horizontal movement [pixel]

Only active if you select relative to the element at Positioning.

By entering a positive or negative numerical value, you can move the reference point horizontally.

Default: 2

More in the online help

PixelVert Long

Vertical movement [pixel]

Only active if you select relative to the element at Positioning.

By entering a positive or negative numerical value, you can move the reference point vertically.

Default: 2

More in the online help

PosBottom Long

Bottom [pixels]

Y coordinate of the bottom right corner of the template in pixels (referring to the current screen resolution).
Minimum: -2147483648.
Maximum: 2147483647.
Default: Maximum of current screen resolution.

ATTENTION: We recommend to define templates not larger than 32000*32000 pixels to avoid graphical problems.

Read more in the online manual

PosHorz Long

Horizontal

Only active if you select relative to the element at Positioning.

Select the desired reference point at the element from the dropdown list. When the template is loaded, this reference point will be considered. Choose between left or right.

Default: Left

More in the online help

PosLeft Long

Left [pixels]

X coordinate of the top left corner of the template in pixels (referring to the current screen resolution).
Minimum: -2147483648.
Maximum: 2147483647.
Default: 0.

ATTENTION: We recommend to define templates not larger than 32000*32000 pixels to avoid graphical problems.

Read more in the online manual

PosRight Long

Right [pixels]

X coordinate of the bottom right corner of the template in pixels (referring to the current screen resolution).
Minimum: -2147483648.
Maximum: 2147483647.
Default: Maximum of current screen resolution.

ATTENTION: We recommend to define templates not larger than 32000*32000 pixels to avoid graphical problems.

Read more in the online manual

PosTop Long

Top [pixels]

Y coordinate of the top left corner of the template in pixels (referring to the current screen resolution).
Minimum: -2147483648.
Maximum: 2147483647.
Default: 0.

ATTENTION: We recommend to define templates not larger than 32000*32000 pixels to avoid graphical problems.

Read more in the online manual

PosType Long

Positioning

Determines the position of the template (of the pictures based on it) in the Runtime. This feature is especially useful for keyboard windows and popup windows: You can place pictures at the exact location of the mouse pointer or the element, from which the picture is loaded. You can choose from the following locations for placing the template during Runtime:

use absolute position: Positions the template at the coordinates defined in Position.

relative to the mouse pointer: The picture is placed in relation to the reference point of the template. The reference point of the template is positioned at the current location of the mouse pointer. You can define the reference point in Reference point of template. The reference point is marked as a red dot in the template editor. Example: If the reference point is at the top left side, the template will be loaded to the bottom right side of the reference point.
If the picture cannot be displayed completely at the configured position, the position will be moved until the complete picture is inside the displayed area of the screen.

relative to the element: Positions the reference point of the template relative to the element, from which the picture switch was initiated (e.g. a button or a combined element). Here you can define both the reference point of the template (in Reference point of template) and the reference point of the element (in Reference point of element) including the distances to the element. The reference point of the template will always be placed on the calculated reference point of the element in the Runtime.
If the template cannot be loaded at that position, because that would place the picture outside of the visible screen, the alternative reference points will be used. You can configure alternative reference points for the template in Reference point of template and for the element in Alternative reference point of element.
Example: you have a button at the right border of the screen and try to position a popup window on its right side: reference point of element: right/centered; reference point of template: left/centered. In the Runtime, the popup window will appear on the right side of the button, centered to the middle of the button. The popup window will not cover the button.
You use the same template also for a button on the left screen border. There may not be enough room on the right side to completely display the popup window. Therefore, the alternative position will be used. For this, you have to set the alternative reference point for the element to: left/centered and the alternative reference point of the template to right/centered.

Default: use absolute position

More in the online help

PosVert Long

Vertical

Only active if you select relative to the element at Positioning.

Select the desired reference point at the element from the dropdown list. When the template is loaded, this reference point will be considered. Choose between top or bottom.

Default: top

More in the online help

RefHorz Long

Horizontal

Only active if you select relative to element or relative to mouse pointer at Positioning.

Select the desired reference point for the template from the dropdown list. Choose between left, right or centered.

Default: Left

More in the online help

RefVert Long

Vertical

Only active if you select relative to element or relative to mouse pointer at Positioning.

Select the desired reference point for the template from the dropdown list. Choose between top, bottom or centered.

Default: top

More in the online help

ShowForeground Boolean

Always in the foreground

Active: No other picture overlaps this area in online operation. Pictures in the background can still be operated.
Inactive: Pictures of this template can be overlaped by other pictures.
Default: inactive.

Read more in the online manual

ShowMinimize Boolean

Min/Max Buttons

Only available, if the title is active:
Active: Display Windows symbol field in the title bar.
Inactive: Display no symbol field.
Default: inactive.

Read more in the online manual

ShowSysMenu Boolean

System menu

Only available, if the title is active:
Active: Display Windows system menu in the title bar.
Inactive: No system menu is displayed.
Default: inactive.

Read more in the online manual

ShowTitle Boolean

Title

Only available, if a frame is active for the template:
Active: Display Windows title bars for the pictures of this template. The pictures can be moved in the Runtime.
Inactive: Display no title bar.
Default: inactive.

Read more in the online manual

StandardPosition Boolean

Use standard position

active: Places the template for the alarm status line on the top border of the screen.

Default: active

More in the online help

Style Long Window style
TemplateName String

Name

Unique name of the template.
Default: Template_x (where x is a consecutive number).
Maximum: 30 characters.

ATTENTION: This property is not available for language switching.

Read more in the online manual

Samples:Top



'>thisProject< instead of >Myworkspace.ActiveDocument< when using the code at Runtime

'!Editor and Runtime!"

Public Sub TemplateDetails()

Dim zTMP As Template

Dim strTemplate As String



	Set zTMP = MyWorkspace.ActiveDocument.Templates.Item("tmp_MAIN")

	strTemplate = zTMP.Name & vbCrLf

	strTemplate = strTemplate & "ShowTitle: " & zTMP.ShowTitle & vbCrLf

	strTemplate = strTemplate & "ShowSysMenu: " & zTMP.ShowSysMenu & vbCrLf

	strTemplate = strTemplate & "ShowForeground: " & zTMP.ShowForeground

	

	MsgBox strTemplate

End Sub

	



Sub zenOn_Template()
	'Declarations
	Dim zWork As Project
	Dim zTemplate As Template
	Dim zTemplateCopy As Template

	'Initializiation of zWork
	Set zWork = MyWorkspace.ActiveDocument

	'Initialization of zTemplate by creating a new template
	Set zTemplate = zWork.templates.Create("zenOn_Template", False)

	'Set the position of zTemplate
	'Align at the upper left corner
	'Height = 1024
	'Width = 100
	zTemplate.Top = 0
	zTemplate.Bottom = 1024
	zTemplate.Left = 0
	zTemplate.Right = 100

	'Set style settings
	'Background color is 0xCCCCCC
	zTemplate.BackgroundColor = &HCCCCCC
	'Border style is "Bold Frame"
	zTemplate.BorderStyle = 1
	'Enable Windows title bar
	zTemplate.ShowTitle = True
	'Enable Windows system menu
	zTemplate.ShowSysMenu = True
	'Enable Windows minimize/maximize button in titlebar
	zTemplate.ShowMinimize = True

	'Initialization of zTemplateCopy by creating a new template
	Set zTemplateCopy = zWork.templates.Create("zenOn_TemplateCopy", True)

	'Copy the settings from zTemplate to zTemplateCopy
	zTemplateCopy.Copy zTemplate

	'Delete both templates from the collection
	zWork.templates.Delete (zTemplate.name)
	zWork.templates.Delete (zTemplateCopy.name)

End Sub