User Tools

Site Tools


macros:example:copyicon

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

macros:example:copyicon [2019/03/10 11:10] (current)
icke_siegen created
Line 1: Line 1:
 +Example
  
 +====== Copy Icon (snippet only) ======
 +
 +^ by: | kimwida, January 2019 |
 +^ published: | http://​forum.avolites.com/​viewtopic.php?​f=20&​t=5784#​p21569 |
 +^ description:​ | copy a legend icon from another handle |
 +
 +{{tag>​copy legend icon}}
 +
 +==== functions ====
 +  * [[:​macros:​function:​Handles.SetSourceHandleFromHandle]]
 +  * [[:​macros:​function:​Handles.SetIcon]]
 +  * [[:​macros:​function:​Math.Cast.ToInteger]]
 +  * [[:​macros:​function:​Handles.GetIconId]]
 +  * [[:​macros:​function:​Handles.ClearSelection]]
 +
 + 
 +===== Code =====
 +<code xml>
 +
 +  <step pause="​0.01">​Handles.SetSourceHandleFromHandle(handle:"​Location=Colours,​1,​3"​)</​step>​
 +  <step pause="​0.01">​Handles.SetIcon(Math.Cast.ToInteger(Handles.GetIconId(handle:"​Location=Colours,​1,​1"​)))</​step>​
 +  <step pause="​0.01">​Handles.ClearSelection()</​step>​
 +
 +</​code>​
 +
 +
 +===== Explanation =====
 +
 +This explains the functional steps within the sequence. For all the other XML details please refer to [[:​macros:​formats_and_syntax#​xml_format|Formats and syntax]]
 +
 +  * ''​Handles.SetSourceHandleFromHandle''​ sets a particular handle as the source handle - here: the target for the copy operation
 +  * ''​Handles.SetIcon''​ sets the icon of the target handle
 +  * ''​Math.Cast.ToInteger''​ makes sure the icon id is of the Int type
 +  * ''​Handles.GetIconId''​ gets the id of the icon which is currently used for another specified handle
 +  * ''​Handles.ClearSelection''​ clears the selection so that no handle is highlighted as selected any more
 +
 +===== How to use it =====
 +
 +This is a snippet only - adapt and use it in your own macros.
 +
 +
 +~~DISCUSSION~~
macros/example/copyicon.txt ยท Last modified: 2019/03/10 11:10 by icke_siegen