SIMPOL Documentation

wxformbitmap

Description

A wxformbitmap object is an image control that can display an image on a form in any size (wxformbitmapbutton has a size limitation on some platforms of maximum 64 pixels in each dimension). Images can be unchanged, stretched or squeezed to fit the container, or scaled to fit the container while retaining the aspect ratio.

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 control in the case that the control is not completely filled by the associated bitmap.
bitmapwxbitmap The wxbitmap object that is used as the source of the bitmap in the control.
captureableboolean Specifies whether or not the control events can be captured by the form when the controlcapture() method is called.
enabledboolean Specifies whether or not the control is enabled.
focusableboolean Specifies whether or not the control can have the input focus. For wxformbitmap objects this is always .false
formwxform Specifies the wxform object to which this control belongs.
heightinteger Gives the height of the control, in pixels.
leftinteger Gives the position of the left side of the control relative to the left side of the form, in pixels.
namestring The name of the wxformbitmap object.
nexttype(wxformcontrol) Specifies the next wxformcontrol on the same form.
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 wxformbitmap.onmouse.reference

onmousemaskinteger Holds the mask that decides which mouse events are captured and sent to the onmouse event handler.
scalingstring Determines the type of scaling used on the bitmap. This can be one of: "hfit", "vfit", "handvfit", "preserveaspect", or the empty string. If no scaling is specified, then the image will be cropped to fit the control as needed. Otherwise the image will be stretched horizontally to fill the container, vertically to fill the container, or in both directions.
tooltipstring Contains the test that is displayed as a tooltip for the control.
topinteger Gives the position of the top edge of the control relative to the top edge of the form, in pixels.
typetype Specifies the wxformbitmap type object.
visibleboolean Specifies whether or not the control is visible.
widthinteger Gives the width of the control, in pixels.

Methods

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

wxformbitmapvar.remove ()

Parameters

None

setbackgroundrgb()

Description

Sets the color of the control. The wxformbitmap 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

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

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

setbitmap()

Description

Sets the bitmap associated with the control. The wxformbitmap object itself is returned, to allow multiple setting methods to be put into one expression.

Prototype

wxformbitmapvar.setbitmap ( wxbitmap bitmap )

Parameters
ParameterDefault valueType nameDescription
bitmapNonewxbitmap The wxbitmap object to be assigned as the source of the bitmap in the control.

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

wxformbitmapvar.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 control. The wxformbitmap object itself is returned, to allow multiple setting methods to be put into one expression.

Prototype

wxformbitmapvar.setenabled ( boolean enabled )

Parameters
ParameterDefault valueType nameDescription
enabledNoneboolean The desired enabled state for the control.

setname()

Description

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

Prototype

wxformbitmapvar.setname ( string name )

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

setnext()

Description

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

Prototype

wxformbitmapvar.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 wxformbitmap object itself is returned, to allow multiple setting methods to be put into one expression.

Prototype

wxformbitmapvar.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 control. The wxformbitmap object itself is returned, to allow multiple setting methods to be put into one expression.

Prototype

wxformbitmapvar.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 control on the form.
topThe current value of the top propertyinteger The new position of the top edge of the control on the form.
widthThe current value of the width propertyinteger The new width of the control on the form.
heightThe current value of the height propertyinteger The new height of the control on the form.

setscaling()

Description

Sets the scaling method to be used for the bitmap in the control. The wxformbitmap object itself is returned, to allow multiple setting methods to be put into one expression.

Prototype

wxformbitmapvar.setscaling ( string scaling )

Parameters
ParameterDefault valueType nameDescription
scalingNonestring The scaling method to be used when adjusting the bitmap to its container. This is one of: "hfit", "vfit", "handvfit", "preserveaspect", or the empty string (""). If no scaling is specified, then the image will be cropped to fit the container as needed. Otherwise the image will be stretched horizontally to fill the container, vertically to fill the container, or in both directions.

settooltip()

Description

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

Prototype

wxformbitmapvar.settooltip ( string tooltip )

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

setvisible()

Description

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

Prototype

wxformbitmapvar.setvisible ( boolean visible )

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