Example ====== Legend - Set a Page Legend ====== ^ by: | Sebastian Beutel, August 2018 | ^ published: | http://forum.avolites.com/viewtopic.php?f=20&t=5854&p=21106#p21106 | ^ description: | Set page names, e.g. for playback or fixture pages | ^ remarks: | Unlike with other handles, this is called a name, not a legend - and requires other functions. | {{tag>page legend name}} ==== functions ==== * [[:macros:function:Handles.SetGroupPage]] * [[:macros:function:Handles.SetGroupPageName]] ===== Code ===== Handles.SetGroupPage("Playbacks", 0) Handles.SetGroupPageName("Playbacks", "PbPg. 1") Handles.SetGroupPage("Playbacks", 1) Handles.SetGroupPageName("Playbacks", "PbPg. 2") Handles.SetGroupPage("Playbacks", 2) Handles.SetGroupPageName("Playbacks", "PbPg. 3") Handles.SetGroupPage("Playbacks", 3) Handles.SetGroupPageName("Playbacks", "PbPg. 4") Handles.SetGroupPage("Fixtures", 0) Handles.SetGroupPageName("Fixtures", "Generics") Handles.SetGroupPage("Fixtures", 1) Handles.SetGroupPageName("Fixtures", "Spots") Handles.SetGroupPage("Fixtures", 2) Handles.SetGroupPageName("Fixtures", "Washes") Handles.SetGroupPage("Fixtures", 3) Handles.SetGroupPageName("Fixtures", "LED Wall") When using characters outside the ASCII character table as name the results may vary: - in order to get an ampersand ( the & character) you must write it as entity (&): Handles.SetGroupPageName(“Colours”, “Greens & Blues”) - german Umlauts (ä, ö, ü, ß and the like) work normally (entities would throw errors): Handles.SetGroupPageName(“Colours”, “Grün”) - you can even display UTF-16 characters by using the HTML code notation, e.g. for the Yuan character 元: Handles.SetGroupPageName(“Playbacks”, “元”) ===== 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]] Each page legend is set with two steps: * ''Handles.SetGroupPage'' selects the page the name of which is going to be set * ''Handles.SetGroupPageName'' sets the page name ===== How to use it ===== * [[:macros:deploying|make this macro available]] * This macro is best used with a macro like [[macros:example:createworkspaces]], to setup the page names you are usually using. ~~DISCUSSION~~