Shape Data cell events

Started by baldman, April 14, 2010, 08:51:08 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

baldman

What I would like to do (if possible) is to handle events for specific cells in the Shape Data screen as they happen. I have three fixed-list type combo boxes that rely on each other. I populate the combos for one shape, then when the user is looking at the Shape Data dialog and changes it, I need to capture that event right then to populate the others based on the first's selection. Every event I can find fires when the Shape Data dialog closes, and that's too late.

aledlund

What you're talking around is filtering events. The visio sdk has a demo on how to approach this type of issue (event filter demo).
al

baldman

Thanks for the lead. I am looking at the example and frankly it confuses me. It seems they are adding the events to the page, where I need them added to the Shape Data dialog cells themselves.

This is my first experience with Visio, but I've been a developer for a while now. I have a shape, from that shape I use get_Cells("myCombo")... can I not add an event handler here to call a method when the value changes?
What I am looking to do is a basic SelectedIndexChanged event on a combo or a TextChanged event - is there no simple way to handle this?

aledlund

Visio is huge event driven application! Every cell that is changed creates an event  (and may cascade many other events). As an example of how things are running under the covers you might check out the event monitor (in developer mode on 2010, under tools sdk add-ins in 2007) to just watch what happens when some of the relatively basic functions happen. The choices then come down to capture all cell changed events (you then have to examine the event to see if it is the shape and cell you want to work with) or add a filter so that you only get the ones you want.
al

baldman

Every event I add seems to only be captured on close of the Shape Data dialog though. Through the C# interface I added both the CellChanged and the FormulaChanged event handlers to the cell. They get fired when the Shape Data closes. How can I get them to fire when the data changes?

Paul Herber

But using the shape data dialog the data only actually changes when you click the OK button. Until then it is only stored within the edit boxes within the dialog. There is no mechanism to access this data. It is completely private to the dialog.
However, in Visio 2007/2010 there is a different shape data window that updates the shape data immediately, well, you have to press the Enter button or use the mouse to click away from the data cell.
Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

baldman

Thanks Paul! I am using 2007 - does any event get fired on the enter key or focus change, or is it a change to the shape data object that I can not intercept and process?