Like it or not, Visio has for some time been the de facto wireframing tool in Windows. At Design For Use, we have been steadily dialing-up the sophistication of our wireframes using some of the powerful yet difficult to discover features of this tool. In this tutorial, we describe the steps to create custom, reusable shapes (data graphics) that accept user inputs (text, data) through a dialog box. This tutorial and the associated screenshots are for Visio 2007 but we can apply the same principles for other versions of Visio.
Oftentimes, we create a stencil that represents a generic module and includes things like a header, sub-head, body text. Traditionally, working with this type of stencil has been a cumbersome and inefficient effort requiring our team to drag-and-drop from the document stencil and then select and edit individual text elements (sometimes nested in groups of groups). No longer…
Below are two examples.
Using the rectangle tool from the toolbar (ctrl+8), draw a rectangle as shown below and fill it with gray (figure 1).
Right-Click on the rectangle shape and select Data > ‘Shape Data’ from the menu (figure 2). Then select ‘Yes’ when prompted to define the shape data now.
The ‘Define Shape Data’ dialog is now displayed as figure 3. ‘Labels’ will be displayed on the shape while ‘Type’ will allow you to choose between a free form text or a drop list. For simplicity, ignore the rest of the fields, though with a little trial and error they are quite straightforward to use. Now, define labels and types for three fields by repeatedly clicking on the ‘New’ button. You should see three fields defined as shown in figure 4.
Upon pressing ‘OK’ to close the ‘Define Shape Data’ dialog, you will be prompted to enter values for each of the three fields. Enter the values as shown in figure 5 or leave them blank for now. Click ‘OK’ to close the prompt. Don’t worry if these value are not visible on your shape yet.
Again, right-click on the rectangle shape and this time select Data > ‘Edit Data Graphic’ from the menu (figure 6). A data graphic dialog as shown in figure 7 will be displayed. Click on the ‘New Item’ pull down and select ‘Text…’ from the options.
The ‘New Text’ dialog (figure 8) will allow you enter the values for the fields defined above. Enter the values in the dialog as show in figure 9. The ‘Callout Position’ options can be changed later by moving the text block manually, so just make sure your fields don’t overlap for now. You can also experiment with other options to gain a better control on how the fields are displayed later. Select ‘OK’ to close the dialog.
The Data Graphic dialog should now look like figure 10. Add the remaining two fields in the similar manner to mirror the values displayed in figure 11.
Once you close the Data Graphic dialog, your shape should look like Figure 12. You can now select each text block individually to re-position and re-format to look like figure 13. All text blocks are now grouped with the rectangle shape, so double click to select each text block. (Note: In this example, Calibri 12 pt. font has been used.)
You are almost there. Now, the prompt to enter the field values through a dialog needs to be turned on. First, select the grouped rectangle shape by clicking on it, then choose Window > ‘Show ShapeSheet’ from Visio’s main menu (figure 14). In the ShapeSheet of the drawing, scroll down to the table displaying ‘Shape Data’ (figure 15). If you don’t see the Shape Data table, then you probably forgot to select the rectangle shape first.
Finally, change all the field values under ‘Ask’ column to TRUE (figure 16). Make sure to hit Enter each time to register the change.
That’s it. You are done. Now every time you copy and paste this shape, you will see a dialog (figure 17) to input the field values.
Or you can drag this shape into the document stencil to use it across a wireframe deck as a Master. Visio provides masters — any group of text and shapes — as a convenient, reusable way to add elements to our wireframes. In particular, masters that are part of the document stencil can be modified with changes cascading to any instances of that master throughout the entire document. Microsoft Online has a nice introduction on creating masters in the document stencil.