- By Scott A. Helmers
Adding shapes to lists
A list is a special type of container that maintains its members in ordered sequence. When you drop an object into a list, it takes a specific place before, between, or after existing members. Each list member knows its relative position in the list.
Visio 2013 doesn’t provide a list gallery on the Insert tab in the same way that it offers a container gallery. Consequently, creating a list either requires reusing an existing list shape or having enough technical knowledge to make changes to the ShapeSheet. (For more information about modifying the ShapeSheet, refer to the Appendix.)
In this exercise, you will add shapes to a list, and then reorder the shapes within the list. For this hypothetical scenario, the list shape is called My New PC; you will add rectangular shapes that represent the software you will load onto your new PC. Your goal for this exercise is to create a list that shows the installation sequence for your new PC.
Drag Visio 2013 into the list.
The graphic on the left shows the list outlined as the Visio 2013 shape approaches, and the graphic on the right shows the shape inside the list. Notice that the shape now displays its ordinal position in the list in front of the product name.
Because you can’t install Visio until after you’ve installed Windows, drag Windows 8 into the list, above Visio 2013. As you approach the list with the Windows 8 shape, notice that an orange insertion bar appears to tell you where you can add a new list member. In this example, you can insert the new shape after the existing shape (the following graphic on the left) or before the existing shape (graphic in the center).
When you drop Windows 8 above Visio 2013, notice that each rectangle displays its current position in the list. Visio 2013 is now #2.
Insert Office 2013 between Windows 8 and Visio 2013.
Drop Mozilla at the end of the list.
Drag Visio add-in until the orange insertion bar appears below Mozilla, but stop when the pointer is on the edge of the list but most of the shape is still outside of it, as shown in the following graphic on the left.
With Visio add-in in the position shown on the left in the following graphic, release the mouse button. When you release the mouse button from this position, the shape jumps into the list producing the result shown on the right.
The behavior demonstrated by the Visio add-in shape highlights two differences between containers and lists:
Container members can be located anywhere within a container; list members are always in fixed positions.
Shapes that are dragged onto the border of a container can be attached to the border; shapes cannot be attached to the border of a list.
Drag Mozilla up so it is located between Windows 8 and Office 2013.
The following graphic on the left shows the Mozilla shape as it is being dragged up the list; the graphic on the right shows the result. Notice that when you release the mouse button, each shape immediately reflects its new position in the list.
As this step illustrates, you cannot only add shapes to specific positions in a list, you can rearrange the shapes within a list.
Although you aren’t likely to use a Visio list for the specific purpose suggested by this exercise, you can probably imagine your own applications for position-aware shapes. Refer to the subsections in Finding containers and lists in Visio later in this chapter for examples of several ways that lists are used in Visio 2013 templates.
The previous exercise used a vertical list with shapes automatically placed from top to bottom. A Visio list can be either vertical or horizontal and can order shapes in either direction within the list. Although these attributes are controlled by parameters and don’t require writing code, you can’t change them from the Visio ribbon; you must make changes to the ShapeSheet for the list.
If you would like to experiment with a horizontal list, the Lists page in the Containers, Lists and Callouts_start drawing located in the Chapter11 practice file folder also includes a horizontal list called Store Shelf. Drag shapes from the Computers And Monitors or Network And Peripherals stencils to create a list like the following example. The Store Shelf list is configured to add shapes from left to right so it expands to the right as you add shapes.