<< Click to Display Table of Contents >> VpeFormField |
Creates a Form Field at the given position, using the number of character cells specified with VpeSetCharCount(). Accordingly, each character cell has the
width = ( (x2 - x) / CharacterCount) - max(DividerPenSize, AltDividerPenSize)
Example:
If x = 1 and x2 = 11, then the total width of the Form Field is 11cm - 1cm = 10cm. If CharacterCount = 10, then each character cell is 1 cm wide. Afterwards, VPE will subtract the pen size of the Divider or Alternative Divider - whichever is thicker - from the available cell width.
Additionally, the Form Field can compute a best matching font size itself (see VpeSetFormFieldFlags - VEDIT_FLAG_AUTO_FONTSIZE): since VPE computes the width of a single character cell, it will search for a font size so that the widest character of the font will best fit into the available cell width and height.
If y2 = VFREE, the height of the FormField will be computed accordingly to the height of the currently selected font. Moreover, if y2 = VFREE and VEDIT_FLAG_AUTO_FONTSIZE is used, VPE will compute the height of the Form Field accordingly to the width of a single character cell with the same algorithm as explained above. When computing the height, VPE will also consider the thickness of the bottom line, of course.
VpeCoord VpeFormField(
VpeHandle hDoc,
VpeCoord x,
VpeCoord y,
VpeCoord x2,
VpeCoord y2,
LPCSTR s
)
VpeHandle hDoc
Document Handle
VpeCoord x, y, x2, y2
position and dimensions of the FormField
LPCSTR s
the content string of the FormField
Returns:
the bottom y-coordinate generated by the output
Remarks:
•Do not misunderstand FormFields, they can't be used for data input by the user. They are intended to be used to display data.
(The VPE Interactive Edition offers objects for data input.)
•A Form Field can only consist of one single line of text, it can not have multiple lines.
•The text alignment can only be left or right.
•Form Fields can not be rotated.
•Form Fields do not fire AutoBreaks.
•If x2 = VFREE, the FormField will create a normal Plain Text Object as if VpeWrite(Box) was used.
•The bottom line will only be drawn, if the normal PenSize (used for lines, frames, etc.) is zero. If PenSize > 0, a FormField will have instead a surrounding frame (with the thickness of PenSize) as with VpeWriteBox().
•VPE offers several methods to attach an object's position to margins and relative to the position of previously inserted objects. In addition Text, Rich Text and Picture objects are able to compute their dimensions automatically depending on their visual content.
For details please see "Dynamic Positioning" in the Programmer's Manual.
"FormFields" in the Programmer's Manual