AFXComTableKeyword

This class manages values which are sent as tables in a command.


AFXComTableKeyword(command, name, isRequired=False, minLength=0, maxLength=-1, opts=0)

Constructor.

ArgumentTypeDefaultDescription
commandAFXCommand Host command.
nameString Keyword name.
isRequiredBoolFalseTrue if this keyword is a required argument.
minLengthInt0Minimum (and default) row length.
maxLengthInt-1Maximum row length (-1 => unlimited).
optsInt0Options.


equal(index, a, b)

Returns True if the two table element values compare equal (index not used).

ArgumentTypeDefaultDescription
indexInt Element index (not used).
aString First value.
bString Second value.


getColumnStyle(index)

Returns the style of the column elements. Will never return AFXTABLE_STYLE_DEFAULT!

ArgumentTypeDefaultDescription
indexInt Column index.


getColumnType(index)

Returns the type of the column elements. Will never return AFXTABLE_TYPE_DEFAULT!

ArgumentTypeDefaultDescription
indexInt Column index.


getDefaultStyle()

Returns the default style for the table elements.


getDefaultType()

Returns the default type for the table elements.


getDefaultValues()

Returns the default values for this table.


getFormattedValue(row, column)

Returns the formatted value of the table element, suitable for placing in a command. If the element has AFXTABLE_EVALUATE style, and its contents are invalid, an exception will be thrown.

ArgumentTypeDefaultDescription
rowInt Row index.
columnInt Column index.


getMaxNumColumns()

Returns the maximum number of columns, or -1 for unbounded.


getMinNumColumns()

Returns the minimum number of columns.


getNumColumns(row)

Returns the number of columns in the row.

ArgumentTypeDefaultDescription
rowInt Row index.


getNumRows()

Returns the number of rows in the table.


getRow(row)

Returns a string with the contents of a table row.

ArgumentTypeDefaultDescription
rowInt Row index.


getTypeName()

Returns the name of the table keyword type.

Implements AFXKeyword.

Reimplemented in AFXTableKeyword.


getValue(row, column)

Returns the value of a table element.

ArgumentTypeDefaultDescription
rowInt Row index.
columnInt Column index.


getValueAsDouble()

Returns the keyword's value as a float; returns False upon failure.


getValueAsInt()

Returns the keyword's value as an integer; returns False upon failure.


getValueAsString()

Returns the formatted string that represents the current keyword value in a command.

Implements AFXKeyword.


getValueForBlank(column)

Returns the element value substituted for blank for the column.

ArgumentTypeDefaultDescription
columnInt Column index.


getValues()

Returns a string containing values of the tuple elements. as entered by the user.


getValuesForBlanks()

Returns a string with values substituted for blanks for all table columns.


insertColumns(index, numColumns)

Inserts columns starting at the given index.

ArgumentTypeDefaultDescription
indexInt Starting index.
numColumnsInt Number of columns to insert.


insertRows(index, numRows)

Inserts rows starting at the given index.

ArgumentTypeDefaultDescription
indexInt Starting index.
numRowsInt Number of rows to insert.


isValueChanged()

Returns True if the keyword value differs from its previous value.

Implements AFXKeyword.


removeColumns(index, numColumns)

Removes columns starting at the given index.

ArgumentTypeDefaultDescription
indexInt Starting index.
numColumnsInt Number of columns to remove.


removeRows(index, numRows)

Removes rows starting at the given index.

ArgumentTypeDefaultDescription
indexInt Starting index.
numRowsInt Number of rows to remove.


setColumnStyle(index, style)

Sets the style of the column elements.

ArgumentTypeDefaultDescription
indexInt Column index.
styleInt New column style.


setColumnType(index, type)

Sets the type of the column elements.

ArgumentTypeDefaultDescription
indexInt Column index.
typeInt New column type.


setDefaultStyle(style)

Sets the default style for the table elements.

ArgumentTypeDefaultDescription
styleInt New default style.


setDefaultType(type)

Sets the default type for table elements.

ArgumentTypeDefaultDescription
typeInt New default type.


setDefaultValues(values)

Sets the default values for this table.

ArgumentTypeDefaultDescription
valuesString Sequence string with default values.


setMaxNumColumns(length)

Sets the maximum number of columns.

ArgumentTypeDefaultDescription
lengthInt New maximum number of columns, or -1 for unbounded.


setMinNumColumns(length)

Sets the minimum number of columns.

ArgumentTypeDefaultDescription
lengthInt New minimum length.


setNumColumnsRange(minLength, maxLength)

Sets the allowable range for the number of columns.

ArgumentTypeDefaultDescription
minLengthInt New minimum number of columns.
maxLengthInt New maximum number of columns, or -1 for unbounded.


setRow(row, seq)

Sets the contents of a table row.

ArgumentTypeDefaultDescription
rowInt Row index.
seqString Sequence with elements.


setValue(row, column, value)

Sets the value of a table element.

ArgumentTypeDefaultDescription
rowInt Row index.
columnInt Column index.
valueString New value.


setValueForBlank(column, value)

Sets the element value substituted for blank for the column.

ArgumentTypeDefaultDescription
columnInt Column index.
valueString New value.


setValues(values)

Sets all values for the table elements.

ArgumentTypeDefaultDescription
valuesString Table string with new values.


setValuesForBlanks(values)

Sets the values substituted for blanks for all table columns.

ArgumentTypeDefaultDescription
valuesString String containing comma-separated values.


setValueToDefault(ignoreUnspecified=False)

Sets the keyword value to its default.

ArgumentTypeDefaultDescription
ignoreUnspecifiedBoolFalseShould ignore if default is an unspecified value.


setValueToPrevious()

Sets the keyword value to its previous value.

Implements AFXKeyword.


syncPreviousValue()

Sets the keyword's previous value to its current value.

Implements AFXKeyword.


Class flags

Message ID's.

ID_TABLE

ID for AFXTable widgets.

ID_VALUE

ID for widgets exchanging array strings.

ID_PRINTSNIPPET

For debugging.


Global flags

Flags for table options.

AFXTABLE_TYPE_ANY

Any type is accepted.

AFXTABLE_TYPE_DEFAULT

Column type is the same as the table default type.

AFXTABLE_TYPE_INT

Column stores integer numbers.

AFXTABLE_TYPE_FLOAT

Column stores floating-point numbers.

AFXTABLE_TYPE_STRING

Column stores string values.

AFXTABLE_TYPE_BOOL

Column stores True or False.

AFXTABLE_TYPE_MASK

Mask for column types.

AFXTABLE_ALLOW_EMPTY

Allow empty values for the column elements.

AFXTABLE_DEFAULT_IF_EMPTY

Always substitute the default for empty values.

AFXTABLE_EVALUATE

Evaluate integer and float elements.

AFXTABLE_STYLE_DEFAULT

Use table default column style.

AFXTABLE_STYLE_MASK

Mask for column styles.