A few years ago, I wrote an article about messaging and encryption inspired by a visit to the National Museum of Computing in the UK. I developed a Morse Click shape to demonstrate how Visio can be used to represent and learn Morse Code. However, I never published the shapes here, and my good friend John Marshall recently wrote an article about Braille in Visio, so I thought I should explain how I made the Morse Click shapes, and I took the opportunity to enhance the shapes with some accessibility features that I have learnt since I originally designed them. I have also changed the shapes to be Visio Web friendly, which means, for example, removing shape effects.
I think I learnt Morse Code as a Cub Scout, but forgotten it in the half-century since. Its evolution, and its use today still makes very interesting reading. Each letter comprises of between one and four short or long clicks, whilst each number has five such clicks. Generally, the most used letters have lesser clicks, with ET being the lowest number, presumably to save an extra terrestrial money on a phone call home!
There are just two master shapes of interest here, Morse Click and Morse Click Rack, and a couple of page Shape Data rows. The Morse Click shape can be anyone of the 36 characters with a simple Shape Data value change, whilst the Morse Click Rack is a list shape and can spell out the words of up to 26 Morse Click shapes within it.
Morse Click master
The Morse Click shape displays either just the clicks required to transmit a letter or numeral, or both the clicks and the character. In addition, the ScreenTip displays the pronunciation of each character so that it will be narrated for the visually impaired. I have also ensured that the clicks and character are displayed with high contrast to the background fill colour.
A random character can either be displayed by selecting the Get random character right menu option, or by dropping a copy of the shape when the page Random character on drop Shape Data value is TRUE. This latter value can be set directly in the page Shape Data window, however this is not available in Visio Web, so both the Morse Click and Morse Click Rack shapes have the ability of setting this page Shape Data value from their right mouse menu.
Similarly, the page Hide Text Shape Data value can be set directly in the page, or in either of the Morse Click shapes.
The Character value can be set from the Shape Data window, where there is a drop-down list of all thirty-six characters, or from the right mouse menu of the Morse Click shape, where it is grouped by the number of clicks.
The shape is a group with two sub-shapes, Character and Click. I could possibly have amalgamated them into a single shape, but I decided to keep them separate for clarity. The Click shape has multiple geometry sections, five ellipses and five rectangles, which have their visibility controlled by a formula in the NoShow cell.
These formulas reference the group shape User.Clicks cell which has the formula:
=INDEX(0,Prop.Clicks," ")&";"&INDEX(1,Prop.Clicks," ")&";"&INDEX(2,Prop.Clicks," ")&";"&INDEX(3,Prop.Clicks," ")&";"&INDEX(4,Prop.Clicks," ")
This formula references the Prop.Clicks cell value which contains a semi-colon separated list of
=";. _ ;_ . . . ;_ . _ . ;_ . . ;. ;. . _ . ;_ _ . ;. . . . ;. . ;. _ _ _ ;_ . _ ;. _ . . ;_ _ ;_ . ;_ _ _ ;. _ _ . ;_ _ . _ ;. _ . ;. . . ;_ ;. . _ ;. . . _ ;. _ _ ;_ . . _ ;_ . _ _ ;_ _ . . ;. _ _ _ _ ;. . _ _ _ ;. . . _ _ ;. . . . _ ;. . . . . ;_ . . . . ;_ _ . . . ;_ _ _ . . ;_ _ _ _ . ;_ _ _ _ _ "
These clicks are in the same order as the Prop.Character.Format cell formula:
Therefore, when a user selects a Prop.Character, then the index number of the selection is held in the User.CharacterIdx cell:
Then this index number can be used to display the corresponding clicks in the Prop.Clicks.Value cell:
The selected clicks are each separated by a space character, which helps legibility but also enables the User.Clicks cell to use this in determining which type of click is required at the nth position:
Similarly, the Prop.Sound.Format cell holds the list of sounds required for each character:
=” ;di dah;dah di di dit;dah di dah dit;dah di dit;dit;di di dah dit;dah dah dit;di di di dit;di dit;di dah dah =” ;di dah;dah di di dit;dah di dah dit;dah di dit;dit;di di dah dit;dah dah dit;di di di dit;di dit;di dah dah dah;dah di dah;di dah di dit;dah dah;dah dit;dah dah dah;di dah dah dit;dah dah di dah;di dah dit;di di dit;dah;di di dah;di di di dah;di dah dah;dah di di dah;dah di dah dah;dah dah di dit;di dah dah dah dah;di di dah dah dah;di di di dah dah;di di di di dah;di di di di dit;dah di di di dit;dah dah di di dit;dah dah dah di dit;dah dah dah dah dit;dah dah dah dah dah”
Thus, the specific series of click sounds for a selected character can be returned with the following formula in Prop.Sound.Value cell:
These are the key formulas for the Morse Click shape, but there is another key formula that is required when it is placed within a Morse Click Rack shape…
Morse Click Rack master
The Morse Click Rack shape is a list container that can hold any amount of Morse Click shapes, although only five are automatically inserted on drop.
The right mouse menu has a link to a dictionary web site to Check word, and the options to Hide Text or have Random character on drop.
Visio List shapes are a specialised form of a Container shape. The list shape has a function, LISTMEMBERCOUNT(), to get number of members it has, but it does not have a function to get at the individual member shapes.
The member shapes, however, do have a function, LISTSHEETREF(), that gives them a reference to the list that they are within, and another function, LISTORDER(), which returns their position within the list. Therefore, the member shapes can push any of their cell values, in this case Prop.Character, to a known cell, say User.Member_nn, in the list shape automatically. So, the Morse Click Rack has a number of User Defined Cells, Member_01 to Member_26 (it could have been more), into which its members push their Prop.Character values with a formula in their User.SetMemberTrigger cell:
Then the sequence of characters contained in the list can be displayed by simply concatenating each of these values together, after ensuring that it is a currently pushed value, so the list’s Header sub-shape User.MemberCharacters cell has the formula:
This can then be displayed or not, depending on the page Prop.HideText value.
Note: I did try to also push the Prop.Sound value into the User.Member_nn.Prompt cells, but the LISTSHEETREF() function does not allow the User Defined Prompt cells to be referenced.
The sample Visio document can be downloaded from here if you cannot see it below.
I have been a Visio user/developer since the mid-1990’s and seen the word “callout” used as part of the name of many master shapes in Visio. The images below show five ways that the term “callout” has been applied to the name of Visio master shapes. Generally, each evolution has been an advance on the…
Data Graphics in Visio Plan 2 and Visio Professional is great, but it only enables us to use them with 2D shapes in Visio, i.e. not on connectors. So, what if you want to change the line colour of the connectors between the 2D shapes because of the data flowing between them? Well, it is…
Visio shapes get their smartness from the formulas that are entered into the ShapeSheet, but editing these formulas can be extremely tricky and prone to error because of the lack of a modern programmer’s interface. Formulas can be quite long (up to 64k characters) but even medium size ones like the one in User.GetWorkdays cell…
I was recently asked if a second function header bar can be added to the swimlanes in the cross-functional flowchart templates in Visio. Some swimlanes can get quite wide, so it can be useful to have a duplicate function header shape on the far-side too. It is quite simple to duplicate the existing function header…
My last article looked at parsing an XML string with a known structure and order of elements and attributes. This can be acceptable in some scenarios, but what if the elements or attributes are in a different order? Then it is necessary to use the element and attribute names rather than their index position. This…
One of my current projects uses XML data, and some of the values in the XML data control the display and content of Visio shapes. Therefore, I looked deeper into how the XML data can be used directly to control parts of the graphics. Although the external data linking feature in Visio Professional and Visio…