News:

Happy New Year!

Main Menu

shape text block outline

Started by gabriel.negrea, December 12, 2024, 02:24:04 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

gabriel.negrea

Hello. Is there a way to add an outline for a shape's text block?

Yacine

Certainly, because a text block is only a shape with a rectangle geometry, but with a noLine line pattern.
You can use both the UI and code to change that. Give your text box a line color to get an outline.

Now you may want to get an outline that matches exactly the size of your text. In this case you'll need to write some formulas in the shapesheet of your textbox.

e.g.:
width = textwidth(thetext,1)
height = textheight(thetext, 1)

But the possibilities are near endless. Have a look at: https://www.visguy.com/2009/05/06/top-twelve-text-tips/
Yacine

gabriel.negrea

wow, you make it sound so easy. Thanks for your quick answer. I could not find anywhere in the UI a line color setting. Also, maybe I was misunderstood, I mean that one text block "attached" to the shape and not an independent text block. To be more specific, I have a set of shapes and each one needs to have an editable label which could be repositioned around the shape with the text box tool.

wapperdude

Further clarification questions...
   1) you want a border around the label?  Presume "yes" is the answer.
   2) do you also want additional text inside the shape?
   3) if (2) = yes, then do label and text have independent characteristics, e.g. font size, font style, font face?

In order to do all not those in context of a single shape, that shape needs to be a grouped shape.
Visio 2019 Pro

Yacine

@Wayne, you're absolutely right. But funny idea, a macro could add a geometry section that would build a rectangle and insert in it formulas following the extends of the text block.
No group, but a macro.
Caveat, you're not flexible when it comes to formatting (line, filling, etc.) because these properties are applied to the whole shape.
Yacine

Nikolay

#5
If you mean, like a built-in feature to have visible outline of the shape's built-in text box, then no, there is no such feature.

You can emulate that if you want to like others suggest, by creating a geometry section for example or creating a grouped shape.
But there is no built-in feature to make the text box border visible.

If the purpose is to allow user easy reposition of the text, then a common solution to that is adding a control point (a "yellow dot" thing) to the shape.
The "text box" feature is considered advanced, and most users are not aware of it, actually. Control points are much more common.

wapperdude

#6
@Yacine:  my post was trying to get additional info.
Quoteyou're not flexible
. Don't understand this statement. A single, multi-geometry shape absolutely has identical formatting characteristics.  Whereas, a grouped shape allows selection of individual subshapes, thus the ability for unique, individual formatting.  Use of guard fcn can isolate from top level format settings.  But you know that...so, I don't understand your point.
Visio 2019 Pro

Yacine

Sorry for the unclear wording.
I meant, with a multi-geometry solution the formatting is not flexible.

That happens when I don't use AI to correct my posts.  ;D
Yacine

wapperdude

Visio 2019 Pro

gabriel.negrea

Quote from: Nikolay on December 13, 2024, 12:59:29 PMIf you mean, like a built-in feature to have visible outline of the shape's built-in text box, then no, there is no such feature.

yes Nikolay, that is what I mean. It's too bad that such a feature does not exist. The purpose of this was for the user to have a single entity and not get confused by the control box of the group which remains as the original group and does not update as the text block component gets moved.
Honestly I was hoping some styles modification that would force that outline.
Thank you all for your effort.

Nikolay

#10
I think the "text block" is used maybe by 1% of users, it is a really rarely used feature. Did you have a chance to look at the stock visio shapes? They are all open, maybe you can pick some and copy it's behavior.

I mean, the "text block" does not really seem to be a user feature. A "simple" user is not supposed to manipulate it. Why do you want users to manipulate text blocks inside of the shape? I mean, I suspect this may be a XY-problem

Yacine

@Gabriel, this small tool could be the answer to your problem.
https://visguy.com/vgforum/index.php?topic=6318

The inserted sub-shapes have no formatting yet, but this is very easy to modify - either manually or by code.
You can even modify the code to put several properties in one sub-shape.
Or - let's get fancy - take the text of the shape, hide it and insert it in the sub-shape.
Yacine

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: 350 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1207KB.
Tokens: post-login.
Cache hits: 14: 0.00205s for 26,602 bytes (show)
Cache misses: 3: (show)
Queries used: 16.

[Show Queries]