IT tutorials
 
Office
 

Developing Custom Microsoft Visio 2010 Solutions : Creating SmartShapes with the ShapeSheet (part 5) - Modifying the Text Block Using the ShapeSheet

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Product Key Free : Microsoft Office 2019 – Serial Number
4/17/2014 1:51:56 AM

Modifying the Text Block Using the ShapeSheet

If you select the notes shape and then start typing, you see that the text is centered and that the text block is as wide as the whole shape. This text belongs to the group itself, not to the box nor the arrow. You really want the text block to match the width of the arrow, and it should be right-aligned so that the text is aligned with the point of the arrow.

You could use the Text Block tool to make the text block less wide, but it would still size proportionally when we stretched the shape and wouldn’t line up properly. The text block needs to be exactly as wide as the arrow subshape. To do this requires the ShapeSheet.

Modifying the Text Block in the ShapeSheet
1.
Select your notes shape and then type some text. You should see center-aligned text, and the number in the Box should be unaffected.

2.
Right-align the text by selecting the notes shape, going to the Home tab, and clicking the Align Right button in the Paragraph group. Notice that when you do this, the number also is right-aligned. When you apply formatting to a grouped shape, all subshapes receive that formatting, too. Not always desirable.

3.
Press Ctrl+Z to undo Step 2.

4.
To right-align just the text for the group, select the group and then press F2. The text that you typed should be highlighted. Now you can click the Align Right button, and it affects only the group’s text block, not those of the subshapes. A sneaky trick, but it works!

5.
The text block is still as wide as the entire group, and the right alignment has sent the text a bit far into the point of the arrow. You need to edit the text block in the ShapeSheet, so show the ShapeSheet window for the Group.

6.
To control the size of the text block, you should edit cells in the Text Transform section. By default, this section doesn’t exist, however, because shapes use a default text block that exactly matches the size of the shape. To insert the Text Transform section, right-click anywhere in the ShapeSheet and then choose Insert Section.

7.
Check Text Transform in the dialog and then click OK. The Text Transform section is added to the ShapeSheet. Scroll to the lower-half of the ShapeSheet to find it. Here you can control the size, position and rotation of the text block via ShapeSheet expressions.

8.
Scroll down until you see the newly inserted Text Transform section and then modify three of the formulas as follows:

TxtWidth = GUARD(User.ArrowWidth-Height*0.5)
TxtPinX = GUARD(Width-Height*0.5)
TxtLocPinX = TxtWidth

The Text Transform cells govern the size and position of the text block inside a shape. Note how the TextPin and TextLocPin cells are analogous to Pin and LocPin cells of the shape. It is as if the Text is a subshape inside a group.

TxtWidth is the width of the actual text block. The formula above makes it as wide as the body of the Arrow minus the width of the arrow tip. This keeps the text from getting scrunched inside the point. The text’s local pin x is on the right at TxtWidth. The text’s pin is positioned where the head of the arrow begins, at Width - Height*0.5.

9.
As a convenience, you can configure the shape so that double-clicking enters text edit mode. To do this, select the Group and then click Behavior in the Shape Design group on the Developer tab.

10.
Click the Double-Click tab in the Behavir dialog. Check the Edit Shape’s Text radio button and then click OK to finish. Now double-clicking your notes shape will take you straight to the text.

11.
For some final spit-and-polish, protect the subshapes from being selected. This reduces confusion for users of your shape and also protects the subshapes from being inadvertently altered.

12.
Select the Group and click the Behavior button again. In the lower-right corner of the dialog is the Selection drop-down list. Select Group Only from this list and then click OK. The subshapes can no longer be selected. If you need to alter the subshapes, you can still open the group by right-clicking and then choosing Group, Open Group, but end-users are unlikely to do this.


 
Others
 
- Developing Custom Microsoft Visio 2010 Solutions : Creating SmartShapes with the ShapeSheet (part 4) - Linking Subshape Text to Shape Data Fields
- Developing Custom Microsoft Visio 2010 Solutions : Creating SmartShapes with the ShapeSheet (part 3) - Controlling Grouped Shapes with the ShapeSheet
- Developing Custom Microsoft Visio 2010 Solutions : Creating SmartShapes with the ShapeSheet (part 2) - Creating Smart Geometry in the ShapeSheet
- Developing Custom Microsoft Visio 2010 Solutions : Creating SmartShapes with the ShapeSheet (part 1) - Introducing the ShapeSheet
- Developing Custom Microsoft Visio 2010 Solutions : Introducing the Notes Shape, Using the Developer Ribbon Tab
- Microsoft Excel 2010 : Working with Graphics - Inserting Clip Art, Inserting a Picture from File
- Microsoft Excel 2010 : Working with Graphics - Using Drawing Tools
- Microsoft Excel 2010 : Automating Repetitive Tasks by Using Macros - Running Macros When a Workbook Is Opened
- Microsoft Excel 2010 : Automating Repetitive Tasks by Using Macros - Running Macros When a Button Is Clicked
- Microsoft Excel 2010 : Automating Repetitive Tasks by Using Macros - Creating and Modifying Macros
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
Technology FAQ
- Is possible to just to use a wireless router to extend wireless access to wireless access points?
- Ruby - Insert Struct to MySql
- how to find my Symantec pcAnywhere serial number
- About direct X / Open GL issue
- How to determine eclipse version?
- What SAN cert Exchange 2010 for UM, OA?
- How do I populate a SQL Express table from Excel file?
- code for express check out with Paypal.
- Problem with Templated User Control
- ShellExecute SW_HIDE
programming4us programming4us