Example of Entering and Displaying Multi-Line Justification
This example demonstrates displaying and modifying multi-line justification. The justification
defines the location of the multi-line relative to the vertices.
The AboutMLineJustify() function requires a value of the Mline::MlineJustification enumerator and returns
a string containing the comment about the passed multi-line justification as an OdString value. The function
declares a variable of the OdString type and uses the format() method to convert the justification code. Then
this function checks the passed justification code using the switch statement to select the comment which
must be attached to the result string.
The AboutMLineJustify() function has the following implementation:
The EntryMLineJustify() function requires a reference to a variable of a 16-bit Integer type in which the
selected multi-line justification must be saved as an argument and returns True if the user selects the
justification or False if the user cancels entry. The functions organize a loop that displays the list
of available justifications, and then, inquires about the number as an Integer value. The justifications can
take the following values:
0 — kTop
1 — kZero
2 — kBottom
After entry, the function checks whether the value
is in the range [0 to 2]. If the entry is incorrect or out of range, the function displays the error message
and repeats the loop. If the entry is correct, the function returns True as a resulting value and the selected
number through its own argument in the calling function. If the user selects [3], the function cancels entry
and returns False as a resulting value.
The EntryMLineJustify() function has the following implementation: