News:

BB code in posts seems to be working again!
I haven't turned on every single tag, so please let me know if there are any that are used/needed but not activated.

Main Menu

Shape with pop-up text box

Started by AdamK, September 22, 2008, 08:57:41 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

AdamK

Hi,

I'm trying to create a shape with two text elements... one that displays all the time and another thatappears and disappears when you double-click the shape.

I'm working on an interactive graph where the data points are associated with actions to be taken. I've succeeded in creating a circle with the text to the right of the circle, and I managed to have the color change automatically from green to yellow to red as the shape is placed in different quadrants of the graph by inserting a formula into the ForegroundFill attribute.

I would like to add behavior that will cause another text box to open next to this shape when I double click it. I would use Custom Properties, but I can't figure out a way to display a custom property in a multi-line, readable format for a lot of text.  I'm looking for a formatted text box that is editable, then gets hiden when I double click it again. I tried creating a text box and grouping it with the circle. When I do this, the color change formula stops working, and I can't figure out where I would insert an action that would show or hide the box.

I'm very new to shape design, so sorry if this dosen't make a lot of sense. Any advice would be greatly appreciated.

Thanks,
Adam

vojo

couple of options:

1.  in the double click cell....add docmd(1312)...this will open the custom props menu on a double click
2.  could do the following:
          - on primary shape double click cell, have it toggle a variable
          - on secondary shape, use the variable to trigger in the geometry noshow cell
          - could do one of the following
                  - edit text (might be tough to figure out the raw text...might be "TheText" field
                  - Have its double click do something (I have used variables to bring up
                    subsets of custom props ....like network config, storage config, system config props.
                  - action buttons to launch subset of props
                  - etc.
     So in essence, double click primary shape....secondary shape shows up....use one of the means
     to edit the info...double click primary again...secondary shape dissappears.
3. Of course, could jump into code (VB is easiest / most visio friendly)

wapperdude

I think the dbl click -- dbl click gets into some kind of loop.  Somehow need to keep track if it's the 1st dbl click or the 2nd.  My initial try produced circular argument.  Almost need a time delay function.
Visio 2019 Pro

vojo

user.click_tracker = 0
double click cell = setf(getref(user.click_tracker), if(user.click_tracker =1,0,1))

for debug could do the following:
actions.row_1.text = "checked if even num of double clicks"
actions.row_1.checked = user.click_tracker
actions.row_actions = ""

Once happy...delete actions row

Paul Herber

#4
Quote from: AdamK on September 22, 2008, 08:57:41 PM
Hi,
I'm trying to create a shape with two text elements... one that displays all the time and another thatappears and disappears when you double-click the shape.

To start with, have a look at my article on this forum at:
Text output popup box

This will do the first bit of what you want. If this works for you then we can progress to the next stage ...

Electronic and Electrical engineering, business and software stencils for Visio -

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

AdamK

Hi,

Thanks for all the great input. I did a little of "all of the above" and got a really good result.

After I got over my obsession with doing this without writng code, I created a user form with multiple fields, to help organize the data I wanted to store. I then created user variables for the shape and wrote a short routine to populate and display the form modaly, then capture the values from the form and write them back to the shape's variables when the user clicks Save. I included a field on the form for the actual text of the shape, so now I have "smart dots" that I can move around on the graph; they change color based on the quadrant they are in, and I can add a bunch of information to each one.

Now that I'm back in scripting-mode, I'd like to create a routine to capture all of the data in my variables for all the dots on a sheet and export it to an Excel spreadsheet... has anyone done something like this?

Thanks again,
Adam

Browser ID: smf (possibly_robot)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 241 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1120KB.
Tokens: post-login.
Cache hits: 13: 0.00183s for 26,725 bytes (show)
Cache misses: 2: (show)
Queries used: 15.

[Show Queries]