Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

DynaPDF Manual - Page 223

Previous Page 222   Index   Next Page 224

Function Reference
Page 223 of 750
CreateComboBox
Syntax:
SI32 pdfCreateComboBox(
const PPDF* IPDF, // Instance pointer
const char* Name, // Name of combo box
LBOOL Sort,
// Sort the choice values
SI32 Parent,
// Parent group field or -1
double PosX,
// X-Coordinate of the combo box
double PosY,
// Y-Coordinate of the combo box
double Width,
// Width of the combo box
double Height)
// Height of the combo box
This function creates a combo box. The choice values of the combo box must be added with the
function AddValToChoiceField(). This function requires the field handle that was returned by this
function.
A combo box can contain value that is not included in the array of choice values. This value can be
used to display a string in the combo box when no choice value is selected, e.g. "Select a value!".
The field value can be set with the function SetFieldExpValue() as follows:
The parameter ValIndex of the function SetFieldExpValue() must be set to PDF_MAX_INT and the
parameter Value must contain the whished value or NULL. If Value is NULL or an empty string, a
maybe existing field value will be deleted. The choice values of the combo box get the state
unselected when setting a field value in this way.
If the coordinate system is bottom-up the point PosX, PosY defines the lower left corner of the button.
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 combo box are sorted if the parameter Sort is true.
A combo box requires a font. If no font is active the standard font Helvetica is used. Note: 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 combo 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.
 

Previous topic: CreateCollectionField

Next topic: CreateDeviceNColorSpace