How to add states to a shape?

Z

Zoe Hu

Master shapes like check box and Radio button have states like enabled,
disabled, selected. This is very convenient to switch between similar shapes.
How can I create a stencil to include states so I can switch states using
right-click?
 
A

Al Edlund

Visio has the ability to save a very large selection of diverse information.
These used to be called custom properties and are now called shape data.
They can be added programmatically and manually. Check out the help facility
in Visio for an introduction. Interaction with these properties can also be
accomplished using the shapesheet which is explained over here.

http://msdn2.microsoft.com/en-us/library/aa245244(office.10).aspx

al
 
J

John Marshall, MVP

Each shape is made up of a collection of Geometry sections. Each Geometry
section has a field that will determine if the geometry is visible. Many
Visio shapes use the value of a custom property/shape data to control this
field. So a Visio shape may have Custom Property/Shape Data called State
with a value of On or Off. Some of it's Geometry sections may describe a
switch in the On state and have the value of the Hidden cell set depending
on whether the Custom Property/Shape Data's value is "On". Other Geometry
Sections may describe a switch in the Off State and use the opposite formula
for the Hidden cell.

John... Visio MVP

Need stencils or ideas? http://visio.mvps.org/3rdparty.htm
Need VBA examples? http://visio.mvps.org/VBA.htm
Visio Wishlist http://visio.mvps.org/wish_list.htm
 
V

vojo

and if you really want to get slick....you can dynamically play with the
action row text so that each time your right click the shape, you can get a
new menu of actions to take. This involves using the action cells and user
cells to keep indicies for context. Something like this: Right click and
you get "item 1...item 2...item 3...next" pick next....right click again
and get "previous...item 4...item 5....item 6...return to beginning"

The action rows...could be used to set indicies to show/hide any custom
properties for say item 2. Something like this: right click and you get
"previous...item 1...item 2...item 3...next" pick item 2 (picking will
invoke action 2 cell which has all the fcns you defned to manage indices and
call docmd(1312). This brings up the custom property panel in the context of
item 2. For example, say item 1 is processor speed of a server, item 2 is
memory, item 3 is disk count/storage...picking item 2 this way would alow you
to change memory size in custom priority panel wihtout seeing processor speed
or disk info.

This keeps you clear of all the security / complexity issues with VBA
 
Z

Zoe Hu

Thank you all, Al, John and Vojo for the help.

The link that Al gave me has enormous amount of info. The page I found the
most useful is
http://msdn2.microsoft.com/en-us/library/aa200979(office.10).aspx. It gives
examples of adding actions/states.

However, I'm not sure how I can extend those examples to fit my needs. How
to add a disabled state for a text box that changes the text color and the
box outline and background color? I checked out the shapesheet for its
window's control of text box and couldn't figured how it did it.

What are the sections and fields that I need to change to make those color
changes? Could anyone send an example shapesheet?

Thanks so much.
Zoe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top