The startgraphicschange statement adds undo support to a procedure.


This statement has one parameter:

menutitle – the title that will be displayed in the Undo/Redo menu. For example, if the title is Create Label the undo menu after the procedure will be Undo Create Label.


Panorama’s built in operations are undo-able, but out-of-the-box, your procedures aren’t. If your procedure modifies data you can use the startdatabasechange statement to fix that, but if your procedure modifies a form’s graphical content you need to use the startgraphicschange statement. (If your procedure changes both data and graphics, you’re out of luck.)

If you want Undo support, use this statement just before you make a graphics change (or series of changes). Here is an example that allows a procedure that creates a new invoice to be undo-able.

startgraphicschange "Create Mailing Label"
local labelRect
lableRect = rectanglesize(100, 100, 72, 72*2.75)
newformobject "Report Tile","Tile","Data Tile","Rectangle",lableRect
newformobject "Text Display",
    "Formula",{Name+cr()+Address+cr()+City+", "+State+" "+Zip}

Running this procedure will create two new graphic objects (this can be done in either Data or Graphics mode). Afterwards, if you check the Edit menu you will see an option to Undo Create Mailing Label. If you choose this option, the new objects will disappear. (You would then have the option to Redo Create Mailing Label if you wished.)

Note: Even if you make multiple changes, you should only use the startgraphicschange statement once. Make sure, however, that the startgraphicschange statement appears before you start modifying the database. Any changes made before this statement will not be undo-able.

Tip: It’s not necessary, but it may be helpful for you to understand how the startgraphicschange statement works. Basically, this statement takes a “snapshot” of the form you are about to modify. When the Undo command is used, Panorama reverts the form back to the snapshot. There is no way for you to directly access these snapshots, but they are used by the Undo and Redo commands.

See Also


10.0NewNew in this version.