Coyote Graphics Routines

Date: Fri Mar 27 12:14:20 2015

single page | use frames     summary     class     fields     routine details     file attributes

.\

cgcontrol.pro


top cgControl

Graphics

cgControl, selection [, /ADJUSTSIZE] [, /ALL] [, BACKGROUND=string] [, CMDINDEX=integer] [, CREATE_BMP=string] [, CREATE_GIF=string] [, CREATE_JPEG=string] [, CREATE_PDF=string] [, CREATE_PNG=string] [, CREATE_PS=string] [, CREATE_TIFF=string] [, PALETTE=byte] [, DELAY=float] [, /DELETECMD] [, /DESTROY] [, DIMENSIONS=intarr(2)] [, /ERASEIT] [, /EXECUTE] [, GET_KEYCMDINDEX=integer] [, GET_KEYWORD=string] [, GET_KEYVALUE=any], LISTCMD=LISTCMD [, MULTI=Intarr(5)] [, /OBJECT] [, OUTPUT=string] [, /TITLE] [, /UPDATE] [, /WIDGETID] [, XOMARGIN=intarr(2)] [, YOMARGIN=intarr(2)] [, IM_DENSITY=integer] [, IM_RESIZE=integer] [, IM_OPTIONS=string] [, /IM_RASTER] [, /IM_TRANSPARENT] [, IM_WIDTH=integer] [, PDF_UNIX_CONVERT_CMD=string] [, PDF_PATH=string] [, PS_CHARSIZE=float] [, /PS_DECOMPOSED] [, /PS_DELETE] [, /PS_ENCAPSULATED] [, PS_FONT=integer] [, /PS_METRIC] [, /PS_QUIET] [, PS_SCALE_FACTOR=float] [, PS_TT_FONT=string] [, RESIZE=integer] [, RESTORE_VISUALIZATION=string] [, SAVE_VISUALIZATION=string]

Allows the user to set various properties of an cgWindow object. This is essentially a wrapper to the cgWindow SetProperty method.

Parameters

selection in required type=varies

Normally, a window index number of an cgWindow application. But, the selection can be a widget identifier, an object reference, or a window title, depending on which keywords are set. The cgWindow matching the selection has its properties set.

Keywords

ADJUSTSIZE in optional type=boolean

Set this keyword to adjust default character size to the display window size.

ALL in optional type=boolean

This keyword applies only to keywords that manipulate commands in the command list (e.g., DeleteCmd). It will select all the commands in the command list to apply the action to.

BACKGROUND in optional type=string

The background color of the window. Only use if the ERASEIT property is also set.

CMDINDEX in optional type=integer

This keyword applies only to keywords that manipulate commands in the command list (e.g., DeleteCmd). It specifies the command index number of the command for which the action is desired.

CREATE_BMP in optional type=string

Set this keyword to the name of a bitmap file to create automatically from the window. Using this keyword is a way to create a bitmap file programmatically from a cgWindow application. The raster file will be created via ImageMagick if im_raster has been set (default). Depreciated now in favor of the Output keyword.

CREATE_GIF in optional type=string

Set this keyword to the name of a GIF file to create automatically from the window. Using this keyword is a way to create a GIF file programmatically from a cgWindow application. The raster file will be created via ImageMagick if im_raster has been set (default). Depreciated now in favor of the Output keyword.

CREATE_JPEG in optional type=string

Set this keyword to the name of a JPEG file to create automatically from the window. Using this keyword is a way to create a JPEG file programmatically from a cgWindow application. The raster file will be created via ImageMagick if im_raster has been set (default). Depreciated now in favor of the Output keyword.

CREATE_PDF in optional type=string

Set this keyword to the name of a PNG file to create automatically from the window. Using this keyword is a way to create a PDF file programmatically from a cgWindow application. The PDF file will be created via the Coyote Graphics program cgPS2PDF. Depreciated now in favor of the Output keyword.

CREATE_PNG in optional type=string

Set this keyword to the name of a PNG file to create automatically from the window. Using this keyword is a way to create a PNG file programmatically from a cgWindow application. The raster file will be created via ImageMagick if im_raster has been set (default).

