DynaPDF Manual - Page 281

Previous Page 280   Index   Next Page 282

Function Reference
Page 281 of 839
CreateListBox
Syntax:
SI32 pdfCreateListBox(
const PPDF* IPDF, // Instance pointer
const char* Name, // Name of the list box
LBOOL Sort,
// Sort the choice values?
SI32 Parent,
// Parent group field if any or -1
double PosX,
// X-Coordinate of the list box
double PosY,
// Y-Coordinate of the list box
double Width,
// Width of the list box
double Height)
// Height of the list box
This function creates a list box. The choice values of the list box must be added with the function
AddValToChoiceField(). This function requires the field handle that was returned by this function.
If the coordinate system is bottom-up the point PosX, PosY defines the lower left corner of the list
box. If the coordinate system is top-down it defines the upper left corner.
Like all form fields, the width and height is measured incl. the line width of the border. The size of
normal vector graphics is measured without the line width; this must be taken into account when
calculating the width or height of a form field. The line width of the border is derived from the
current graphics state (see SetLineWidth()), it should be either 0, 1, 2, or 3 units (no border, thin,
medium, or thick). The border style can be changed with the functions SetBorderStyle() or
SetFieldBorderStyle().
The values of the list box are sorted if the parameter Sort is true. List boxes support multiple selected
values. To enable multi selection add the flag ffMultiSelect to the field (see SetFieldFlags() for
further information).
A list box requires a font. If no font is active the standard font Helvetica is used. Note that if the
form must be compatible to Acrobat 4, the used fonts by the form fields must be restricted to the 14
standard fonts (see SetFont() for further information). Acrobat 4 does not support interactive forms
that use other fonts than the 14 standard fonts. Such a form requires Acrobat 5 or higher.
Form fields support natively the code pages 1252 and MacRoman. However, other code pages and
Unicode can be used too as long as a few external cmaps are available. See SetFieldFont() for further
information.
The font size of a list box is set to "auto" if either the font size of the active font is set to 1.0 unit or if
no font is active when the field is created.
A text field can be formatted and the allowed input values can be restricted to specific data formats.
See SetDateTimeFormat(), SetNumberFormat() for further information.
 

Previous topic: CreateLaunchActionEx

Next topic: CreateNamedAction