CGCONTROL
Allows the user to set various properties of an cgWindow object. This is essentially
a wrapper to the cgWindow SetProperty method.
Categories
Graphics
Params
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
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.
adjustsize: in, optional, type=boolean
Set this keyword to adjust default character size to the display window size.
aspect: in, optional, type=boolean
Set this keyword to the desired aspect ratio (ysize/xsize) of the window.
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', default='cgwindow.bmp'
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', default='cgwindow.gif'
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', default='cgwindow.jpeg'
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', default='cgwindow.pdf'
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', default='cgwindow.png'
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', default='cgwindow.ps'
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', default='cgwindow.tiff'
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.
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.
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_density: in, optional, type=integer, default=300
Set this keyword to the sampling density when ImageMagick creates raster image
file from PostScript outout.
im_options: in, optional, type=string, default=""
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_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_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_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.
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.
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.
pdf_path: out, optional, type=string
Set this keyword to the name of the path to the Ghostscript command for converting PS to PDF.
pdf_unix_convert_cmd: out, optional, type=string
Set this keyword to the name of an alternative UNIX command to convert PostScript 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 PSCONFIG 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 PSConfig command. Normally, 0 (hardware fonts) or 1 (true-type fonts).
ps_metric: in, optional, type=boolean, default=0
Set this keyword to configure PSCONFIG 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 PS_Start.
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.
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.
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.
Examples
Used to set cgWindow properties::
IDL> cgControl, Background='gray', EraseIt=1
IDL> cgControl, Multi=[0,2,2]
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/
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.
Copyright
Copyright (c) 2011-2012, Fanning Software Consulting, Inc.