DynaPDF Manual - Page 245

Previous Page 244   Index   Next Page 246

Function Reference
Page 245 of 839
Return values:
If the function succeeds the return value is the field handle, a value greater or equal zero. If the
function fails the return value is a negative error code.
CreateCheckBox
Syntax:
SI32 pdfCreateCheckBox(
const PPDF* IPDF,
// Instance pointer
const char* Name,
// Name of the check box (see note below)
const char* ExpValue, // Export value (required)
LBOOL Checked,
// If true, the check box appears checked
SI32 Parent,
// A parent group or radio button field or -1
double PosX,
// X-Coordinate of the button
double PosY,
// Y-Coordinate of the button
double Width,
// Width of the check box
double Height)
// Height of the check box
This function creates a check box. A check box can be a subfield of a radio button or of a group field
(see also CreateRadioButton(), CreateGroupField()). If the parameter Parent is -1 the check box is
creates as stand alone field.
The parameter Name is ignored if the check box is a sub control of a radio button field, it can be
NULL in the latter case. However, the name is required if the check box is used as stand alone field.
The parameter ExpValue defines the export value of the check box for the on state. This value is
exported if the state of the check box is on and if the form is submitted to a web server. The export
value must not be an empty string. The export value for the off state is always "Off".
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().
Check boxes use always the standard font ZapfDingbats to draw the check box symbol. It is not
possible to change the font but it is possible to use a custom font size. The font size is used from the
active font; the kind of font that is active is ignored. There is no need to set ZapfDingbats as active
font to enable the usage of a custom font size. The font size is calculated to an optimal value if the
size of the active font is set to 1 unit or if no font is active.
 

Previous topic: CreateButton

Next topic: CreateCIEColorSpace