Adding text in body area of Visio Container with Header

Started by Gavo, May 03, 2023, 11:41:24 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Gavo

In Visio I wish to create a single container shape (or similar) that has a header (like a normal Container with a Header) plus a text area in the box beneath the box.

In the example attached (showing 3 of these shapes connected) I have simply grouped two text boxes together but then I need to manually ungroup then regroup each time I change the bottom box height.

But what I want is for the overall shape height and width to be able to be changed (by dragging handles) without changing the height of the header (like a container with a header).

I am not a coder and do not understand ShapeSheet formulas except for editing Text Block Format padding values and font sizes.

Surrogate

#1
What do you mean as 'container shape'? Build-in containers or customer self-made containers...

https://techcommunity.microsoft.com/t5/microsoft-365-blog/custom-containers-lists-and-callouts-in-visio-2010/ba-p/237586

wapperdude

#2
Part of the confusion is your use of "container".  That is a specific object and not consistent with what you show or describe.  AFAIK, you cannot enter text directly into a container.

Not sure this helps, but take a look at my response (reply #7) in this thread:  http://visguy.com/vgforum/index.php?topic=7716.msg32901#msg32901
Visio 2019 Pro

Gavo

Thanks @wapperdude and @Surrogate

To clarify my question: the "Container" reference was in relation to the "fixed" height nature of the header whenever the overall object* is resized and not for the functionality of grouping other shapes together.

I have created this visual (using grouped shapes and manual grouping/ungrouping/regrouping before resizing!!!) to better illustrate what I am trying to do. Please see for reference numbers:

1.1.1 = Default object appearance (single line of text) and overall object handles.
1.2.1 = Showing the body area auto-height resizing with additional lines of text.
1.3.1 = Same as 1.2.1 but with additional lines added to the Header and Body area.

1.1.2 = 1.1.1 if the object is widened by dragging handles (text reflows and height auto adjusts).
1.2.2 = 1.2.1 if the object is widened by dragging handles (text reflows and height auto adjusts).
1.3.2 = 1.3.1 if the object is widened by dragging handles (text reflows and height auto adjusts).

1.1.3 = 1.1.1 if the object is narrowed by dragging handles (text reflows and height auto adjusts).
1.2.3 = 1.2.1 if the object is narrowed by dragging handles (text reflows and height auto adjusts).
1.3.3 = 1.3.1 if the object is narrowed by dragging handles (text reflows and height auto adjusts).

1.4.1 = Shape snapping back to the default size (max height = auto height) when content deleted from 1.3.1.

1.5.1 = Shape snapping back (or having vertical resize locked from manual edit) so the max or minimum height = auto height) when corner or top/bottom handles attempt to increase/decrease the height of 1.3.2.

Notes:

* I am not sure whether to call this an OBJECT, SHAPE or STENCIL???

I have tried this but got (a) unexpectant extra space beneath the text, (b) the formula being overriden when the the shape was manually resized and (c) did not work when grouping two boxes together: https://superuser.com/questions/844750/how-to-have-an-auto-fit-content-textbox-in-visio-2013

wapperdude

#4
Very nice presentation.  I believe the attached meets all of your requirements.
Visio 2019 Pro

Gavo

Quote from: wapperdude on May 04, 2023, 06:36:53 PM
Very nice presentation.  I believe the attached meets all of your requirements.

Brilliant. Perfect. So how can I make this happen? remember I am not a coder but can copy and paste code if given clear instructions - DOH!

wapperdude

No code.  It's all done in shapesheet.  Also, if you want to group, you may.  The only benefit I see is with respect to copy / paste.  If you do group, set behavior such that the two shapes are selected before the group to facilitate entering text.  Other than that, individual shape behavior is unaffected.
Visio 2019 Pro

Gavo

Quote from: wapperdude on May 05, 2023, 12:37:49 AM
No code.  It's all done in shapesheet.  Also, if you want to group, you may.  The only benefit I see is with respect to copy / paste.  If you do group, set behavior such that the two shapes are selected before the group to facilitate entering text.  Other than that, individual shape behavior is unaffected.

Cool. So where do I start. Is there an existing Shape that I can download that has all the Shapesheet configurations already set-up (because I have NO IDEA about wiring code/functions in Shapesheet)? Sorry am I missing something?

Gavo

Quote from: wapperdude on May 04, 2023, 06:36:53 PM
Very nice presentation.  I believe the attached meets all of your requirements.

I figured out this was downloadable. It is awesome!

2 questions:
1. How do I add it to a stencil because it is hard to move/clone together as a group?
2. Can we disable the manual height resizing (like your other example on the other post) so it just resizes its height based on the text?

Surrogate

Quote from: Gavo on May 05, 2023, 01:49:42 AMI have NO IDEA about wiring code/functions in Shapesheet
ShapeSheet have a syntax very similar to Excel formulas.
Quote from: Surrogate on February 05, 2018, 10:25:20 AM
In MS Visio 2013/2016 have about 210 functions in ShapeSheet environment.

And many newbies have problems when they search function which they need!

Hope my list of functions by categories could help to many peoples learn more about ShapeSheet™.
Finding the function you are interested in in the list of functions of a particular category is much simpler than in the full function list.
Each category contains a list of the functions included in it, a description and a syntax of each function.
For more detailed information, please click hyperlink Read more about function <XXX>

