Object Methods

__parent__ (r)

The __parent__ property accesses the parent object in the object tree, and is equivalent to the getParent() method call. The result is None if there is no parent.

__block__ (r)

The __block__ property accesses the enclosing block in the object tree, and is equivalent to the getBlock() method call. The result is None if there is no such block.

__root__ (r)

The __root__ property accesses the topmost object in the object tree, and is equivalent to the getForm() method call within forms.

void setEnabled ( bool enable )

Enable or disable control

Sets the object to enabled or disabled state. In the disabled state, the user cannot, for instance, make changes in data control, or click a button.

void setVisible ( bool show )

Show or hide control

Shows (makes visible) or hides the object. Note that when using dynamic geometry management, hiding an object may cause the layout to adjust to use up the vacated space.

bool isEnabled ( )

Test if control is enabled

Returns a tre result if the object is enabled.

bool isVisible ( )

Test if control is visible

Returns a tre result if the object is visible.

string getElement ( )

Get contol element

Returns the control element, ie., the type of the control, for instance KBField or KBButton

string getName ( )

Get control name

Returns the control name. This is equivalent to getAttr("name")

void setAttr ( string name, string value, number update )

Set attribute (property)

Sets the specified attribute to the specified value and, if the third (optional) argument is true, applies the change. If serveral changes are being made is is more efficient (and may result in less visual flicker) if all but the last call are made with a false thrird argument. Note also that which setAttr() works on such things as visual properties (colours, fonts, etc) it will not affect function properties (table names, ordering, etc).

string getAttr ( string name )

Get attribute (property)

Retrieves the value if the named attribute.

void update ( )

Update control for attribute changes

Forces update after changing attribute values. This is equivalent to the third argument of the setAttr() method being true. See setAttr() for additional details.

number width ( )

Get control width

Returns the control (or, in general, object) width, in pixels.

number height ( )

Get control height

Returns the control (or, in general, object) height, in pixels.

void resize ( number width, number height )

Resize control

Resizes the control to the specified width and height. Note that this will only work when geometry management is static; using this call with dynamic management may have unpredictable effects.

object getParent ( )

Get parent object if any

Returns the parent object or None if there is no parent (ie., the method is being called on a form or report object).

block getBlock ( )

Get enclosing block if any

Returns the immediately enclosing (form or report) block, or None is there is no such block (ie., the method is being called on a form or report object).

form getForm ( )

Get enclosing form if any

Returns the enclosing form, or None if called on an object in a report. Note that calling getForm() on a form object will return that form.

string lastError ( )

Get last error

Returns a textual message corresponding to the last error which occured relating to the object to which the lastError() method is applied.

object getNamedCtrl ( string name, errorOK bool )

Locate control by name

When applied to an object, this method locates the object which has the specified path name relative to the object. The (path) name can comprise multiple parts, separated by the / character, where double periods .. means the parent (as in the manner or Unix filesystem path names). getBlock() (without spaces) means the enclosing block, while getRoot() returns the outermost form or report block. If the third argument is true (the default) and the path name is invalid, an error dialog will be shown.

list getControls ( )

Get list of data controls

Returns a list of all data controls which are immediate children of the object to which the method is applied. Note that blocks are excluded

list getChildren ( )

Get list of all chilren

Returns a list of all immediate children of the object to which the method is applied.

string getConfig ( string name )

Get configuration value

Returns the value of the named configuration entry for the object to which the method is applied. Configuration entries are used to parameterise linked components.

void setFGColor ( string color )

Set control foreground color

Sets the foreground colour of the object.

void setBGColor ( string color )

Set control background color

Sets the background colour of the object.

void setFont ( string font )

Set control font

Sets the font of the object. Fonts are described as can be seen in the propery dialogs family;size;weight;italic; eg., Arial;10;75;1 is 10-point bold-italic Arial.

object cursor ( string sql, string args )

Get database cursor