SIMPOL Documentation

wxformcombo

Description

A wxformcombo object is a text based control on a form with a separate list of items, one of which can be selected.

Type Tags

wxformcontrol

Object Value

Properties

PropertyTypeDescription
_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.
backgroundrgbrgb Gives the color of the background of the combo control.
captureableboolean Specifies whether or not the control events can be captured by the form when the controlcapture() method is called.
edittypestring

A string that indicates the way in which the user can change the text in the combo. edittype contains one of the following values:

  • "droplist" — The user can choose one of the items in the list. The text of that item then becomes the text for the combo control.

  • "dropedit" — The user can choose one of the items in the list, the text of which then becomes the text for the combo control, or the text can be directly changed as in an edit control.

enabledboolean Specifies whether or not the control is enabled.
focusableboolean Specifies whether or not the control can have the input focus. For wxformcombo objects this is always .true
fontwxfont This is a reference to the wxfont object that describes how the text in the list control is formatted.
formwxform Specifies the wxform object to which this combo control belongs.
heightinteger Gives the height of the combo control, in pixels.
itemcountinteger Gives the number of items in the combo control.
leftinteger Gives the position of the left side of the combo control relative to the left side of the form, in pixels.
namestring The name of the wxformcombo object.
nexttype(wxformcontrol) Specifies the next wxformcontrol on the same form.
ongotfocusevent An event that is triggered when the combo control receives input focus. The event handling function will receive the following parameters: (wxformcombo me[, type(*) reference]). The reference is only passed if it is provided by the user.
onlostfocusevent An event that is triggered when the combo control loses input focus. The event handling function will receive the following parameters: (wxformcombo me[, type(*) reference]). The reference is only passed if it is provided by the user.
onmouseevent

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: function onmouse(type(wxformcontrol) control, integer etype, integer keys, integer x, integer y, type(*) reference) where:

  • etype is the bit (defined as for onmousemask) showing what sort of event it is.

  • keys is a collection of bits showing key positions:

    Key TypeBit Value
    shift down0x00010000
    ctrl down0x00020000
    alt down0x00040000
    meta down0x00080000

  • x and y are the position of the mouse event

  • reference is the (optional) reference object in the wxformcombo.onmouse.reference

onmousemaskinteger Holds the mask that decides which mouse events are captured and sent to the onmouse event handler.
onselectionchangeevent An event which is triggered when what is selected in the combo control changes. The event handling function will receive the following parameters: (wxformcombo me[, type(*) reference]). The reference is only passed if it is provided by the user.
textstring The current text for the wxformcombo object, which is displayed on the form. During editing and also during any onlostfocus event for this combo 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.
textrgbrgb Gives the color of the text in the combo control.
tooltipstring Contains the test that is displayed as a tooltip for the control.
topinteger Gives the position of the top edge of the combo control relative to the top edge of the form, in pixels.
typetype Specifies the wxformcombo type object.
visibleboolean Specifies whether or not the control is visible.
widthinteger Gives the width of the combo control, in pixels.

Methods

delete()

Description

Deletes (removes) items from a combo control. The wxformcombo object itself is returned, to allow multiple methods to be put into one expression.

Prototype

wxformcombovar.delete ( integer , )

Parameters
ParameterDefault valueType nameDescription
 Noneinteger The 1-based index into the list of an item to delete.
None 

deleteall()

Description

Deletes (removes) all items from a combo control. The wxformcombo object itself is returned, to allow multiple methods to be put into one expression.

Prototype

wxformcombovar.deleteall ()

Parameters

None

getselected()

Description

Searches a combo control's list for the next selected item after a specified start point. The return value is the 1-based index of the first selected item which is equal to or greater than the specified start point, or is .nul if there is no such selected item.

Prototype

wxformcombovar.getselected ( integer firstitem )

Parameters
ParameterDefault valueType nameDescription
firstitemNoneinteger The 1-based index of the first item to search for selection.

gettext()

Description

Gets the most recent text for the edit portion of the control. During editing and also during any onlostfocus event for this combo control the gettext method will retrieve the current text visible in the edit portion of the control. The text property can be used to access the original text that was in place before editing began. This primarily is of use when using the "dropedit" form of the control.

Prototype

wxformcombovar.gettext ()

Parameters

None

insert()

Description

Adds items to a combo control's list. The wxformcombo object itself is returned, to allow multiple methods to be put into one expression.

Prototype

wxformcombovar.insert ( integer firstitem, string , )

Parameters
ParameterDefault valueType nameDescription
firstitem The current value of the itemcount property plus one, i.e. the end of the list. integer The 1-based index into the list to show the position to place the first of the items to be inserted.
 Nonestring The string to be added as an item at position firstitem.
None 

isselected()

Description

Determines whether or not a specified item in a combo control is currently selected. The method returns .true if the item is selected, or .false otherwise.

Prototype

wxformcombovar.isselected ( integer item )

Parameters
ParameterDefault valueType nameDescription
itemNoneinteger The 1-based index into the list of an item to determine the selection state of.

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

wxformcombovar.remove ()

Parameters

None

select()

Description

Selects an item in a combo control. The wxformcombo object itself is returned, to allow multiple methods to be put into one expression.

Prototype

wxformcombovar.select ( integer item, boolean select )

Parameters
ParameterDefault valueType nameDescription
itemNoneinteger The 1-based index of the item to select.
select.trueboolean .true is the only valid value for this argument.

setbackgroundrgb()

Description

Sets the background color of the combo control. The wxformcombo 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

wxformcombovar.setbackgroundrgb ( integer rgb, integer red, integer green, integer blue )

Parameters
ParameterDefault valueType nameDescription
rgbThe current value of the backgroundrgb propertyinteger The new background color of the combo control. It is inadvisable to specify any value for this argument which is not the value of an existing rgb object.
redThe current value of the backgroundrgb.red propertyinteger The red component in the new background color of the combo control. This must be between 0 and 255 inclusive.
greenThe current value of the backgroundrgb.green propertyinteger The green component in the new background color of the combo control. This must be between 0 and 255 inclusive.
blueThe current value of the backgroundrgb.blue propertyinteger The blue component in the new background color of the combo 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

wxformcombovar.setcaptureable ( boolean captureable )

Parameters
ParameterDefault valueType nameDescription
captureableNoneboolean 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 combo control. The wxformcombo object itself is returned, to allow multiple setting methods to be put into one expression.

Prototype

wxformcombovar.setenabled ( boolean enabled )

Parameters
ParameterDefault valueType nameDescription
enabledNoneboolean The desired enabled state for the combo 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.

Prototype

wxformcombovar.setfocus ()

Parameters

None

setfont()

Description

Sets the font to be used for the text in the combo control. The wxformcombo object itself is returned, to allow multiple setting methods to be put into one expression.

Prototype

wxformcombovar.setfont ( wxfont font )

Parameters
ParameterDefault valueType nameDescription
fontNonewxfont The wxfont object that will be used to format the text in the combo control.

setname()

Description

Sets the name of the list control. The wxformlist object itself is returned, to allow multiple setting methods to be put into one expression.

Prototype

wxformcombovar.setname ( string name )

Parameters
ParameterDefault valueType nameDescription
nameNonestring The new name for the list control.

setnext()

Description

Sets the position of the control in the z-order and tab order.

Prototype

wxformcombovar.setnext ( type(wxformcontrol) next )

Parameters
ParameterDefault valueType nameDescription
nextNonetype(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 wxformcombo object itself is returned, to allow multiple setting methods to be put into one expression.

Prototype

wxformcombovar.setonmousemask ( integer onmousemask )

Parameters
ParameterDefault valueType nameDescription
onmousemaskNoneinteger

The definition of which events should be handled by the onmouse event handler. The onmousemask is made up of bits:

Event TypeBit Value
left button down0x00000001
left button up0x00000002
left button double click0x00000004
middle button down0x00000010
middle button up0x00000020
middle button dbl click0x00000040
right button down0x00000100
right button up0x00000200
right button dbl click0x00000400
motion0x00001000

setposition()

Description

Sets the size and/or position of the combo control. The wxformcombo object itself is returned, to allow multiple setting methods to be put into one expression.

Prototype

wxformcombovar.setposition ( integer left, integer top, integer width, integer height )

Parameters
ParameterDefault valueType nameDescription
leftThe current value of the left propertyinteger The new position of the left side of the combo control on the form.
topThe current value of the top propertyinteger The new position of the top edge of the combo control on the form.
widthThe current value of the width propertyinteger The new width of the combo control on the form.
heightThe current value of the height propertyinteger The new height of the combo control on the form.

settext()

Description

Sets the text in the control. The wxformcombo object itself is returned, to allow multiple setting methods to be put into one expression.

Prototype

wxformcombovar.settext ( string text )

Parameters
ParameterDefault valueType nameDescription
textNonestring The new text to set in the control.

settextrgb()

Description

Sets the color of the text in the combo control. The wxformcombo 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

wxformcombovar.settextrgb ( integer rgb, integer red, integer green, integer blue )

Parameters
ParameterDefault valueType nameDescription
rgbThe current value of the textrgb propertyinteger The new color of the text in the control. It is inadvisable to specify any value for this argument which is not the value of an existing rgb object.
redThe current value of the textrgb.red propertyinteger The red component in the new text color of the control. This must be between 0 and 255 inclusive.
greenThe current value of the textrgb.green propertyinteger The green component in the new text color of the control. This must be between 0 and 255 inclusive.
blueThe current value of the text.blue propertyinteger The blue component in the new text color of the control. This must be between 0 and 255 inclusive.

settooltip()

Description

Sets the text for the tooltip associated with the control. The wxformcombo object itself is returned, to allow multiple setting methods to be put into one expression.

Prototype

wxformcombovar.settooltip ( string tooltip )

Parameters
ParameterDefault valueType nameDescription
tooltipNonestring The new text to set for the tooltip.

setvisible()

Description

Sets the visibility of the combo control. The wxformcombo object itself is returned, to allow multiple setting methods to be put into one expression.

Prototype

wxformcombovar.setvisible ( boolean visible )

Parameters
ParameterDefault valueType nameDescription
visibleNoneboolean The desired visibility of the combo control.

wxformcombo[]

Get

Subscripts

A numeric value giving the 1-based index of an item in the list.

Description

Retrieves the text of the specified item.

Set

Subscripts

A numeric value giving the 1-based index of an item in the list.

Description

Sets the text of the specified item.

Set Reference

Attempting to set a reference to an object is not supported.