Need help to create a smart text shape

Started by PF4VisioGuy, February 09, 2012, 05:03:17 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

PF4VisioGuy

Hi guys

I need you help for the following task: I want to create a text shape that has tree sections and header
Here is the layout

-------------------------
|     header,fixed height |
-------------------------
|                                 |
|              1                 |
|                                 |
-------------------------
|                                 |
|              2                 |
|                                 |
-------------------------
|                                 |
|               3                |
|                                 |
-------------------------


Section 1,2,3 should adjust their height with the height of the paragraph within them. Width will be adjusted manually
I am also planning to use a different fill colour in each of them. Width should be the same for all of course in the end.

The attached picture gives you an idea.
Could you please tell me if this is doable and give me some ideas to start with?
I managed to create the header and the first section and to correlate their size but it all broke when I saved that in a stencil.
I basically used references from one shape sheet to the other for the two components
I would like to be able to group the shapes and preserve the functionality described above

thank in advance
PF

PF4VisioGuy

This seems to be partially addressed here already :http://social.technet.microsoft.com/Forums/en-ZA/visiogeneral/thread/a72a58d7-b207-4fae-9178-16ebf11997de
by a member of this forum...

I will study that example and get back with more questions if I have
Please feel free to suggest other examples that I might have to look at if you know any

thanks
PF

Paul Herber

So I did! Yes, the Class shape - it might not be exactly what you want but should be modifiable. Don't ungroup the shape!
Electronic and Electrical engineering, business and software stencils for Visio -

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

vojo

BTW...you could use custom properties be able to edit the text in each section (without having to tunnel into the subshape and select text)

Assuming you want this for a variety of users, CP approach might be more user friendly.

Paul Herber

Quote from: vojo on February 09, 2012, 01:54:31 PM
BTW...you could use custom properties be able to edit the text in each section (without having to tunnel into the subshape and select text)

Assuming you want this for a variety of users, CP approach might be more user friendly.

No tunneling into the subshapes is required with this shape, just double-click on the appropriate section!
Electronic and Electrical engineering, business and software stencils for Visio -

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

PF4VisioGuy

#5
I am almost done with the Text Box and the vertical header
The next step would be to tie together three instances of this
The container would be ideal for this but I can not format it as I want, neither eliminate the space around my shapes..
Any suggestions?

PS: I thought I finished this but I was wrong.
A section shape is made of two shapes:
-TextBox
-a wider HeaderBox (the size of this one is linked to the size of the TextBox)

In order to correlate the position of the two shapes that make a section I used the PinX and PinY coordinates
Now moving the TextBox results in the repositioning of the HeaderBox which is the desired result

When I moved the TextBox in a Container, the HeaderBox followed.
For some reasons when, again, I moved the TextBox out of the container the HeaderBox stayed behind (the forrmula that I put in PinX and PinY disappeared)

PF4VisioGuy

Guard() is the answer for preserving the link

vojo

members first....got it...another way to go...thanks

vojo

PF4:   I think you are better off with either of the following
   
   My idea:   group them and use custom props to set values
   Pauls idea:   Group and set members first on the format screen in order to edit the subshapes directly

While guard() et al works fine...just means a fair amount of surgery if you ever want to change the size (and thus location of next subshape)....so unless end user
is proficient at visio, this will get messed up (since say adding another row of text in the middle box requires going into the shape sheet pinx/piny and manually updating the field for box below.)
(I guess you could get elegant and say shape N+1 Piny = guard (<shape N Piny - shape N height)...shape N+2 uses shape N+1 for shape N in N+2 Piny...etc)
(so if shape N got bigger in Y....shape N+1 would move "down" appropriately).

Ya know...there are probably 10 different ways to do this...so probably your preferences on how to solve are good enough.

PF4VisioGuy

Hi Vojo

Thanks for the suggestions
Using properties interrupts the flow of natural editing
I prefer to have the user click on the shape and be able to edit text, remove text on the spot

One mention here: I am the only expected user for this :-) I am going to use the shape for creating some cheat sheets

I am not sure that I understand Paul's suggestion, I am a total beginner with creating Visio shapes although I played with Visio for years now (network engineer, had to do lots of work with it). These being said I have to confess that Pauls directions need some clarifications.

BTW do you have any idea why when I click on ShapeName I see a name (TextBox2) but when I click on ShapeSheet the header of that window indicates a different name??

Paul Herber

Are you not using my Class shape as a starting point?
Electronic and Electrical engineering, business and software stencils for Visio -

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

PF4VisioGuy

No, I have created my shape
Your class seemed not to fit my requirements since the first box was not resizing with the text box at the top.
I needed to reduce that to one line

I am almost done, my shape does what I need but now I have to learn how to resize everything in case I need to delete one section
I guess it is going to be easy to create a two sections shape by deleting some code than to make "one to rule them all" :-)

Paul Herber

Quote from: PF4VisioGuy on February 09, 2012, 05:50:57 PM
I have to confess that Pauls directions need some clarifications.
My comments related purely to my original Class shape.
Electronic and Electrical engineering, business and software stencils for Visio -

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

PF4VisioGuy

Quote from: Paul Herber on February 09, 2012, 06:37:33 PM
Quote from: PF4VisioGuy on February 09, 2012, 05:50:57 PM
I have to confess that Pauls directions need some clarifications.
My comments related purely to my original Class shape.
I see. No problem... Thanks for trying to help.
Your Class shape gave what I needed: the idea...
thanks a lot
PF

PF4VisioGuy

Quote from: tommiller7782 on March 07, 2012, 03:00:21 PM
No tunneling back into the entire subshapes is actually required with this particular shape, merely double-click on the appropriate section!
Without knowing what tunneling means I can tell you that they work just fine as you indicated
The only problem that I have (and that I can live with) is that when the shapes were saved into the stencil they were grouped
Now every time when I use the resulting shape I have to ungroup the commponents in order to be able to use them by clicking on the appropriate one