objectaction
objectaction
OBJECT
,
COMMAND
,
PARAMETER

The objectaction statement allows a procedure to communicate with an object on the current form.

Parameters

This statement has three parameters:

object – specifies the target object. This parameter may be either the name of the object, or the ID of the object.

command – is an instruction that will be sent to the target object. Different types of objects understand different types of commands.

parameter – Depending on the command, you may need additional parameters. For example, the Text Editor’s `"InsertText"` command requires one additional parameter which specifies the text to be inserted. Parameters may also receive values from the object. For example the Text Editor’s “GetSelection” command has two parameters: the starting and ending points of the selected text. If a parameter is used to receive a value from the object, that parameter must be a single field or variable with no operators (for example `myValue`, not `myValue+yourValue` or `strip(myValue))`.

Description

This statement allows a procedure to communicate with an object on the current form. You specify what object you want to communicate with by its name or ID. Many types of objects have one or more commands that they understand. For example, the Text Editor Object has commands for selecting text, locating text, modifying text, etc.

This example inserts the current date and time into whatever object is currently being edited. The first few lines of the procedure check to make sure that there actually is an active object (i.e. something is really being edited at this time).

    local EditingObject
    EditingObject=info("activeobject")
    if EditingObject <> ""
        objectaction EditingObject,"InsertText",
            datepattern( today(),"mm/dd/yy")+"@"+
            timepattern( now(),"hh:mm am/pm")
    endif

See Also

- activeobjectaction -- allows a procedure to communicate with the object on the current form that is currently being edited (if any).
- changeobject -- modifies the properties of one object in a form.
- changeobjects -- modifies the properties of one or more objects in a form.
- cloneform -- copies all of the objects in a form (optionally, with modifications) into the active form.
- cloneobjects -- duplicates objects in a form (with modifications).
- closeactiveobject -- closes any object whose text is currently being edited.
- datamode -- switches a form from graphics mode into data mode.
- deleteselectedobjects -- deletes selected objects from a form.
- draggraybox -- facilitates dragging something around in a form window.
- dragtext -- starts drag-and-drop of text.
- formcleanview -- cleans up extraneous NSView objects in the current form.
- formxy -- programmatically scrolls a form to a new position.
- graphicsmode -- switches a form into graphics mode.
- info("activeobject") -- returns the name of the currently active text editor or word processor object (if any).
- info("activesuperobject") -- returns the name of the currently active text editor or word processor object, if any.
- info("click") -- returns the location of the last mouse click in screen relative coordinates.
- info("clickedobjectid") -- returns the object ID of the clicked object.
- info("focusobject") -- returns the name of the currently active text editor or word processor object, if any.
- info("focusobjectid") -- returns the object ID of the currently active text editor or word processor object, if any.
- info("scrollpoint") -- returns the distance the current form is scrolled horizontally and vertically.
- magicformwindow -- designates an open window as the temporary active window for the purposes of info( functions and graphic statements.
- magicwindow -- designates an open window as the temporary active window for the purposes of info( functions and graphic statements.
- magnification -- changes the magnification of a form.
- Modifiable Object Properties -- describes the properties of graphic objects that can be modified by a program (dimensions, color, font, title, etc.).
- newformobject -- creates a new graphic object in a form.
- object -- selects an object (based on the object name).
- objectid -- selects one graphic object in the current form based on an ID number.
- objectinfo( -- returns information about a graphic object: its location, size, color, font, etc.
- objectinfoarray( -- builds a text array of form object properties
- objectnumber -- identifies one graphic object from a set of selected graphic objects in the current form.
- openasyncprogresswindow -- opens a floating progress window for asynchronous operations (urltask(, timers).
- progressalert -- displays a progress alert if an operation is going to take a long time.
- progressbar -- updates a progress bar on the current form.
- selectallobjects -- selects all the graphic objects in the current form.
- selectnoobjects -- unselects all the graphic objects in the current form.
- selectobjects -- uses a formula to select one or more objects in the current form.
- startgraphicschange -- adds undo support to a procedure.
- textlisttableoptions -- sets up text list table options
- xytoxy( -- converts a point or rectangle from one co-ordinate system to another.

History

Version | Status | Notes
10.0 | Updated | Carried over from Panorama 6.0, but has been renamed (this was formuerly called the superobject statement). Also, the exact options for different kinds of statements are different. This command now handles objects with duplicate names differently than in Panorama 6.0 and earlier -- now the communication will only be with the first object with the duplicate name.