wxformedittext
Description
A wxformedittext object is an area of a form where a piece of text is displayed, and the user can enter or modify that text.
Type Tags
wxformcontrol
Object Value
Properties
Property | Type | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
_ | type(*) | This property is provided for use by the user to attach any object of any type to the type in which this property is provided. | ||||||||||
__ | type(*) | This property is provided for use by the user to attach any object of any type to the type in which this property is provided. It has the additional feature of being marked with the resolve keyword, so that object resolution can continue down this property. | ||||||||||
alignment | string |
The alignment of the content of the control. This will either be
"left" , "right" , or
"" if the content is centered. This must be set at
the time the control is created.
| ||||||||||
backgroundrgb | rgb | Gives the color of the background of the edit control. | ||||||||||
captureable | boolean |
Specifies whether or not the control events can be captured by the form when
the controlcapture() method is called.
| ||||||||||
editstyle | string |
The edit style of the control. This will be any combination of:
"" , "hscroll" ,
"multiline" , "readonly" , and
"password" . For details on the valid and/or usable
combinations, see the section about the
addcontrol() method of the
wxform type in: the section called “wxform”.
| ||||||||||
enabled | boolean | Specifies whether or not the control is enabled. | ||||||||||
focusable | boolean |
Specifies whether or not the control can have the input focus. For
wxformedittext objects this is always
.true .
| ||||||||||
font | wxfont | This is a reference to the wxfont object that describes how the text in the control is formatted. | ||||||||||
form | wxform | Specifies the wxform object to which this edit control belongs. | ||||||||||
height | integer | Gives the height of the edit control, in pixels. | ||||||||||
left | integer | Gives the position of the left side of the edit control relative to the left side of the form, in pixels. | ||||||||||
maxlength | integer | Specifies the maximum length of the text allowed in the control. | ||||||||||
name | string | The name of the wxformedittext object. | ||||||||||
next | type(wxformcontrol) |
Specifies the next wxformcontrol on the same form.
| ||||||||||
onchange | event |
An event that is triggered when the content of the edit control changes. The
event handling function will receive the following parameters:
(wxformedittext me[, type(*) reference]). The reference is only
passed if it is provided by the user. To get the current content of
the control, use the gettext() method. The
value of the text property is not modified until
after the onlostfocus event has returned.
| ||||||||||
ongotfocus | event | An event that is triggered when the edit control receives input focus. The event handling function will receive the following parameters: (wxformedittext me[, type(*) reference]). The reference is only passed if it is provided by the user. | ||||||||||
onlostfocus | event | An event that is triggered when the edit control loses input focus. The event handling function will receive the following parameters: (wxformedittext me[, type(*) reference]). The reference is only passed if it is provided by the user. | ||||||||||
onmouse | event |
An event that is triggered each time a mouse event occurs that matches
the bits set in the onmousemask property. The
onmouse event handling function should be defined as follows:
| ||||||||||
onmousemask | integer | Holds the mask that decides which mouse events are captured and sent to the onmouse event handler. | ||||||||||
text | string |
The current text for the wxformedittext object, which is
displayed on the form. During editing and also during any
onlostfocus event for this edit control the
text property is still set to the original text of
the control, before editing started. The gettext
method can be used to retrieve the new text which the user has
entered into the control.
| ||||||||||
textrgb | rgb | Gives the color of the text in the control. | ||||||||||
tooltip | string | Contains the test that is displayed as a tooltip for the control. | ||||||||||
top | integer | Gives the position of the top edge of the edit control relative to the top edge of the form, in pixels. | ||||||||||
type | type | Specifies the wxformedittext type object. | ||||||||||
visible | boolean | Specifies whether or not the control is visible. | ||||||||||
width | integer | Gives the width of the edit control, in pixels. |
Methods
getinsertionpoint()
Description
Gets the current position within the text contained by the control where the cursor is located.
Prototype
wxformedittextvar
.getinsertionpoint
(
integer
)
insertionpoint
Parameters
Parameter | Default value | Type name | Description |
---|---|---|---|
insertionpoint | None | integer | This parameter must be a pre-initialized integer variable. It will be assigned the current position within the text in the edit control where the cursor is located. |
getselection()
Description
Returns the starting and ending positions of the selected text in the control.
Prototype
wxformedittextvar
.getselection
(
integer
,
integer start
)
end
Parameters
Parameter | Default value | Type name | Description |
---|---|---|---|
start | None | integer |
This must be a pre-initialized integer variable. It will contain the starting
position of the selected text in the edit control. If no text is
selected, it will return the value .nul .
|
end | None | integer |
This must be a pre-initialized integer variable. It will contain the ending
position of the selected text in the edit control. If no text is
selected, it will return the value .nul .
|
gettext()
Description
Gets the most recent text for the control. During editing and also during any
onlostfocus
event for this edit control the
gettext
method will retrieve the current text
visible in the control. The text
property can be
used to access the original text which was in place before editing
began.
Prototype
wxformedittextvar
.gettext
()
Parameters
None
remove()
Description
Removes the control from the form. If any object has a reference to the control, those references will no longer be valid. It is not safe to attempt to use a control after this method has been called.
Prototype
wxformedittextvar
.remove
()
Parameters
None
setbackgroundrgb()
Description
Sets the background color of the edit control. The wxformedittext
object itself is returned, to allow multiple setting methods to be
put into one expression. It is an error to specify both the
rgb
argument and one or more of the
red
, green
or
blue
arguments.
Prototype
wxformedittextvar
.setbackgroundrgb
(
integer
,
integer rgb
,
integer red
,
integer green
)
blue
Parameters
Parameter | Default value | Type name | Description |
---|---|---|---|
rgb | The current value of the backgroundrgb
property | integer | The new background color of the edit control. It is inadvisable to specify any value for this argument that is not the value of an existing rgb object. |
red | The current value of the backgroundrgb.red
property | integer | The red component in the new background color of the edit control. This must be between 0 and 255 inclusive. |
green | The current value of the backgroundrgb.green
property | integer | The green component in the new background color of the edit control. This must be between 0 and 255 inclusive. |
blue | The current value of the backgroundrgb.blue
property | integer | The blue component in the new background color of the edit control. This must be between 0 and 255 inclusive. |
setcaptureable()
Description
This method is used to determine whether the events for the control can be captured and passed to the form or not. By default, events can be captured.
Prototype
wxformedittextvar
.setcaptureable
(
boolean
)
captureable
Parameters
Parameter | Default value | Type name | Description |
---|---|---|---|
captureable | None | boolean |
Sets whether or not the events for this control can be captured by the form
using the controlcapture() method of the
form.
|
setenabled()
Description
Sets the enabled state of the edit control. The wxformedittext object itself is returned, to allow multiple setting methods to be put into one expression.
Prototype
wxformedittextvar
.setenabled
(
boolean
)
enabled
Parameters
Parameter | Default value | Type name | Description |
---|---|---|---|
enabled | None | boolean | The desired enabled state for the edit control. |
setfocus()
Description
Sets focus to the control, provided that it is not invisible or disabled. If this is called for a form that is not yet in a container, then nothing will happen except that the focuscontrol of the wxform object will be set. Once the form is placed in a container, the control will get focus and the ongotfocus event will fire. The wxformedittext object itself is returned, to allow multiple setting methods to be put into one expression.
Prototype
wxformedittextvar
.setfocus
()
Parameters
None
setfont()
Description
Sets the font to be used for the text in the edit control. The wxformedittext object itself is returned, to allow multiple setting methods to be put into one expression.
Prototype
wxformedittextvar
.setfont
(
wxfont
)
font
Parameters
Parameter | Default value | Type name | Description |
---|---|---|---|
font | None | wxfont | The wxfont object that will be used to format the text. |
setinsertionpoint()
Description
Sets the position within the text contained by the control where the cursor should be located. The wxformedittext object itself is returned, to allow multiple setting methods to be put into one expression.
Prototype
wxformedittextvar
.setinsertionpoint
(
integer
)
insertionpoint
Parameters
Parameter | Default value | Type name | Description |
---|---|---|---|
insertionpoint | None | integer |
This is the position within the text in the edit control where the cursor is
to be placed. To place the cursor at the end, enter a value that
is equal to or greater than the length of the content, or use the
value .inf . To place the cursor at the
beginning, use the value 0 .
|
setmaxlength()
Description
Sets the maximum length of the text that will be accepted by the control. The wxformedittext object itself is returned, to allow multiple setting methods to be put into one expression.
Prototype
wxformedittextvar
.setmaxlength
(
integer
)
maxlength
Parameters
Parameter | Default value | Type name | Description |
---|---|---|---|
maxlength | None | integer |
This is the maximum length of text that the edit control should allow the user
to enter. To allow any amount, use the value
.inf . Setting this value does not affect any
text that may already be in the control.
|
setname()
Description
Sets the name of the edit control. The wxformedittext object itself is returned, to allow multiple setting methods to be put into one expression.
Prototype
wxformedittextvar
.setname
(
string
)
name
Parameters
Parameter | Default value | Type name | Description |
---|---|---|---|
name | None | string | The new name for the edit control. |
setnext()
Description
Sets the position of the control in the z-order and tab order.
Prototype
wxformedittextvar
.setnext
(
type(wxformcontrol)
)
next
Parameters
Parameter | Default value | Type name | Description |
---|---|---|---|
next | None | type(wxformcontrol) |
Calling the method with the value .nul sets a control to be
the last one in the ring (the one before form.firstcontrol) and
so has the highest z-order, and passing any other control as the
argument puts the target control immediately below the one
specified as the parameter. The visible stacking of controls on a
form is such that the earliest in the ring is the furthest back
in the z-order.
|
setonmousemask()
Description
Sets the mask that is used to decide which mouse events will be trapped for the control. The wxformedittext object itself is returned, to allow multiple setting methods to be put into one expression.
Prototype
wxformedittextvar
.setonmousemask
(
integer
)
onmousemask
Parameters
Parameter | Default value | Type name | Description | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
onmousemask | None | integer |
The definition of which events should be handled by the onmouse event
handler. The
|
setposition()
Description
Sets the size and/or position of the edit control. The wxformedittext object itself is returned, to allow multiple setting methods to be put into one expression.
Prototype
wxformedittextvar
.setposition
(
integer
,
integer left
,
integer top
,
integer width
)
height
Parameters
Parameter | Default value | Type name | Description |
---|---|---|---|
left | The current value of the left property | integer | The new position of the left side of the edit control on the form. |
top | The current value of the top property | integer | The new position of the top edge of the edit control on the form. |
width | The current value of the width property | integer | The new width of the edit control on the form. |
height | The current value of the height property | integer | The new height of the edit control on the form. |
setselection()
Description
Selects the text contained by the control within the range specified. The wxformedittext object itself is returned, to allow multiple setting methods to be put into one expression.
Prototype
wxformedittextvar
.setselection
(
integer
,
integer start
)
end
Parameters
Parameter | Default value | Type name | Description |
---|---|---|---|
start | None | integer |
This is the starting position within the text in the edit control for the text
that will be selected. To start at the beginning of the text,
enter the value 0 .
|
end | None | integer |
This is the ending position within the text in the edit control for the text
that will be selected. To mark until the end of the text, enter
either a value greater than or equal to the length of the text,
or the value .inf .
|
settext()
Description
Sets the text in the edit control. The wxformedittext object itself is returned, to allow multiple setting methods to be put into one expression.
Prototype
wxformedittextvar
.settext
(
string
)
text
Parameters
Parameter | Default value | Type name | Description |
---|---|---|---|
text | None | string | The new text to set in the edit control. |
settextrgb()
Description
Sets the color of the text in the edit control. The
wxformedittext object itself is returned, to allow
multiple setting methods to be put into one expression. It is an
error to specify both the rgb
argument and one or
more of the red
, green
or
blue
arguments.
Prototype
wxformedittextvar
.settextrgb
(
integer
,
integer rgb
,
integer red
,
integer green
)
blue
Parameters
Parameter | Default value | Type name | Description |
---|---|---|---|
rgb | The current value of the textrgb property | integer | The new color of the text in the edit control. It is inadvisable to specify any value for this argument that is not the value of an existing rgb object. |
red | The current value of the textrgb.red property | integer | The red component in the new text color of the edit control. This must be between 0 and 255 inclusive. |
green | The current value of the textrgb.green
property | integer | The green component in the new text color of the edit control. This must be between 0 and 255 inclusive. |
blue | The current value of the text.blue property | integer | The blue component in the new text color of the edit control. This must be between 0 and 255 inclusive. |
settooltip()
Description
Sets the text for the tooltip associated with the control. The wxformedittext object itself is returned, to allow multiple setting methods to be put into one expression.
Prototype
wxformedittextvar
.settooltip
(
string
)
tooltip
Parameters
Parameter | Default value | Type name | Description |
---|---|---|---|
tooltip | None | string | The new text to set for the tooltip. |
setvisible()
Description
Sets the visibility of the edit control. The wxformedittext object itself is returned, to allow multiple setting methods to be put into one expression.
Prototype
wxformedittextvar
.setvisible
(
boolean
)
visible
Parameters
Parameter | Default value | Type name | Description |
---|---|---|---|
visible | None | boolean | The desired visibility of the edit control. |