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.
=NOT(STRSAME(INDEX(n,Sheet.5!User.Clicks),"_"))
or
=NOT(STRSAME(INDEX(n,Sheet.5!User.Clicks),"."))
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:
=" ;A;B;C;D;E;F;G;H;I;J;K;L;M;N;O;P;Q;R;S;T;U;V;W;X;Y;Z;1;2;3;4;5;6;7;8;9;0"
Therefore, when a user selects a Prop.Character, then the index number of the selection is held in the User.CharacterIdx cell:
=LOOKUP(Prop.Character,Prop.Character.Format)
Then this index number can be used to display the corresponding clicks in the Prop.Clicks.Value cell:
=GUARD(INDEX(User.CharacterIdx,Prop.Clicks.Format))
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:
INDEX(n,Prop.Clicks," ")
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:
=GUARD(INDEX(User.CharacterIdx,Prop.Sound.Format))
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:
=IF(LISTORDER()=1,SETF(GetRef(LISTSHEETREF()!User.MEMBER_01),Prop.Character),IF(LISTORDER()=2,SETF(GetRef(LISTSHEETREF()!User.MEMBER_02),Prop.Character),...etc
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:
=IF(LISTMEMBERCOUNT()>0,User.Member_01,"")&IF(LISTMEMBERCOUNT()>1,User.Member_02,"")&...etc
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.
Example Document
The sample Visio document can be downloaded from here if you cannot see it below.
Synchronizing Visio Shape Fill Color (or almost any cell) across pages
I was recently asked how the color of one shape can be changed and for other shapes to be automatically updated to the same color … even if they are on different pages! Well, it is possible with Microsoft Visio’s awesome ShapeSheet formulas. In fact, this capability is not limited to the FillForegnd cell ……
Positioning Visio Shape Text Block with a Control Handle
I was recently asked how a control handle can be added to a Visio shape so that it can be used to re-position the text block. Fortunately, it is extremely easy to setup, and requires just two formulas to be updated in the ShapeSheet. This is a great use of the SETATREF(…) function. (more…)
Understanding Segments of Visio Geometry
I recently had to revise my understanding of the POINTALONGPATH(…) function in Visio because I was getting a #REF! error in some cases. My particular scenario requires a line with a number of vertices that are initially all in a straight line but can be moved by dragging controls around that each vertex is bound…
Custom Color Themes in Visio?
I was recently looking into custom color themes for corporate branding in desktop Microsoft Visio and became re-aware how different Visio still is from the rest of the Microsoft Office applications. A Visio page or document does not need to have any theme applied, but the documents of the other Office applications always have a…
When is a Visio Callout not a Callout?
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…
Using Visio Color by Value on Connectors
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…
Leave a Reply