ConceptDraw Smart Objects Lesson 1. Text Autoexpand
| |
Prev :: Content :: Next
|
This lesson is the first one in the series of lessons on ConceptDraw smart-objects. In the lessons we'll tell how to create and use such objects without using any programming.
In this lesson we'll learn to create an object that can automatically change its size depending on the properties of the text it contains. As the object's size can change more smoothly than the text size, it is the object that we fit to the text and not vice versa.


Suppose you would like to make the object's font size larger. In a regular object, text will override the object's borders with its size remaining unchanged, which is especially inconvenient at designing graphs, tables and diagrams. The size of a ConceptDraw smart-object will change automatically. This way you will be able, by selecting a group of objects, to change the font size and type with no worry that after this you will have to fit sizes of all the object's manually.
The easiest way to create such an object is to choose the required object or objects and use Tools\Text Auto Expand Mode in the menu or just press on the toolbar Font. At this the object will start getting larger if the text gets too large or there is too much of it.
In ConceptDraw there is also a function for automatic fitting of an object to the existing text. It may be useful if initially all the objects were of the same size, but in some of them there is too little text and an object looks too big. It may also help if a document contains many objects that need to be of the size as smaller as possible with no distortion of text in them. For this, select the required object or objects and use Shape\Fit to Text in the menu or just press on the toolbar Arrange&Make same.
Note that with the mode Text Auto Expand enabled your object will be constantly changing in size depending on the text unlike the command Fit to Text, which is a one-time one.
You can perform the same operations manually. This can be useful if you want your object to be proportionally bigger than the text and not of the possible minimum size. Suppose you need your object to always be twice as high and wide as the text it contains. We will further consider how to create such an object.
As the data on ConceptDraw objects is stored as tables, in order to create such an object we use Shape Parameter Table. Select the object to be edited, then use Shape\Show Table of the menu or just press F3 to switch to the mode of work with tables of properties of this object. In our case we'll need the tables Transform, Text Transform and Text Field. You can hide the unnecessary tables by double-clicking on the header of the corresponding table.
For more details on Shape Parameter Table, click here.


In the table Transform, to the fields Width and Height enter the values =TextWidth*2 and =TextHeight*2 accordingly.
Description of the functions.
_TEXTWIDTH(str)
Returns the width of the str string considering all the current text settings of the object (styles, indents and margins, etc.). Normally, this function is used for making the Text Box of the same width as the width of the longest string in the object's text.
Example:
_TEXTWIDTH(TheText)
_TEXTHEIGHT(str; arg)
This function calculates the height of the text block, when arg is assigned as its width. The str parameter is usually the contents of text field of the object (the TheText field in the table). When calculating the height, this function considers all current text settings for the object (styles, indents and margins, etc.).
Examples:
_TEXTHEIGHT(TheText;Width)
_TEXTHEIGHT(TheText;2 in)
For more details on the functions used in ConceptDraw click here.

These values are received from the table Text Transform

In this table, to the fields TextWidth and TextHeight enter the functions =_TEXTWIDTH(TheText) and =_TEXTHEIGHT(TheText;TextWidth) accordingly. TheText - is the text written in the object. This text can also be changed in the table Text Field.

After all the necessary changes have been made to the tables, press Apply and close the window Shape Parameter Table.

Your first ConceptDraw smart-object is now ready! Try to change the text's font size or add anything else to the existing text; you'll see how the object is changing according to the changes in the text.
Prev :: Content :: Next
|