CREATE_PS in optional type=string

Set this keyword to the name of a PostScript file to create automatically from the window. Using this keyword is a way to create a PostScript file programmatically from a cgWindow application. Depreciated now in favor of the Output keyword.

CREATE_TIFF in optional type=string

Set this keyword to the name of a TIFF file to create automatically from the window. Using this keyword is a way to create a TIFF file programmatically from a cgWindow application. The raster file will be created via ImageMagick if im_raster has been set (default). Depreciated now in favor of the Output keyword.

PALETTE in optional type=byte

Use this keyword to pass in an N-by-3 (or 3-by-N) byte array containing the R, G, and B vectors of a color table. It is probably easier to use cgLoadCT or XCOLORS to load color tables for the window, but this is provided as another option.

DELAY in optional type=float

Set this keyword to the amount of "delay" you want between commands in the command list.

DELETECMD in optional type=boolean

Set this keyword to delete a command in the cgWindow. The keywords cmdIndex and All are used in deleting the specified command.

DESTROY in optional type=boolean

Set this keyword to destroy the cgWindow program. This keyword should not be used with other keywords.

DIMENSIONS in optional type=intarr(2)

Set this keyword to a two-element array giving the xsize and ysize of the draw widget.

ERASEIT in optional type=boolean

If this property is set, the cgWindow erases with the background color before displaying the commands in the window's command list.

EXECUTE in optional type=boolean

Set this keyword to 1 to exectute the commands in the window's command list. Set this keyword to 0 to prevent command excution. This is useful, for example, if you want to load commands without having them be executed immediately.

GET_KEYCMDINDEX in optional type=integer

Set this value to the number of the command (zero-based) for which you want to obtain the keyword value. If not provided, the first command (command 0) is searched.

GET_KEYWORD in optional type=string

The name of the keyword whose value you want to return in get_keyvalue. The name must be spelled EXACTLY as you used the keyword, except that case does not matter. The string is converted to UPPERCASE to locate the proper keyword. Although it was my intention to use this to retrieve output keyword values, this is not possible using cgWindow due to the way Call_Procedure and keyword inheritance work.

GET_KEYVALUE out optional type=any

The value of the keyword specified in get_keyword. If the keyword cannot be found, this value will be undefined. You MUST check for this before using the return variable in your program.

LISTCMD
MULTI in optional type=Intarr(5)

Set this keyword to the !P.MULTI setting you want to use for the window. !P.MULTI is set to this setting before command execution, and set back to it's default value when the commands are finished executing.

OBJECT in optional type=boolean

If this keyword is set, the selection is assumed to be an object reference.

OUTPUT in optional type=string

This keyword should be set to the name of an output file. It is a short-hand way of specifying the CREATE_*** keywords. The type of file is taken from the file name extension.

TITLE in optional type=boolean

If this keyword is set, the selection is assumed to be a window title. All matching is done in uppercase characters.

UPDATE in optional type=boolean default=1

Set this keyword to zero if you do not want the updates to be done immediately after the properties are changed.

WIDGETID in optional type=boolean

If this keyword is set, the selection is assumed to be a widget identifier.

XOMARGIN in optional type=intarr(2)

Sets the !X.OMargin system variable when multiple plots are displayed in the window.

YOMARGIN in optional type=intarr(2)

Sets the !Y.OMargin system variable when multiple plots are displayed in the window.

IM_DENSITY in optional type=integer default=300

Set this keyword to the sampling density when ImageMagick creates raster image file from PostScript outout.

IM_RESIZE in optional type=integer default=25

Set this keyword to percentage that the raster image file created my ImageMagick from PostScript output should be resized.

IM_OPTIONS in optional type=string

Set this keyword to any ImageMagick options you would like to pass along to the ImageMagick convert command when creating raster image files from PostScript output.

IM_RASTER in optional type=boolean default=1

Set this keyword to zero to create raster files using the create_png etc. keywords directly, instead of via ImageMagick.

IM_TRANSPARENT in optional type=boolean default=0

Set this keyword to allow ImageMagick to create transparent backgrounds when it makes raster image files from PostScript output.

