User Tools

Site Tools


macros:example:sethalo

Example

Set a Handle's Halo

by: Gregory Haynes, February 2018
published: email
description: example of how to set an item's halo

functions

Code

chase22_green.xml
<?xml version="1.0" encoding="utf-8"?>
<avolites.macros xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Avolites.Menus.xsd">
 <macro name="Chase 22 Green Halo" id="UserMacro.Chase22.Halo.Green">
    <description>Sets chaser 22 to green halo.</description>
    <sequence>
      <step>Handles.SetSourceHandleFromHandle("chaseHandleUN=22")</step>
      <step>Handles.SetPendingHaloToSystemColour("Light Green")</step>
      <step>Handles.ClearSelection()</step>
     </sequence>
  </macro>
</avolites.macros>

Explanation

This explains the functional steps within the sequence. For all the other XML details please refer to Formats and syntax

Handles.SetSourceHandleFromHandle(“chaseHandleUN=22”) selects the chase with usernumber 22 as source handle for the following steps.
Handles.SetPendingHaloToSystemColour(“Light Green”) sets the selected handle's halo to light green.
Handles.ClearSelection() clears the selection.

Until Titan 11.1 it is not possible to set the halo to a random RGB colour, as the halo property is of type AcwColour and there is no automatic conversion. Hence, the only option is to use the available system colours which are Red, Orange, Brown, Yellow, Green, Light Green, Blue, Cyan, Violet, Red Violet.

From Titan 11.2 on it is expected to be possible to set an arbitrary RGB colour.

Add a converter for AcwColour which allows macros and WebAPI to specify a colour value for any properties or methods that use one e.g. for halos. The prefix for this cast will be “colour” and value can either be a hexadecimal string or an integer value (not hexadecimal).

For example it should be possible to call the following in a macro:

ActionScript.SetProperty(“Handles.PendingHalo”, colour:“#ffff0000”)

How to use it

  • Using a macro to set a halo might not seem very intelligent. However, this might be a way to give some feedback.

Discussion

sideshowbond, 2018/08/31 00:27

Handles.RemoveHalo() if you want to remove the halo

sgroen08, 2021/05/29 18:08

To continue on the note that you now can use a HEX ARGB value to set a halo colour:

<step>Handles.SetSourceHandleFromHandle(“groupHandleUN=303”)</step> points the macro at group 303 <step>ActionScript.SetProperty(“Handles.PendingHalo”, colour:“#ff00ffff”)</step> will set the pending halo colour yellow. <step>Handles.SetHalo()</step> will apply the pending colour to group <step>Handles.ClearSelection()</step> will clear the programmer.

Thanks to Sebastian Beutel and Gregory for figuring things out with me!

You could leave a comment if you were logged in.
macros/example/sethalo.txt · Last modified: 2020/03/29 11:17 by icke_siegen

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki