Visio Guy

Visio Discussions => ShapeSheet & Smart Shapes => Topic started by: Visisthebest on September 14, 2021, 10:29:40 AM

Title: Shape Data fixed lists, keeping them centralized in a 'Configuration shape'.
Post by: Visisthebest on September 14, 2021, 10:29:40 AM
I would like to use several Shape Data fixed lists on my shapes, but keep the list store in a centralized 'configuration shape'.

I can easily accomplish this by setting Format in all the shapes to point to the Format field in the centralized shape, like this formula:

=ConfigurationShape!Prop.Row_1.Format

Please note for this use case I don't mind that the shapes break when copied to another page that does not have the configuration shape. (I do a lot of verification in code on the shapes).

(I can verify if a shape is copied, which invalidates the lookup data as these lists may be different and lead to incorrect results).

Another issue is the user changing the list in the configuration shape (via Define shape data) and invalidating all the lookup values in the other shapes.

So the lookup will actually be something like:
=ConfigurationShape!User.LookUpX.Format

So the user can no longer use Define shape data. I will add a custom WinForm editor that does validation on the changes to the lookup list. (forcing the user to add a unique ID in a separate field that I add to the beginning of the lookup's text)

The configuration shape cannot be deleted without the user going in to the Developer Tab. (as far as I know that is the only way to remove delete protection).

One problem is still that the user can change the Format (lookup list) in each shape, is there a way I can block editing the settings of (a particular) shape data field?

Thank you for sharing your insights!
Title: Re: Shape Data fixed lists, keeping them centralized in a 'Configuration shape'.
Post by: Surrogate on September 14, 2021, 10:34:39 AM
You need different fixed lists for each page or single fixed list for whole document (global fixed list) ?
Title: Re: Shape Data fixed lists, keeping them centralized in a 'Configuration shape'.
Post by: Visisthebest on September 14, 2021, 10:37:14 AM
For each page.
Title: Re: Shape Data fixed lists, keeping them centralized in a 'Configuration shape'.
Post by: Visisthebest on September 14, 2021, 10:37:28 AM
One problem is still that the user can change the Format (lookup list) in each shape, is there a way I can block editing the settings of (a particular) shape data field?

The user can still change which lookup value is selected, but no longer edit the Format field/list of available values.
Title: Re: Shape Data fixed lists, keeping them centralized in a 'Configuration shape'.
Post by: Surrogate on September 14, 2021, 11:05:58 AM
Quote from: Visisthebest on September 14, 2021, 10:37:28 AMThe user can still change which lookup value is selected, but no longer edit the Format field/list of available values.
What kind of users do you mean: hardcore users (who use ShapeSheet) or non-hardcore (who use only user interface) ?
If non-hardcore, you can use trick like as in attachment.
(https://i.imgur.com/rXy6Ofb.png)
Title: Re: Shape Data fixed lists, keeping them centralized in a 'Configuration shape'.
Post by: Visisthebest on September 14, 2021, 11:47:18 AM
Non-hardcore fortunately, very useful solution thank you Surrogate!
Title: Re: Shape Data fixed lists, keeping them centralized in a 'Configuration shape'.
Post by: vojo on September 15, 2021, 09:15:36 PM
have to play around with this, but

user.myformat = guard("a;b;c")
prop.format = user.myformat

or try
prop.format = guard ("a;b;c")
Title: Re: Shape Data fixed lists, keeping them centralized in a 'Configuration shape'.
Post by: Visisthebest on September 16, 2021, 08:23:57 AM
Thank you Vojo!