IM_WIDTH in optional type=integer

Set this keyword to the width of the output raster file in pixel units. The height of the raster file is set to preserve the aspect ratio of the output image. Applies only to raster images (eg PNG, JPEG, TIFF, etc.) created from PostScript files with ImageMagick.

PDF_UNIX_CONVERT_CMD out optional type=string

Set this keyword to the name of an alternative UNIX command to convert PostScript to PDF.

PDF_PATH out optional type=string

Set this keyword to the name of the path to the Ghostscript command for converting PS to PDF.

PS_CHARSIZE in optional type=float

The PostScript character size.

PS_DECOMPOSED in optional type=boolean default=0

Set this keyword to zero to set the PostScript color mode to indexed color and to one to set the PostScript color mode to decomposed color.

PS_DELETE in optional type=boolean default=1

Set this keyword to zero if you want to keep the PostScript output ImageMagick creates when making raster file output.

PS_ENCAPSULATED in optional type=boolean default=0

Set this keyword to configure cgPS_Config to produce encapsulated PostScript output by default.

PS_FONT in optional type=integer

Set this keyword to the type of font you want to use in PostScript output. It sets the FONT keyword on the cgPS_Config command. Normally, 0 (hardware fonts) or 1 (true-type fonts).

PS_METRIC in optional type=boolean default=0

Set this keyword to configure cgPS_Config to use metric values and A4 page size in its interface.

PS_QUIET in optional type=boolean default=0

Set this keyword to set the QUIET keyword on cgPS_Open.

PS_SCALE_FACTOR in optional type=float

Set his keyword to the PostScript scale factor you wish to use in creating PostScript output.

PS_TT_FONT in optional type=string

Set this keyword to the name of a true-type font to use in creating PostScript output.

RESIZE in optional type=integer

A two element array giving the xsize and ysize of the resulting graphics window (the draw widget). If a scalar is passed, the same value will be used for both xsize and ysize.

RESTORE_VISUALIZATION in optional type=string

Set this keyword to the name of a visualization save file to restore.

SAVE_VISUALIZATION in optional type=string default=graphic.cgs

Set this keyword to the name of a file where the visualization should be saved.

Examples

Used to set cgWindow properties:

IDL> cgControl, Background='gray', EraseIt=1 IDL> cgControl, Multi=[0,2,2]

Author information

Author:

FANNING SOFTWARE CONSULTING:

David W. Fanning 1645 Sheely Drive Fort Collins, CO 80526 USA Phone: 970-221-0438 E-mail: david@idlcoyote.com Coyote's Guide to IDL Programming: http://www.idlcoyote.com/

Copyright:

Copyright (c) 2011-2013, Fanning Software Consulting, Inc.

History:

Change History:

Written, 28 January 2011. DWF. Added CREATE_PS keyword. 16 Feb 2011. DWF. Added PS_QUIET, GET_KEYCMDINDEX, GET_KEYWORD, and GET_KEYVALUE keywords. 17 Feb 2011. DWF. Added im_raster and the create_... raster options. 18 Feb 2011. Jeremy Bailin Added the ability to set and unset adjustable text size in cgWindow with ADJUSTSIZE keyword. 24 April 2011. DWF. Added the ability to set the dimensions of the draw widget programmatically. 14 June 2011. Added PS_DECOMPOSED keyword to set the PostScript color mode. 30 Aug 2011. DWF. Added SAVE_VISUALIZATION and RESTORE_VISUALIZATION keywords. 15 Sept 2011. DWF. Added ASPECT keyword to control window aspect ratio. 9 Nov 2011. DWF. Added CREATE_PDF, PDF_UNIX_CONVERT_CMD, and PDF_PATH keywords. 11 Dec 2011. DWF. Added IM_WIDTH keyword. 3 April 2012. DWF. Added the OUTPUT keyword. 3 April 2012. DWF. Removed ASPECT keyword, which never worked, and added RESIZE keyword. 13 Aug 2013. DWF.

File attributes

Modification date: Fri Mar 27 11:07:41 2015
Lines: 635
Docformat: rst rst