wapperdude

#10
Quote2 questions:
1. How do I add it to a stencil because it is hard to move/clone together as a group?
2. Can we disable the manual height resizing (like your other example on the other post) so it just resizes its height based on the text?
Q1:  As it exists, just select the header shape and drag to wherever you want it.  Very easy.  To duplicate, select both shapes than either <cntl> + d or do copy/paste.  Drag to wherever.  You can drag onto a stencil that is open for editing.  This will create a group automatically.  Then when you drag and drop, the two shapes already grouped. 
You can leave it grouped or ungroup it, whichever you prefer.  No functionality is lost by ungrouping...ignore the warning.

Q2:  Will provide updated shapes tomorrow.

Ed. Note:  the alignment box for the group does NOT automatically update as the height of the text shapes changes.
Visio 2019 Pro

wapperdude

As promised, grouped shapes.  See 2nd page of the attached file.

Also, the modified shape no longer accepts manual user inputs to change the shape heights.  These are strictly controlled by the entered text.

A side benefit is that the group alignment box can now be set to track the height changes of either/both child shapes.

You can drag/drop these two versions to a stencil of choice.  Or, fetch them from the Document stencil.  Or, create a "mock stencil" using a background page.  Todo so, create a background page.  Copy/paste either/both shapes to this page.  That's it.  As need arises, to get a copy for placement, go to background page and copy.  Goto drawing page and paste.  Note, do NOT reference this background page via any normal page.  That way, it's contents will remain hidden.

You could save this as a template, perhaps with all regular page(s) empty.  Just a thought.
Visio 2019 Pro

Gavo

Quote from: wapperdude on May 05, 2023, 05:11:00 PM
As promised, grouped shapes.  See 2nd page of the attached file.

Also, the modified shape no longer accepts manual user inputs to change the shape heights.  These are strictly controlled by the entered text.

A side benefit is that the group alignment box can now be set to track the height changes of either/both child shapes.

You can drag/drop these two versions to a stencil of choice.  Or, fetch them from the Document stencil.  Or, create a "mock stencil" using a background page.  Todo so, create a background page.  Copy/paste either/both shapes to this page.  That's it.  As need arises, to get a copy for placement, go to background page and copy.  Goto drawing page and paste.  Note, do NOT reference this background page via any normal page.  That way, it's contents will remain hidden.

You could save this as a template, perhaps with all regular page(s) empty.  Just a thought.

Thank you. You are a genius!

I am going to use this to create and share a template to document Power Automation designs. Stay tuned...

I might need a hand with an editable Title bar (so a Background page won't work) with multiple columns that auto-fits full width but has a fixed top right corner element...

I'll create a separate post for this as I have seen others ask for this but never an easy solution...

wapperdude

Here's a nice video giving an overview concerning background pages:  https://support.microsoft.com/en-us/office/video-add-a-background-to-a-drawing-page-2b62f224-4b25-4c61-9e8f-426b63d21af5

There is much more related to this topic, the finer, detailed brush strokes.  What the video omits:  right click on a page tab brings up some short cuts.  One is Page Properties which is quite useful. 

Another point, A background page can have a background.  For example all pages have same footer info.  But some pages have a header, others don't.  Some may have both, plus a watermark.  Since any page can only reference a single bkgnd page, a possible way would be to create a separate background page for each of the 3 types of backgrounds.  Then, assign the footer to the header as its bkgnd page, and to the watermark  assign the header as its bkgnd.  Confusing???  As example:
  First page might be a Title page with no backgrounds
  Drawing page2:  just the footer bkgnd.
  Pages 3&4:  has the header bkgnd and thus shows both header and footer info
  Page5: has watermark, thus shows the watermark, the header, and the footer.

The point was that backgrounds can have backgrounds and sometimes that can be advantageously exploited...with discretion.
Visio 2019 Pro

Gavo

Quote from: wapperdude on May 06, 2023, 03:04:29 PM
Here's a nice video giving an overview concerning background pages:  https://support.microsoft.com/en-us/office/video-add-a-background-to-a-drawing-page-2b62f224-4b25-4c61-9e8f-426b63d21af5

There is much more related to this topic, the finer, detailed brush strokes.  What the video omits:  right click on a page tab brings up some short cuts.  One is Page Properties which is quite useful. 

Another point, A background page can have a background.  For example all pages have same footer info.  But some pages have a header, others don't.  Some may have both, plus a watermark.  Since any page can only reference a single bkgnd page, a possible way would be to create a separate background page for each of the 3 types of backgrounds.  Then, assign the footer to the header as its bkgnd page, and to the watermark  assign the header as its bkgnd.  Confusing???  As example:
  First page might be a Title page with no backgrounds
  Drawing page2:  just the footer bkgnd.
  Pages 3&4:  has the header bkgnd and thus shows both header and footer info
  Page5: has watermark, thus shows the watermark, the header, and the footer.

The point was that backgrounds can have backgrounds and sometimes that can be advantageously exploited...with discretion.

Thank you again. Gulp. Yes it does look a bit confusing (well, it is Microsoft after all) but I'll take a deep dive using your tips as a guide and see how I go.