30.07.2013 Views

T-FLEX Parametric CAD. Fundamentals. 2D Design

T-FLEX Parametric CAD. Fundamentals. 2D Design

T-FLEX Parametric CAD. Fundamentals. 2D Design

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Parametric</strong>ity of Custom Dialogs<br />

Control Elements. Creating User Defined Dialog Boxes<br />

In the course of reviewing this example, it was mentioned that control elements, just like other T-<strong>FLEX</strong><br />

<strong>CAD</strong> elements, possess general system parameters “Level”, “Layer”, etc. This allows creating parametric<br />

dialogs, whose appearance changes depending on the kind of a model.<br />

As an illustration to this statement, let's continue with the current example. Let's create a modification of the<br />

dialog. The respective file in the library of samples is “Sample parametric dialog.GRB”.<br />

Delete the elements “Preview” and “Picture” from the<br />

dialog page. Then select the group box of the deleted<br />

elements and double-click . In the coming up<br />

“Control Parameters” dialog box, modify the group box<br />

title by assigning the parameters “Caption” the string<br />

“Drawing Title”.<br />

Let’s place in this group box the control elements for<br />

handling the drawing title. The variable “flag_3”, “size”<br />

and $text will define, respectively, the visibility, size and<br />

text string of the title. To control the title visibility, the<br />

variable flag_3 needs just two values (“0” when the title is<br />

displayed, “-1” – title hidden). Therefore, let's create a<br />

“Check Box” control element for this variable.<br />

Position the control as shown on the diagram. In the window “Insert Variable”, select the variable flag_3. In<br />

the “Control Parameters” dialog box, assign the “Caption” parameter the string “Display Title”. Enter the<br />

value “0” for the parameter “On”, “-1” - for “Off”.<br />

Next, let's create control elements for defining the title font size. Since the variable "size" does not have a list<br />

of values, one can use an “Edit Box” control. In the window “Insert Variable”, select the variable "size". Put<br />

the explanation text “Font size:” before the control, using the “Static Text” element.<br />

The next step is creation of control elements for modifying the title text.<br />

The variable $text can be conveniently controlled by an “Edit Box” element as well. To provide support for<br />

defining a multiline title, turn on the flag “Multiline EditBox”, using the option . Then specify the<br />

element position and select the variable $text in the “Insert Variable” window.<br />

To go to the new line in the multiline editor, use the key combination . The<br />

control sequence “\n” can be used for separating lines as well.<br />

Put the explanation text “Text:” before the “Edit Box”<br />

control, using, as before, the “Static Text” element.<br />

Thus, we have created the interface for controlling the<br />

title text in our dialog. However, it is not yet parametric.<br />

Let's modify it in such a way that the control elements<br />

for modifying the font size and the title text string were<br />

displayed in the dialog only when the flag “Display<br />

Title” is turned on. To get this, let's relate the “Level”<br />

parameter of the relevant elements to the variable flag_3.<br />

Select by box the font size and the title string control<br />

elements and click .<br />

547

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!