Notes This verb displays an alert box with the "Caution" icon. The message appears next to the icon and a single "OK" button appears below the message. The alert waits until the user strikes the OK button.
If CFG dialog display is disabled, this function will not display anything. It simply returns True.
One should only call this function if CFG is the front application (i.e. useful for shared menus).
See Also CFG.askDialog
CFG.confirmDialog
CFG.enableDialogs
Verb CFG.askDialog
Syntax CFG.askDialog( prompt, answer )
Parameters prompt is the message to display in the dialog.
answer is the default answer
Action Displays an dialog box with a prompt and waits for the user to enter the answer string.
Returns True if OK hit or false for Cancel. If OK was hit, answer will contain the response.
Examples local( answer = "Alicia" )
CFG.askDialog( "Who is your favorite person?", @answer )
» true
answer stores the user's response ("Alicia" if the default answer was kept)
local( answer = "Rover" )
CFG.askDialog( "What is the name of your dog?", @answer )
» false
The user selected Cancel. The value in answer is ignored as Cancel was selected.
Notes A dialog is displayed with a prompt, an editable text with an initial value of answer, and two buttons: OK and Cancel.
If CFG dialog display is disabled, this function will not display anything. It simply returns True.
One should only call this function if CFG is the front application (i.e. useful for shared menus).
See Also CFG.alertDialog
CFG.confirmDialog
CFG.enableDialogs
Verb CFG.cancelBuild
Syntax CFG.cancelBuild()
Parameters None
Action Stops the fractal generation process for the target.
Returns True on success, false on error.
Examples CFG.cancelBuild()
» true
Notes The target window must be a fractal window.
This routine returns true for fractal windows whether or not they are being generated.
See Also CFG.continueBuild
CFG.generating
CFG.redraw
Verb CFG.cfgVersion
Syntax CFG.cfgVersion( [versionFlags] )
Parameters versionFlags is an optional address parameter that stores some additional program information.
Action Determines the version number of Color Fractal Generator.
Returns String4 with version and registration information.
Examples CFG.cfgVersion()
» 'R220'
The R indicates that CFG is registered. 220 means version 2.20.
CFG.cfgVersion()
» 'U220'
The U indicates that CFG is not registered.
Notes The first character returned indicates whether the program is registered ('R') or not registered ('U').
The last three characters indicate the major version number, revision number, and maintenance release number, respectively.
Currently, versionFlags returns 1 on the PowerMac version or 0 on 68K version.
See Also none
Verb CFG.clear
Syntax CFG.clear()
Parameters none
Action Clears a fractal window's selection.
Returns True if anything was cleared, false otherwise.
Examples CFG.clear
» true
Notes The target window must be a fractal window. At least some portion of the image must be selected.
This command cannot be used when the target window is building a fractal.
See Also CFG.copy
CFG.cut
CFG.paste
Verb CFG.clearErrorString
Syntax CFG.clearErrorString()
Parameters None
Action Sets the error string to a NULL string ("").
Returns True
Examples CFG.clearErrorString()
» True
Notes Use this function to clear old errors so that one may see if a set of instructions generates any new errors.
See Also CFG.errorString()
Verb CFG.closeWindow
Syntax CFG.closeWindow( [action] )
Parameters action is an optional parameter. If present, it should have a value of 1, 2, or 3.
Action Closes the target window.
Returns True if closed, false if still open.
Examples CFG.closeWindow( CFG.const.saveDataNo )
» true
Notes The New Parameters Window may not be closed. Attempting to close it always returns false.
After the window is closed, the target is cleared. If no new target is assigned, the default target window becomes the front-most window.
The optional parameter action specifies whether to automatically save the window if dirty, don't save, or prompt the user. See "CFG.const.saveData..." constants.
If CFG dialog display is disabled, this function will not display any prompts. Windows will simply not be saved.
See Also CFG.enableDialogs
CFG.newWindow
CFG.openHelpWindow
CFG.openWindow
Verb CFG.confirmDialog
Syntax CFG.confirmDialog( question )
Parameters question is the question which the user either confirms or denies.
Action Displays a dialog querying the user to continue or cancel the action.
Returns True if OK hit, false for Cancel.
Examples CFG.confirmDialog( "Do you really want to erase your hard drive?" )
» false
The user hit cancel, indicating a desired to keep the hard drive intact.
Notes This verb displays a dialog with the specified question. The user may hit OK to continue the action or Cancel to abort.
If CFG dialog display is disabled, this function will not display anything. It simply returns True.
One should only call this function if CFG is the front application (i.e. useful for shared menus).
See Also CFG.alertDialog
CFG.askDialog
CFG.enableDialogs
Verb CFG.continueBuild
Syntax CFG.continueBuild()
Parameters None
Action Start building the target fractal from where we left off.
Returns True on successful start of continue, false on redraw needed.
Examples CFG.continueBuild()
» true
Fractal creation is continuing from where we last left off.
CFG.continueBuild()
» false
Either target was not a fractal or continuation not possible due to fractal window state change (such as different fractal parameters).
Notes The target window must be a fractal window.
A continue may not be possible if fractal parameters were changed since the last generation process was stopped. In that case, false is returned as the result and the fractal will not be generated.
This command cannot be used when the target window is building a fractal.
See Also CFG.cancelBuild
CFG.isBuilding
CFG.redraw
Verb CFG.copy
Syntax CFG.copy()
Parameters none
Action Copies current selection to the Clipboard. This can either be an image from a fractal or text from the Help window.
Returns True if data copied to the Clipboard, false otherwise.
Examples CFG.copy
» True
Notes Fractal images cannot be copied for non-registered versions of Color Fractal Generator.
This command cannot be used when the target window is building a fractal.
Data is only placed in the Clipboard if CFG is the active application.
See Also CFG.clear
CFG.cut
CFG.paste
Verb CFG.countFracWindows
Syntax CFG.countFracWindows()
Parameters None
Action Counts the number of fractal windows.
Returns An integer with the number of fractal windows.
Examples CFG.countFracWindows()
» 1
There is one open window which is a fractal.
Notes The count will not include the New Parameters window or the Help window.
See Also CFG.countWindows
Verb CFG.countWindows
Syntax CFG.countWindows()
Parameters None
Action Count the number of application windows that are currently open.
Returns An integer with the number of open windows.
Examples CFG.countWindows()
» 3
Three windows are open: the New Parameters Window and two others.
Notes The count includes the New Parameters Window and the Help Window (if open).
See Also CFG.countFracWindows
Verb CFG.cut
Syntax CFG.cut()
Parameters none
Action Copies current selection to the Clipboard and then clears the selection.
Returns True if the image was cut or false if the operation failed.
Examples CFG.cut()
» True
Notes The target window must be a fractal window.
For non-registered versions of CFG, CFG.cut() operates as CFG.clear().
This command cannot be used when the target window is building a fractal.
Data is only placed in the Clipboard if CFG is the active application.
See Also CFG.clear
CFG.copy
CFG.paste
Verb CFG.cycleWindows
Syntax CFG.cycleWindows()
Parameters None
Action This function moves the top window behind all other windows. The second window is now the top and it is made the target window.
Returns String with the name of the new top window.
Examples CFG.cycleWindows()
» "Mandlebrot 1"
Notes The new top window is now the target window.
See Also CFG.nthWindow
CFG.selectWindow
CFG.setTarget
Verb CFG.deselect
Syntax CFG.deselect()
Parameters None
Action Remove any selection in the target.
Returns True if deselected, false on error.
Examples CFG.deselect()
» true
Notes This verb should not be applied to the New Parameters Window as it cannot have any selections.
If applied to the correct window type, true is returned even if no selection exists.
This command cannot be used when the target window is building a fractal.
See Also CFG.getSelection
CFG.haveSelection
CFG.selectAll
CFG.selectRectAbs
CFG.selectRectRel
Verb CFG.displayFracDialog
Syntax CFG.displayFracDialog( [fractal] )
Parameters fractal is an optional parameter. For non-fractal target windows, this string specifies the name or ID of the fractal data to edit.
Action Displays the dialog box for the target's fractal.
Notes If the target is a fractal, the parameter "fractal" is ignored. The data used in the dialog box is from the target's fractal type and data.
For non-fractal targets, if "fractal" is specified, the global data for that fractal type is edited. Otherwise, the data for the fractal type specified in the New Parameters Window is displayed.
If CFG dialog display is disabled, this function will not display anything. It simply returns True.
This command cannot be used when the target window is building a fractal.
See Also CFG.enableDialogs
Verb CFG.displayPrefsDialog
Syntax CFG.displayPrefsDialog()
Parameters None
Action Displays the preferences dialog box with the target's preferences.
Returns True if user selected OK, false for Cancel.
Examples CFG.displayPrefsDialog()
» true
Notes If the target is not a fractal window, the global preferences will be displayed in the dialog box. These are used for creating new fractals.
If CFG dialog display is disabled, this function will not display anything. It simply returns True.
This command cannot be used when the target window is building a fractal.
See Also CFG.enableDialogs
CFG.getPrefs
CFG.setPrefs
Verb CFG.enableDialogs
Syntax CFG.enableDialogs( enable )
Parameters enable is a Boolean indicating whether or not to enable alerts.
Action Enables or disables alerts and dialog boxes. This is useful if user interaction is not desired.
Returns Boolean indicating the previous state of CFG.enableDialogs (true for enabled, false for disabled).
Examples CFG.enableDialogs( false )
» true
The alerts are now disabled as false was passed in. Prior to this call, the alerts were enabled as indicated by the return value of true.
Notes Use this command very carefully! CFG does not distinguish between commands directly from the user and commands from scripts. If user interaction is disabled, it will stay that way until re-enabled by this command.
During the time that alerts and dialogs are disabled, the only alerts or dialogs displayed are ones due to errors.
If a dialog or alert is suppressed, the program will proceed as if the user chose the default dialog response.
Exception: if the default action may require user interaction, then the alternative action is chosen (example: the default for "Save Changes" is "OK", but since the user may need to enter the path, "Don't Save" would be chosen).
If the alerts were disabled, make sure they are re-enabled before exiting the script.
See Also None
Verb CFG.errorString
Syntax CFG.errorString()
Parameters None
Action Returns the last error which was detected.
Returns String with last error.
Examples CFG.errorString()
» ""
No errors
CFG.errorString()
» "Out of memory"
Last error was an out of memory error.
Notes This function returns a null string ("") if no errors have occurred since program start.
See Also CFG.clearErrorString
Verb CFG.generating
Syntax CFG.generating()
Parameters None
Action Determine whether the target fractal is being generated.
Returns True if fractal is being generated, false otherwise.
Examples CFG.generating()
» false
Notes The target window must be a fractal window.
See Also CFG.cancelBuild
CFG.continueBuild
CFG.redraw
Verb CFG.getDepth
Syntax CFG.getDepth()
Parameters None
Action Get the target's color depth (bits per pixel).
Returns An integer with the number of bits per pixel. Valid responses are -1, 4, 8, 16, and 32.
Examples CFG.getDepth()
» 8
CFG.getDepth()
» 32
Notes If the target is not a fractal, the default depth for a new fractal is returned. This information is displayed in the New Parameters Window.
A response of -1 (CFG.const.depthDeep) means to use the color depth of the deepest monitor attached to the system. Thus, if a computer has two monitors, one set to 4 bits / pixel and the other to 16, a CFG.getDepth of -1 means to use the 16 bit depth.
The depth is actually a field of the preferences. However, since it is unwieldy to handle the preferences structure just to modify the fractal color depth, this function and CFG.setDepth were created.
See Also CFG.displayPrefsDislog
CFG.getPreferences
CFG.setDepth
CFG.setPreferences
Verb CFG.getFilePath
Syntax CFG.getFilePath()
Parameters None
Action Retrieves the path to the target's save file.
Returns A string with the path to the file or an empty string if no path exists or the full path cannot fit inside a string.
Examples CFG.getFilePath()
» "HD:myFractal"
Notes The target window must be a fractal window.
The full path is limited to 255 characters. If it is larger that 255 characters, an empty string is returned.
See Also CFG.open
CFG.save
Verb CFG.getFractalData
Syntax CFG.getFractalData()
Parameters None
Action Fetches the target's internal data.
Returns Returns a copy of the target's data stored in a record.
Examples CFG.getFractalData()
» {'accr':100, 'free':2, ... }
Notes The target window must be a fractal window.
The meaning of this data depends on the type of fractal that it came from (which is determined from CFG.getFractalType). The record structure is located in the "CFG Scripting Guide."
See Also CFG.setFractalData
Verb CFG.getFractalSize
Syntax CFG.getFractalSize()
Parameters None
Action Obtains the size of the target's offscreen fractal data.
Returns A Point representing the width and height of the data.
Examples CFG.getFractalSize()
» { 640, 480 }
Notes If the target is not a fractal, the New Parameters Window's fractal size is returned. This represents the fractal size for newly created fractals.
See Also CFG.setFSizeCustom
CFG.setFSizeMenu
Verb CFG.getFractalType
Syntax CFG.getFractalType( [fractalName] )
Parameters fractalName is an optional parameter which will store the fractal's name.
Action Get the fractal type of the target (and optionally the fractal name).
Returns An integer with the fractal ID number ("CFG.const.ftype...").
Examples local (theName)
CFG.getFractalType( @theName )
» 3
theName will store the string "Dragon" (the name of fractal type 3).
Notes The target can be any type of window. For non-fractal windows, the fractal type represents the type displayed in the New Parameters window.
See Also CFG.setFractalType
CFG.windowType
Verb CFG.getLimitExtreme
Syntax CFG.getLimitExtreme()
Parameters None
Action Get current setting for limiting outlying values of randomly generated fractal variables.
Returns True if the limit is on, false if not.
Examples CFG.getLimitExtreme()
» false
Notes The target may be any type of window.
The limit extreme value only applies to the current target. Other windows may be set differently.
If the target is the Help Window or New Parameters window, the setting will be the global setting which will be applied to new fractals.
See Also CFG.setLimitExtreme
Verb CFG.getPICT
Syntax CFG.getPICT()
Parameters None
Action Get the PICT data for the current selection.
Returns 'PICT' data for the current selection or false if no selection or an error occurred.
Examples CFG.getPICT()
» /PICT DATA/
CFG.getPICT()
» false
Nothing was selected, so false was returned.
Notes The target window must be a fractal window.
The target must currently have a selection. This selection will be the PICT information which is returned.
The unregistered version of CFG will simply return false without capturing the PICT data.
See Also CFG.copy
CFG.cut
CFG.getText
CFG.putPICT
CFG.savePicture
Verb CFG.getPreferences
Syntax CFG.getPreferences()
Parameters None
Action Get a copy of the target's preferences.
Returns The target's preferences data stored in a record.
Examples CFG.getPreferences()
» {'flag':57872, 'prec':9, 'dmnu':1}
Notes If the target is not a fractal window, the returned data is from the global preferences, which are applied to new fractals.
The structure of the preferences data is explained in the "CFG Scripting Guide."
See Also CFG.setPreferences
Verb CFG.getScrollPosition
Syntax CFG.getScrollPosition()
Parameters None
Action Gets the current and maximum scrolling parameters of the target.
Returns Rectangle with scroll information:
r.left current horizontal scroll setting
r.right maximum horizontal scroll setting
r.top current vertical scroll setting
r.bottom maximum vertical scroll setting
Examples CFG.getScrollPosition()
» { 2, 3, 10, 20 }
The current scroll positions (h,v) are (2,3) while the maximum are (10,20).
Notes The target cannot be the New Parameters Window as it does not have a scroll region.
A value of -1 indicates no scroll information is available for that parameter. For example: the help window would return a -1 for r.left and r.right since it has no horizontal scroll bar.
The minimum scroll setting is 1.
See Also CFG.getWindowRect
CFG.scrollWindow
Verb CFG.getSelection
Syntax CFG.getSelection()
Parameters None
Action Retrieves the target's current selection.
Returns Rectangle with the selection.
Examples CFG.getSelection()
» { 0, 0, 640, 480 }
Notes This verb should not be applied to the New Parameters Window as it cannot have any selections.
For fractal windows, the rectangle is the selection in local coordinates. It is absolute with respect to the fractal's offscreen data.
Only the left and right parameters of the rectangle are valid for the Help Window. These specify the beginning and ending character positions of the selection.
If nothing is selected, an empty rectangle is returned.
See Also CFG.deselect
CFG.haveSelection
CFG.selectAll
CFG.selectRectAbs
CFG.selectRectRel
Verb CFG.getSpeed
Syntax CFG.getSpeed()
Parameters None
Action Obtain the fractal generation speed.
Returns An integer with the speed. Constant definitions for the speed are located in "CFG.const.speed...".
Examples CFG.getSpeed()
» 1
Notes none
See Also CFG.setSpeed
Verb CFG.getTarget
Syntax CFG.getTarget()
Parameters None
Action Returns the current target window.
Returns String with the name of the current target window.
Examples CFG.getTarget()
» "Mandelbrot 1"
Notes If no target window was ever assigned, the front-most window made the target and its name is returned.
See Also CFG.selectWindow
CFG.setTarget
Verb CFG.getText
Syntax CFG.getText()
Parameters None
Action Get the text of the current selection.
Returns Text data
Examples CFG.getText()
» "Registration information"
The selected region of text was "Registration information"
Notes The target window must be the Help Window.
The target must have a region of selected text.
See Also CFG.copy
CFG.cut
CFG.getPICT
CFG.putPICT
Verb CFG.getWindowPos
Syntax CFG.getWindowPos()
Parameters None
Action Get the target window's position.
Returns A rectangle representing the window's position.
Examples CFG.getWindowPos()
» { 30, 30, 120, 200 }
Notes The rectangle is in global coordinates. It corresponds to the content region of the window (it includes the scroll bar region - if present).
The target window can be any type of window.
See Also CFG.getWindowRect
CFG.grayRgnRect
CFG.moveWindow
Verb CFG.getWindowRect
Syntax CFG.getWindowRect()
Parameters None
Action Returns the target's view rectangle relative to the entire data region.
Returns Rectangle
Examples CFG.getWindowRect()
» { 187, 190, 292, 450 }
Notes The target window can be any type.
For non-fractal windows, this simply returns the window boundaries in global coordinates.
For fractals, the position of the view rectangle (window's content region seen on screen) relative to the entire data region (fractal size) is returned.
Thus, the content region (in global coordinates) minus the amount that the window has been scrolled is returned.
See Also CFG.getWindowPos
CFG.grayRgnRect
CFG.moveWindow
Verb CFG.grayRgnRect
Syntax CFG.grayRgnRect()
Parameters None
Action Returns the total desktop area minus menu bar region and a 4 pixel frame surrounding the desktop.
Returns Rectangle
Examples CFG.grayRgnRect()
» { 24, 4, 456, 636 }
Notes This function is useful when moving and resizing windows. The title region of a window must remain in this rectangle.
See Also CFG.getWindowPos
CFG.getWindowRect
CFG.mainScreenSize
Verb CFG.haveSelection
Syntax CFG.haveSelection()
Parameters None
Action Determines whether the target has a selected area.
Returns True if the target has a selection or false if it does not.
Examples CFG.haveSelection()
» true
Notes The target window cannot be the New Parameters Window. This window will never have a selection.
See Also CFG.deselect
CFG.getSelection
CFG.selectAll
CFG.selectRectAbs
CFG.selectRectRel
Verb CFG.invertColor
Syntax CFG.invertColor()
Parameters None
Action Inverts the selected region's colors.
Returns True if OK, false on error.
Examples CFG.invertColor()
» true
Notes The target must be a fractal window.
An area of the fractal must be selected. Only those pixels in the selection are inverted.
This command cannot be used when the target window is building a fractal.
See Also CFG.getPICT
CFG.putPICT
Verb CFG.listFractalTypes
Syntax CFG.listFractalTypes()
Parameters None
Action Generate a list of fractals which are supported by CFG.
Notes If the target window is not a fractal, the returned list contains the global palettes available to a new fractal.
See Also CFG.loadPalette
CFG.savePalette
CFG.setPalFromList
Verb CFG.loadPalette
Syntax CFG.loadPalette( path )
Parameters path is the full path name of the desired palette file.
Action Loads a specified palette file.
Returns True on success, false on failure.
Examples CFG.loadPalette( "HD:myPalette" )
» true
Notes The loaded file will become the target's custom palette file. This change will be reflected in the Palette menu when the target becomes the top-most window.
Although the palette is loaded, the colors of the fractal will not be altered for 16 and 32 bit environments until it is regenerated.
If the target is not a fractal, the loaded palette becomes the default palette for new fractals. This information is shown in the New Parameters Window.
This command only loads CFG created palettes. It cannot handle 'clut' and 'pltt' resources.
This command cannot be used when the target window is building a fractal.
See Also CFG.listPalettes
CFG.savePalette
CFG.setPalFromList
Verb CFG.madeChanges
Syntax CFG.madeChanges()
Parameters None
Action Determines whether any changes have been made to the target since the last time it was saved.
Returns True if changes were made or false if the target is not "dirty".
Examples CFG.madeChanges()
» true
Notes The target window must be a fractal window.
If the target was never saved (such as creating a fractal with New), true will always be returned.
See Also CFG.saveAs
Verb CFG.mainScreenSize
Syntax CFG.mainScreenSize()
Parameters None
Action Returns the size of the main screen in pixels.
Returns Point
Examples CFG.mainScreenSize()
» { 640, 480 }
Notes This function is useful when adjusting fractal sizes.
See Also CFG.getWindowPos
CFG.getWindowRect
CFG.grayRgnRect
Verb CFG.moveWindow
Syntax CFG.moveWindow( pos )
Parameters pos is a rectangle specifying the new window coordinates and size.
Action Moves and resizes a target window.
Returns True is successful, false on error.
Examples local( r )
r = rectangle.set( 50, 50, 250, 400 )
CFG.moveWindow( r )
» true
The window moved to top-left of 50,50 and it is 350 pixels across and 200 pixels high.
Notes The target can be any window type. Fractal windows are moved and resize, while other windows types are simply moved (bottom and right rectangle fields are ignored).
If the desired location forces the window off the screen, the operation will fail and the window remains at its present location.
See Also CFG.getWindowPos
CFG.getWindowRect
Verb CFG.newWindow
Syntax CFG.newWindow( name )
Parameters name is an optional parameter which specifies the new window's name.
Action Creates a new fractal window using the current parameters in the New Parameters Window.
Returns A string containing the new window's name or an empty string if an error occurred during window creation.
Examples CFG.newWindow( "myFractal" )
» "myFractal"
CFG.newWindow( "ourFractal" )
» ""
The empty string indicates an error occurred during the window's creation.
CFG.newWindow()
» "Mandelbrot 1"
A new window was created. CFG assigned the name "Mandelbrot 1" since no name was provided by the user.
Notes The name is an optional parameter. If no name is specified or an empty string is specified, CFG generates its own name for the window.
The fractal information for the new window is taken from the parameters specified in the New Parameters Window.
The new window is NOT made the target window. It is, however, made the front-most window.
See Also CFG.closeWindow
CFG.openWindow
Verb CFG.nthWindow
Syntax CFG.nthWindow( windowN )
Parameters windowN is the window number to select
Action Selects a nth window from the top.
Returns String with the window title of selected window, or an empty string if no such window exists.
Examples CFG.nthWindow( 4 )
» "Mandelbrot 1"
Notes The specified window is made the front-most window and also the target.
The top window is considered window 1, the window below that is 2, etc.
If the specified window does not exist (windowN is greater than the total number of windows), an empty string is returned.
See Also CFG.cycleWindows
CFG.selectParamsWindow
CFG.selectWindow
Verb CFG.openHelpWindow
Syntax CFG.openHelpWindow()
Parameters None
Action Opens the help window and brings it to the front.
Returns String with the name of the Help Window.
Examples CFG.openHelpWindow()
» "Help Window"
Notes The help window is made the target window.
If the help window is already open, it is simply selected and made the target.
See Also CFG.closeWindow
CFG.listHelpItems
CFG.openWindow
CFG.selectHelpItem
Verb CFG.openWindow
Syntax CFG.openWindow( path )
Parameters path specifies the full path to the file to open.
Action Opens a fractal window using information from the file specified in 'path'.
Returns True if the file was properly opened and false if an error occurred.
Examples CFG.openWindow( "HD:myFractal" )
» true
CFG.openWindow( "HD:?!~" )
» false
An error occurred while attempting to open the specified fractal. One possible explanation is that the path specification is invalid.
Notes The newly opened window is NOT made the target window. It is, however, made the front-most window.
See Also CFG.closeWindow
CFG.newWindow
CFG.openHelpWindow
Verb CFG.paste
Syntax CFG.paste()
Parameters none
Action Pastes a PICT image from the Clipboard into the fractal window.
Returns True if the paste was successful or false if no image could be pasted.
Examples CFG.paste()
» True
Notes The target window must be a fractal window.
The image on the Clipboard must be in PICT format.
If the window has a selection, the image is pasted into the selection (scaled to fit the selected rectangle). Otherwise it is scaled to fit the window.
This command cannot be used when the target window is building a fractal.
Data can only be copied from the Clipboard if CFG is the active application.
See Also CFG.clear
CFG.copy
CFG.cut
CFG.getPICT
CFG.putPICT
Verb CFG.performanceTest
Syntax CFG.performanceTest( r1, r2 )
Parameters r1 and r2 are two rectangles which are used in the test.
Action This verb performs a rectangle subtraction (r1 - r2) and returns the result.
Returns A rectangle which is the result of the rectangle subtraction (r1 - r2).
Examples r1 = rectangle.set( 50, 50, 60, 60 )
r2 = rectangle.set( 20, 20, 25, 25 )
CFG.performanceTest( r1, r2 )
» { 30, 30, 35, 35 }
Notes This verb supports the performance benchmark test written in Frontier.
See Also None
Verb CFG.putPICT
Syntax CFG.putPICT( pict )
Parameters pict is a graphic which will be placed in the target
Action "Pastes" the picture into the target's selected rectangle
Returns True if the operation was successful, false on failure
Examples local( pict )
clipboard.get( 'PICT', @pict ) « stuff "pict" with some image data
CFG.putPICT( pict )
» true
Notes The graphic passed to this verb must be of type 'PICT'.
The target window must be a fractal window.
The picture will be "pasted" inside the selection and stretched to fit the selection. If there is no selection, the picture is scaled to fit the window.
This command cannot be used when the target window is building a fractal.
See Also CFG.getPICT
CFG.getText
CFG.paste
CFG.savePicture
Verb CFG.quit
Syntax CFG.quit( [action] )
Parameters action is an optional parameter. If present, it should have a value of 1, 2, or 3.
Action Sends a quit command to CFG.
Returns True
Examples CFG.quit()
» true
Notes The optional parameter action specifies whether to automatically save the window if dirty, don't save, or prompt the user. See "CFG.const.saveData..." constants.
If CFG dialog display is disabled, this function will not display any prompts. Windows will simply not be saved.
See Also None
Verb CFG.redraw
Syntax CFG.redraw()
Parameters None
Action Reset the fractal creation process and start building the target fractal.
Returns True if the process started, false on error.
Examples CFG.redraw()
» true
Notes The target window must be a fractal window.
This command cannot be used when the target window is building a fractal.
See Also CFG.cancelBuild
CFG.continueBuild
CFG.generating
Verb CFG.revertFractal
Syntax CFG.revertFractal()
Parameters None
Action Resets the target its state when it was last saved.
Returns True if the target was reverted or false if an error occurs.
Examples CFG.revertFractal()
» true
Notes The target window must be a fractal window.
If the target was never saved (and no file is associated with the target), the target cannot be reverted.
This command cannot be used when the target window is building a fractal.
See Also CFG.saveAs
Verb CFG.saveAs
Syntax CFG.saveAs( [path] )
Parameters path is an optional parameter which specifies a name and location of the saved file.
Action Saves the contents of the target window to disk.
Returns True if the file was saved or false if it was not saved.
Examples CFG.saveAs( "HD:myFractal" )
» true
The contents of the target were saved to the file specified by the path "HD:myFractal".
CFG.saveAs()
» true
The fractal information was saved to the target's previous save file.
Notes The target window must be a fractal window.
If the path is specified, CFG.saveAs functions as the "Save As" command. If no path is specified, this verb functions as the "Save" command.
If no path is specified and no file is associated with the fractal, false is returned (and an error is flagged).
See Also CFG.revertFractal
Verb CFG.savePalette
Syntax CFG.savePalette( path )
Parameters path is the file name and location to save the palette.
Action Saves the target's current palette to a file.
Returns True on success, false on failure.
Examples CFG.savePaletteFile( "HD:myPalette" )
» true
Notes The current palette may not be the target's custom palette.
See Also CFG.listPalettes
CFG.loadPalette
CFG.setPalFromList
Verb CFG.savePicture
Syntax CFG.savePICT( path, picType )
Parameters path is the file name and location to save the fractal's image.
picType is the graphic file format. Currently, only 'PICT' is supported.
Action Saves the fractal to a graphics file. Optionally, one may save only the selected region.
A selected area is saved only if part of the image is selected and the "save selection" preferences flag is set.
Future versions of CFG may support more graphics formats.
This function only works on registered versions of CFG.
See Also CFG.getPICT
CFG.putPICT
Verb CFG.scrollWindow
Syntax CFG.scrollWindow( dir, count )
Parameters dir is the direction to scroll the window.
count is the amount to move it.
Action Scrolls the target in the direction and amount specified.
Returns True on a successful scroll, false on scroll failure.
Examples CFG.scrollWindow( pageDown, 1 )
» true
Moves the target window down by 1 page.
Notes The New Parameters Window cannot be scrolled at all and the Help Window may only be scrolled vertically. If attempts are made to scroll in illegal directions, false will be returned.
The numeric definitions for direction are located in the "CFG Scripting Guide". You may also use the directions defined by Frontier.
If false is returned, it means that the scrolling has reached its limit in the specified direction.
See Also None
Verb CFG.selectAll
Syntax CFG.selectAll()
Parameters None
Action Selects the entire contents of the target.
Returns True if successful, false if selection could not be made.
Examples CFG.selectAll()
» true
Notes The target window cannot be the New Parameters Window as nothing can be selected in this type of window.
If the target is a fractal window, the entire fractal picture is selected. For Help Windows, all text for the current help section is selected.
This command cannot be used when the target window is building a fractal.
See Also CFG.deselect
CFG.getSelection
CFG.haveSelection
CFG.selectRectAbs
CFG.selectRectRel
Verb CFG.selectHelpItem
Syntax CFG.selectHelpItem( itemName )
Parameters itemName is the name of the item for which to obtain help information.
Action Display help information for a given item.
Returns True if item displayed, false on error.
Examples CFG.selectHelpItem( "Registration" )
» true
Notes The target must be the help window.
A list of valid help items is returned by CFG.listHelpItems().
See Also CFG.listHelpItems
CFG.openHelpWindow
Verb CFG.selectParamsWindow
Syntax CFG.selectParamsWindow()
Parameters None
Action Bring the New Parameters Window to the front.
Returns String with the name of the New Parameters Window or an empty string on an error.
Examples CFG.selectParamsWindow()
» "New Parameters"
Notes The New Parameters Window is made the target.
As the New Parameters Window cannot be disposed, it should always be present. It may not always be named "New Parameters", however.
See Also CFG.nthWindow
CFG.selectWindow
Verb CFG.selectRecAbs
Syntax CFG.selectRectAbs( rect )
Parameters rect is the coordinates of the selection
Action Select a region of the target using coordinates that references the top,left of the target's data.
Returns True if no error, false on error.
Examples r = rectange.set( 0, 0, 640, 480 )
CFG.selectRecAbs( r )
» true
Notes This verb should not be applied to the New Parameters Window as it cannot have any selections.
For fractal windows, the selected rectangle will appear at the specified location with respect to the fractal's offscreen data.
Thus if the rectangle was { 10, 10, 30, 30 }, the selection would appear 10 pixels down and to the right of the offscreen's top left corner. The location on screen depends on the current scroll coordinates.
For Help Windows, only the left and right fields of the rectangle are valid. These specify the character positions to start and end the selection respectively.
Relative and absolute have no meaning for the Help Window. Therefore, this function is the same as CFG.selectRectRel for the Help Window.
This command cannot be used when the target window is building a fractal.
See Also CFG.deselect
CFG.getSelection
CFG.haveSelection
CFG.selectAll
CFG.selectRectRel
Verb CFG.selectRectRel
Syntax CFG.selectRectRel( rect )
Parameters rect is the coordinates of the selection
Action Select a region of the target relative to the current view region.
Returns True if no error, false on error.
Examples r = rectangle.set( 0, 0, 256, 256 )
CFG.selectRectRel( r )
» true
Notes This verb should not be applied to the New Parameters Window as it cannot have any selections.
For fractal windows, the selected rectangle will appear relative to the top-left corner of the viewing region.
Thus if the rectangle was { 10, 10, 30, 30 }, the selection would appear 10 pixels down and to the right of the window's top left corner, no matter where scroll coordinates are located.
For Help Windows, only the left and right fields of the rectangle are valid.
These specify the character positions to start and end the selection respectively. Relative and absolute have no meaning for the Help Window. Therefore, this function is the same as CFG.selectRectAbs for the Help Window.
This command cannot be used when the target window is building a fractal.
See Also CFG.deselect
CFG.getSelection
CFG.haveSelection
CFG.selectAll
CFG.selectRectAbs
Verb CFG.selectWindow
Syntax CFG.selectWindow( name )
Parameters name is the title of the window to select.
Action Makes the specified window the front-most window.
Returns True if the named window was found or false if no such window exists.
Examples CFG.selectWindow( "Mandelbrot 1" )
» true
Notes The selected window becomes the target window.
See Also CFG.getTarget
CFG.nthWindow
CFG.selectParamsWindow
CFG.setTarget
Verb CFG.setDepth
Syntax CFG.setDepth( depth )
Parameters depth is the number of bits per pixel. Default values are defined in "CFG.const.depth...". A setting of CFG.const.depthDeep means to use the depth of the deepest screen.
Action Sets the target's color depth.
Returns True if depth altered, false on error.
Examples CFG.setDepth( CFG.const.depth16Bit )
» true
Notes Always reset the target window after false is returned. It is possible that a memory allocation error will occur when attempting to change the depth of the offscreen buffer. In this case, the window may be disposed.
If the target is not a fractal window, the new depth will become the default depth for new fractals. This information will be reflected in the New Parameters Window.
The depth is actually a field of the preferences. However, since it is unwieldy to handle the preferences structure just to modify the fractal color depth, this function and CFG.getDepth were created.
This command cannot be used when the target window is building a fractal.
See Also CFG.getDepth
CFG.getPreferences
CFG.setPreferences
Verb CFG.setFractalData
Syntax CFG.setFractalData( fracData )
Parameters fracData is a record containing the data fields that the user wants to modify.
Action Inserts the fractal data into the target.
Returns True if the data was applied, false if the data was invalid data or if not a fractal window.
The meaning of this data depends on the type of fractal that it came from (which is determined from CFG.getFractalType). The record structure is located in the "CFG Scripting Guide."
Fields that the user does not wish to alter can be omitted.
Data verification will be performed.
This command cannot be used when the target window is building a fractal.
See Also CFG.getBinary
Verb CFG.setFractalType
Syntax CFG.setFractalType( fractal )
Parameters fractal is the name or ID of a fractal type. Constants are defined in "CFG.const.ftype..." and "CFG.const.fname...".
Action Sets the fractal type to use for new fractals.
Returns True if desired fractal could be set, false otherwise.
Notes The target cannot be a fractal window, as once a fractal is assigned to a window, it cannot be changed.
See Also CFG.getFractalType
CFG.listFractalTypes
Verb CFG.setFSizeCustom
Syntax CFG.setFSizeCustom( customSize )
Parameters customSize is a Point whose horizontal and vertical fields specify the width and height of the fractal respectively.
Action Sets the fractal size according to the user specified horizontal and vertical coordinates.
Returns True if size was valid or false on error.
Examples p = point( 640 + 480 * 0x10000 ) « a little trick to use h,v integers to create a point
CFG.setFSizeCustom( p )
» true
p = point( "-10, 32001" )
CFG.setFSizeCustom( p )
» false
Both the fields of customSize are invalid.
Notes If the target window is not a fractal, the global size values are modified, which specify the size of newly created fractals. This information will be reflected in the New Parameters Window.
This command cannot be used when the target window is building a fractal.
See Also CFG.setFSizeMenu
Verb CFG.setFSizeMenu
Syntax CFG.setFSizeMenu( sizeItem )
Parameters sizeItem is a constant that defines which standard size to use. See "CFG.const.fsize..." for a list of default sizes.
Action Set the fractal's size to standard sizes displayed in the Size Menu.
Returns True if the fractal size was changed, false on error.
Sets the fractal size to that of a 13" monitor (640 x 480 pixels).
CFG.setFSizeMenu( 9 )
» false
Size item number is invalid.
Notes If the target window is not a fractal, the global size values are modified, which specify the size of newly created fractals. This information will be reflected in the New Parameters Window.
Use the CFG.setFSizeCustom command for non-standard image sizes.
This command cannot be used when the target window is building a fractal.
See Also CFG.setFSizeCustom
Verb CFG.setLimitExtreme
Syntax CFG.setLimitExtreme( limit )
Parameters limit is a Boolean set to true to turn the limiting on and false to turn it off.
Action Alter the target's limit extreme value.
Returns True
Examples CFG.setLimitExtreme( true )
» true
Notes The target may be any type of window.
If the target is the Help Window or New Parameters window, the setting is applied to the global setting, which affects newly created fractals.
See Also CFG.getLimitExtreme
Verb CFG.setPalFromList
Syntax CFG.setPalFromList( paletteTitle )
Parameters paletteTitle is the name of the palette that appears in the target's Palette menu.
Action Sets the palette entitled paletteTitle as the target's current palette.
The palette entitled "An ugly palette" does not exist in the target's Palette menu.
Notes If the target is a fractal window, the palette is made the current palette. Colors are altered immediately for 4 and 8 bit systems. Fractals with more colors require a redraw.
If the target is not a fractal window, the new palette will be the default palette for new fractals. This information is displayed in the New Parameters Window.
The palette menu has a set of standard palette defined and one custom palette per fractal. If you wish to assign the custom palette, be sure to obtain its name by using CFG.getPaletteList().
Note that the custom palette displayed in the Palette menu is for the top fractal window only. If the target is not the top-most window, the custom palette in the Palette menu may not be the target's custom palette.
This command cannot be used when the target window is building a fractal.
See Also CFG.getPaletteFile
CFG.listPalettes
CFG.savePaletteFile
Verb CFG.setPreferences
Syntax CFG.setPreferences( prefs )
Parameters prefs is a record with the preferences data.
Action Copies the data into the target's preferences.
Notes Setting to foreground mode will prevent CFG from processing further Apple Events while a fractal is generating.
See Also CFG.getSpeed
Verb CFG.setTarget
Syntax CFG.setTarget( name )
Parameters name is the title of the window which will be made the target. If name is an empty string, the front-most window is made target.
Action Makes the specified window the target window.
Returns A string with the title of the target window, or an empty string if the desired target was not found.
Examples CFG.setTarget( "Mandelbrot 1" )
» "Mandelbrot 1"
CFG.setTarget( "" )
» "Dragon 2"
The front-most window is made the target since the name parameter was an empty string. "Dragon 2" is the name of the new target window.
Notes If an empty string is passed as the desired target's title, the front-most window is set as the target and its name is returned.
If the specified target was not found, an empty string is returned. In this case, the target of subsequent operations will default to the front-most window.
See Also CFG.getTarget
CFG.selectWindow
Verb CFG.windowType
Syntax CFG.windowType()
Parameters None
Action Get the window type of the target.
Returns An integer containing the window type. Window type constants are defined in CFG.const.wtype...".
Examples CFG.windowType()
» 1
Notes The target may be any type of window.
The Custom Fractal Window and Fractal Movie Window are not supported in the current version of CFG, but may be in future versions.
See Also CFG.getFractalType
Verb CFG.zoomInOut
Syntax CFG.zoomInOut( zIn )
Parameters zIn is a Boolean specifying whether to zoom in or out. See "CFG.const.zoom...".
Action Zooms the target in or out by a factor of two.
Returns True if zoom was OK, false on error (such as target not a fractal).
Examples CFG.zoomInOut( CFG.const.zoomIn )
» true
Zooming in on the fractal (by a scale factor of 2).
CFG.zoomInOut( CFG.const.zoomOut )
» true
Zooming out on the fractal.
Notes The target must be a fractal, but it cannot be a Random Walk fractal.
This command cannot be used when the target window is building a fractal.
See Also CFG.zoomSelection
CFG.zoomValue
Verb CFG.zoomSelection
Syntax CFG.zoomSelection()
Parameters None
Action Zooms in on the fractal, fitting the selected area to the fractal size.
Returns True on success, false on failure.
Examples CFG.zoomSelection()
» true
Notes The target window must be a fractal, but it cannot be a Random Walk fractal.
The fractal must have a selection. The selection becomes the fractal's bounding rectangle. Thus, the top of the selection will become the new top of the fractal, the selection's left side will become the fractal's left edge, etc.
This command cannot be used when the target window is building a fractal.
See Also CFG.zoomInOut
CFG.zoomValue
Verb CFG.zoomValue
Syntax CFG.zoomValue( zoomX, zoomY )
Parameters zoomX and zoomY are floating point numbers (double precision) which specify the amount to zoom the fractal (horizontally and vertically)
Action Zoom in on the fractal by the specified amount.
Returns True if successful, false on error.
Examples CFG.zoom( 3.0 )
» true
Zooms in on fractal by a factor of 3x.
CFG.zoom( 0.5 )
» true
Zooms out by a factor of 2 (1 / 0.5).
Notes The target window must be a fractal, but it cannot be a Random Walk fractal.
One zooms in by specifying a value greater than one, while one zooms out with values between zero and one.
That is, one may zoom out by a factor X by specifying the zoom amount to be (1 / X).
Zoom values less or equal to 0 are invalid.
This command cannot be used when the target window is building a fractal.
See Also CFG.zoomInOut
CFG.zoomSelection
Verb CFG.zoomWindow
Syntax CFG.zoomWindow()
Parameters None
Action Enlarges / Reduces the size of the target window.
Returns True if successful, false if the zoom failed.
Examples CFG.zoomWindow
» true
Notes The target window cannot be the New Parameters Window. This window has a fixed size.