IMcGraphOverlayTemplate Property |
![]() |
Namespace: MediaCy.IQL.Display.Overlays
ReadOnly Property Template ( ClassName As String, Optional TemplateID As Integer = 0, Optional TemplateSelection As mcGraphOverlayTemplateSelection = mcGraphOverlayTemplateSelection.mcgtsAutoCreateTemplate ) As Object Get
Dim tpl As McGraphObj, Obj As McGraphObj ''''''''''''''''''''''''''''''''''''''''' ' Simple example ''''''''''''''''''''''''''''''''''''''''' ' Create REDID template if it does not exist. Set tpl = overlay.Template ("McGraphObjRect",REDID) tpl.FillColor = &Hff0000 ' Now create a red rectangle Set Obj = overlay.Add ("McGraphObjRect",REDID) ''''''''''''''''''''''''''''''''''''''''' ' Template creation ''''''''''''''''''''''''''''''''''''''''' ' Default template for all objects Set tpl = overlay.Template ("McGraphObj") tpl.FillColor = &Hff0000 ' Default template for Rect objects ' tpl.FillColor already set to &Hff0000 Set tpl = overlay.Template ("McGraphObjRect", mcgtDefaultTemplate) ' Set tpl = overlay.Template ("McGraphObjRect" ) ' same as above tpl.FillColor = &H00ff00 ' Change default fill color for Rect's ' Derive a new Template from the default template for Rect objects ' Will tpl.FillColor = &H00ff00 Set tpl = overlay.Template ("McGraphObjRect", MyID) ''''''''''''''''''''''''''''''''''''''''' ' Other Template access ''''''''''''''''''''''''''''''''''''''''' ' Only return existing templates (empty VARIANT returned otherwise) If IsEmpty(overlay.Template("McGraphObj",MyID, mcgtsExistingTemplatesOnly)) Then MsgBox "Undefined Template" ' Default "system" template (not user defined in property sheet). Set tpl = overlay.Template("McGraphObj",,mcgtsNoUserTemplates) ' Automatically generate a new template with a unique ID Set tpl = overlay.Template("McGraphObj", ,mcgtsAutoTemplateID) MsgBox "ID is " & tpl.TemplateID