A3DPDFScrollTableData
Fields
|
|
Detailed Description
-
struct A3DPDFScrollTableData
Structure to define a ScrollTable widget.
The frame of the scroll table is defined with a grid using parameters m_iGridNbRows, m_iGridNbCols, m_iGridHeightCells, m_piGridWidthCells.
The table header must be defined outside of this function if the layout requires one.
Rich text can be specified in a scroll table. This allows you to apply styling information to portions of the text, such as bold or italic. To do this, the boolean A3DPDFTextFieldData::m_bAllowRichText must be set to TRUE in m_pCellFormat. If m_pCellFormat specifies rich text formatting, then ALL the texts in the table bound to this scrollbar MUST BE defined as rich texts, that is to say they need to be formatted as in the following example.
Text fields first take the format specified in m_pCellFormat, then attributes might be overloaded with the rich text formatting. For example, “text-align” specified in xml style attribute overrides the alignment specified in A3DPDFTextFieldData.m_eTextAlignment.<?xml version="1.0"?> <body xfa:APIVersion="Acroform:2.7.0.0" xfa:spec="2.1" xmlns="http://www.w3.org/1999/xhtml" xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0"> <p style="margin-top:0pt;margin-bottom:0pt;text-align:center;font-family:Arial;font-size:10pt;color:#000000"> My Text </p> </body>
A scroll table must be bound to a data table with a map that has the same size of the number of columns: the parameter piMapColumns in A3DPDFScrollTableBindToTable should be equal to m_iGridNbCols.
The content of scroll table columns can be texts, images, or checkboxes. The column types must be set with m_peColumnTypes.
For columns of type kA3DPDFImageContent, the data table must contain an icon id, such as returned by the function A3DPDFDocumentAddImageAsIcon2.
For columns of type kA3DPDFCheckBoxContent, the data is generally not set at initialization, but modified at runtime by the user reading the PDF file. The runtime values can be retrieved by a javascript function defined on the document object:
wheregetScrollTableDataForCheckedRows(scrolltableuuid, idxcolcheckboxinscrolltable)
scrolltableuuid is the scrolltable unique id, it can be retrieved with the API A3DPDFWidgetGetName
idxcolcheckboxinscrolltable is the index of column to be checked in the scrolltable
The function returns a table object with an extract from the data table of the checked rows. This table object has members: nbrows, nbcols, and data.
Also for a column of type kA3DPDFCheckBoxContent, the function A3DPDFCheckBoxSetForCheckAllColumn can be used to associate a ‘check/uncheck all’ functionnality with an additional CheckBox, created separately. This checkbox is automatically unchecked as soon as the user checks a check box in the associated column. Also, it might be useful for a better user experience to uncheck all data column when the associated process is terminated. For this, a javascript function is defined on the document object:// (pcSTName: returned by A3DPDFWidgetGetName) // (idxColCheckBox: index of column with checkboxes in the scroll table) var tablecheckedrows = this.getScrollTableDataForCheckedRows('"' + pcSTName + '", "' + to_string(idxColCheckBox) + '"'); for (i=0;i<tablecheckedrows.nbrows;i++) rowscheckedforcol0.push(tablecheckedrows.data[i][0]);
whereuncheckAllScrollTableData(scrolltableuuid, idxcolcheckboxinscrolltable)
scrolltableuuid is the scrolltable unique id, it can be retrieved with the API A3DPDFWidgetGetName
idxcolcheckboxinscrolltable is the index of column to be unchecked in the scrolltable
whereenableScrollTableCheckBoxes(scrolltableuuid, idxcolcheckboxinscrolltable, enable)
scrolltableuuid is the scrolltable unique id, it can be retrieved with the API A3DPDFWidgetGetName
idxcolcheckboxinscrolltable is the index of column to be enabled/disabled in the scrolltable
enable is a boolean, which must be ‘true’ to enable all checkboxes of the specified column, and ‘false’ to disable all checkboxes
- Version
10.0
- Retval A3D_SUCCESS:
- Return:
A3D_SUCCESS in case of success or an error code
Public Members
-
A3DInt32 *m_piGridWidthCells
Array of the widths of the cells. The array must be of size m_iGridNbCols.
-
A3DInt32 m_iSliderWidth
The width of the scroll bar (in points). Important: The scrollbar is positioned on the right of the table, outside of the frame. Specify 0 to not have a scroll bar.
-
A3DPDFTextFieldData *m_pCellFormat
Optional. Defines the text field format for scroll table cells. If NULL, default format is used (black centered Arial text of font size 10, on white background).
-
A3DPDFRgbColorData *m_pHighlightColor
Optional. Color to highlight a row. If NULL, default color is used (same color as Acrobat fields highlighting).
-
A3DPDFEColumnType *m_peColumnTypes
Array of the types of the cells. The array must be of size m_iGridNbCols. If NULL, all cells are of kA3DPDFTextContent type.