AFXTextField

This class contains a label that precedes a text field that allows the user to enter in text.


AFXTextField(p, ncols, labelText, tgt=None, sel=0, opts=AFXTEXTFIELD_STRING, x=0, y=0, w=0, h=0, pl=DEFAULT_PAD, pr=DEFAULT_PAD, pt=DEFAULT_PAD, pb=DEFAULT_PAD)

Constructor.

ArgumentTypeDefaultDescription
pFXComposite Parent widget.
ncolsInt Number of columns.
labelTextString Label string.
tgtFXObjectNoneMessage target.
selInt0Message ID.
optsIntAFXTEXTFIELD_STRINGOptions and hints.
xInt0X coordinate of origin.
yInt0Y coordinate of origin.
wInt0Width of the widget.
hInt0Height of the widget.
plIntDEFAULT_PADLeft padding (margin).
prIntDEFAULT_PADRight padding (margin).
ptIntDEFAULT_PADTop padding (margin).
pbIntDEFAULT_PADBottom padding (margin).


create()

Creates the text field.

Reimplemented from FXComposite.


disable()

Disables the text field.

Reimplemented from FXWindow.


enable()

Enables the text field.

Reimplemented from FXWindow.


getCheck()

Returns the state of the check button or the radio button.


getCursorPos()

Returns the cursor position.


getDefaultWidth()

Returns the default width of the text field.

Reimplemented from FXPacker.


getExponentType()

Returns the exponent type of the text field for real and complex types.


getImaginaryText()

Returns the imaginary text for the complex text field.


getLabelText()

Returns the label text.


getNumColumns()

Returns the number of columns.


getPrecision()

Returns the precision of the text field for real and complex types.


getText()

Returns the text.


getValueType()

Returns the value type (AFXTEXTFIELD_FLOAT, etc.) of the text field.


isEditable()

Returns TRUE if the text in the input field may be edited.


isReadOnlyState()

Returns TRUE if the text field appears in the read-only state.


isVerticalLayout()

Returns TRUE if the layout orientation is vertical.


setCheck(state)

Sets the state of the check button or the radio button.

ArgumentTypeDefaultDescription
stateInt Check state.


setCheckButtonSelector(sel)

Sets the message ID of the check button or the radio button.

ArgumentTypeDefaultDescription
selInt Selector.


setCheckButtonTarget(checkVal=FALSE)

Sets the message target of the check button or the radio button.

ArgumentTypeDefaultDescription
checkValIntFALSECheck state.


setCursorPos(pos)

Sets the cursor position.

ArgumentTypeDefaultDescription
posInt Position.


setEditable(edit=TRUE)

Sets the editable state for the text field.

ArgumentTypeDefaultDescription
editIntTRUEIf TRUE, text can be edited.


setExponentType(e)

Sets the exponent type of the text field for real and complex types.

ArgumentTypeDefaultDescription
eFXExponent Exponent type.


setFocus()

Moves the focus to the text field.

Reimplemented from FXWindow.


setFocusAndSelection()

Sets the focus to the input field and selects its contents.


setFocusToCheckButton()

Moves the focus to the check button or the radio button (if existed) of the widget.


setFocusToImaginaryTextField()

Moves the focus to the input field for the imaginary part.


setFocusToTextField()

Moves the focus to the input field of the widget.


setImaginaryFocusAndSelection()

Sets the focus to the input field for the imaginary part and selects its contents.


setImaginaryText(text)

Sets the imaginary text for the complex text field.

ArgumentTypeDefaultDescription
textString Imaginary text field text.


setLabelText(txt)

Sets the label text.

ArgumentTypeDefaultDescription
txtString Label text.


setNumColumns(cols)

Sets the number of columns. Note: The column width is based on the width of "m" of the font used.

ArgumentTypeDefaultDescription
colsInt Number of columns.


setPrecision(p)

Sets the precision of the text field for real and complex types.

ArgumentTypeDefaultDescription
pInt Precision.


setReadOnlyState(readonly=TRUE)

Sets the read-only state of the text field.

ArgumentTypeDefaultDescription
readonlyIntTRUERead-only state.


setSelection(pos, len)

Select the specified number of characters starting at given position.

ArgumentTypeDefaultDescription
posInt Position.
lenInt Length.


setText(text)

Sets the text in the input field.

ArgumentTypeDefaultDescription
textString Text field text.


setValueType(type)

Sets the value type (AFXTEXTFIELD_FLOAT, etc.) of the text field.

ArgumentTypeDefaultDescription
typeInt Value type.


setVerticalLayout(vertical)

Sets the layout orientation of the text field.

ArgumentTypeDefaultDescription
verticalInt Vertical flag.


Class flags

Message ID's.

ID_SETIMAGINARYVALUE

ID for setting imaginary values.

ID_GETIMAGINARYVALUE

ID for getting imaginary values.

ID_BUTTON

ID for the check/radio button.

ID_TEXT

ID for the text field.

ID_IMG_TEXT

ID for the text field with imaginary part.


Global flags

Flags for AFX textfield options.

AFXTEXTFIELD_STRING

Value field is a string.

AFXTEXTFIELD_INTEGER

Value field is an integer.

AFXTEXTFIELD_FLOAT

Value field is a double.

AFXTEXTFIELD_COMPLEX

Value fields consist of the real and imaginay components of a complex number.

AFXTEXTFIELD_CHECKBUTTON

Use a check button instead of a label.

AFXTEXTFIELD_RADIOBUTTON

Use a radio button instead of a label.

AFXTEXTFIELD_VERTICAL

Orient label or button above text field.

AFXTEXTFIELD_READONLY

Configure text field to the read-only state.