DynaPDF Manual - Page 404

Previous Page 403   Index   Next Page 405

Function Reference
Page 404 of 839
This function can be used to enumerate the choice values of a combo box, list box, or radio button. If
the field is a check box, the parameter ValIndex will be ignored and the export value and selected
state are returned. The parameters Value and ExpValue hold pointers to the original null-terminated
string values. These values must not be changed or freed in your application. Note that either the
parameter Value or ExpValue can be set to NULL depending on the field type.
To enumerate the choice values of a combo box or list box call GetFieldExpValCount() to determine
the number of available values. The parameter ValIndex can then be used to access each value /
export value pair within the array.
Beginning with PDF 1.5 choice values of combo and list boxes can be in Unicode format. Because
Unicode strings are not supported by this function the function GetFieldChoiceValue() should be
used to enumerate choice values of these field types.
Example (C++):
// aField is a handle of a combo box in this example; we want to
// deselect the currently selected value, that's all.
char* value, *expValue;
LBOOL selected;
SI32 valCount = pdfGetFieldExpValCount(pdf, aField);
for (SI32 i = 0; i < valCount; i++)
{
if (pdfGetFieldExpValueEx(pdf, aField, i, value, expValue, selected))
{
if (selected)
{
pdfSetFieldExpValue(pdf, aField, i, value, expValue, false);
break;
}
}
}
Remarks:
The parameters Value, ExpValue, and Selected require variables so that the values can be set by the
function. To change a choice value of a combo box or list box call the function SetFieldExpValue().
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.
 

Previous topic: GetFieldExpValueEx

Next topic: GetFieldFlags