Author Topic: Shape with pop-up text box  (Read 10708 times)

0 Members and 1 Guest are viewing this topic.

AdamK

  • Newbie
  • *
  • Posts: 2
Shape with pop-up text box
« on: September 22, 2008, 03: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.

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

  • Hero Member
  • *****
  • Posts: 1513
Re: Shape with pop-up text box
« Reply #1 on: September 24, 2008, 08:00:51 AM »
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

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3822
  • Ideas Visio-lized into solutions
Re: Shape with pop-up text box
« Reply #2 on: September 24, 2008, 10:19:57 AM »
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

  • Hero Member
  • *****
  • Posts: 1513
Re: Shape with pop-up text box
« Reply #3 on: September 24, 2008, 11:24:15 AM »
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

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2932
    • Paul Herber's website
Re: Shape with pop-up text box
« Reply #4 on: September 24, 2008, 11:42:48 AM »
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 ...

« Last Edit: September 25, 2008, 04:16:04 AM by Visio Guy »
Electronic and Electrical engineering, business and software stencils and applications for Visio -

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

AdamK

  • Newbie
  • *
  • Posts: 2
Re: Shape with pop-up text box
« Reply #5 on: September 26, 2008, 08:29:21 AM »
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