Adding data-linked shapes to lists
Lists are a special type of container. Each item in a list is ordered from left to right, right to left, top to bottom, or bottom to top. These are the settings that can be applied to the list. In the following screenshot, the Sales container has been changed to a list ordering from left to right:
The code is almost identical for DropShapesInContainer()
, except that the rows that move the Person shapes into the center of the container are replaced with the action to insert them into a list.
This results in the Person shapes being neatly aligned within the list container, as shown in the following screenshot. There is no need to lay out the shapes, of course.
In reality, the
Person shapes will be ordered according to some rule, rather than just looping through DataRecordset
.
Note
For more uses of lists in Visio diagrams, see http://blog.bvisual.net/2014/12/31/get-scrabbled-with-visio/.