# coyote: CGWINDOW_SETDEFS

- coyote/Graphics
- [Source code]

Description

      Allows the user to set global defaults for resizeable cgWindow programs.

Categories

      Graphics

Keywords

      adjustsize: in, optional, type=boolean, default=0
          Set this keyword to have the default text size adjusted to fit the size of the
          display window.
      aspect: in, optional, type=float, default=0.0
          Set the aspect ratio of the window. If set to 0, the normal "default" window
          aspect ratio is used and nothing special is done when the window is resize.
          If aspect is not 0, then the window is confined to this aspect ratio.
      background: in, optional, type=string
          The background color of the window. Only use if the ERASEIT property is also set.
      delay: in, optional, type=float, default=0
          Set this keyword to the amount of delay desired between command execution. 0
      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.
      im_density: in, optional, type=integer, default=300
          Set this keyword to the sampling density when ImageMagick creates raster image
          file from PostScript output.
      im_png8: in, optional, type=boolean, default=0
          Set this keyword to create an 8-bit PNG file rather than the normal 24-bit PNG file.
      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_raster: in, optional, type=boolean, default=1 (if ImageMagick is found)
          When raster files are created programmatically, this keyword determines if the
          raster file is created directly in IDL (value =0) or is created from a PostScript
          intermediate file via ImageMagick (value =1). The default is via ImageMagick if the
          convert program can be found on the machine running the program.
      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_tiff_depth: in, optional, type=integer, default=8
          Set this keyword to the number of bits per channel in TIFF file output. Allowed values
          are 8, 16, and 32.
      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.
      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.
      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, default=0.0
          Set this value to the !P.Charsize value to use when creating PostScript output. This
          value is not used if !P.Charsize is set to anything other than 0.0.
      ps_decomposed: in, optional, type=boolean
          If set, use decomposed color in the PostScript device.
      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, default=0
           Set this to the !P.Font value to use for creating PostScript files.
      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 suppress output messages from cgPS_Open and cgPS_Close.
      ps_scale_factor: in, optional, type=float, default=1.0
           Set this keyword to the PostScript scale factor you want to use for PostScript output.
      ps_tt_font: in, optional, type=string, default="Helvetica"
           Set this keyword to the name of the PostScript true-type font to use for PostScript output.
           Not used, unless !P.Font=1.
      reset: in, optional, type=boolean, default=0
          Set this keyword to reset all values to their default values.
      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.
      xomargin: in, optional, type=intarr(2)
          Set this keyword to set !X.OMargin to this value for multiplots.
      xpos: in, optional, type=integer
          Set this keyword to the X offset of the window from the upper-left corner of the display.
      xsize: in, optional, type=integer, default=640
          Set this keyword to the starting X size of the window.
      yomargin: in, optional, type=intarr(2)
          Set this keyword to set !Y.OMargin to this value for multiplots.
      ypos: in, optional, type=integer
          Set this keyword to the Y offset of the window from the upper-left corner of the display.
      ysize: in, optional, type=integer, default=512
          Set this keyword to the starting Y size of the window.

Examples

      Used to set cgWindow global properties::
         IDL> cgLoadCT, 5, RGB_TABLE=palette
         IDL> cgWindow_SetDefs, PALETTE=palette, $
                 ERASEIT=1, XSIZE=800, YSIZE=400, XPOS=100, YPOS=200, $
                 PS_ENCAPSULATED=1, PS_METRIC=1
         IDL> cgImage, cgDemoData(7), /WINDOW, MARGIN=0.1

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, 29 January 2011. DWF.
         Small bug fixes, and addition of PS_QUIET keyword. 17 Feb 2011. DWF.
         Added Raster_IM, 18 February 2011. Jeremy Bailin.
         Added the ability to set and unset adjustable text size in
           cgWindow with ADJUSTSIZE keyword. 24 April 2011. DWF.
         Added PS_DECOMPOSED keyword to set the PostScript color mode. 30 Aug 2011. DWF.
         Added ASPECT keyword to allow getting/setting of window aspect ratio. 18 Nov 2011. DWF.
         Added PDF_UNIX_CONVERT_CMD and PDF_PATH keywords. 7 Dec 2011. DWF.
         Added IM_WIDTH keyword. 3 April 2012. DWF.
         Added IM_PNG8 keyword. 3 April 2012. DWF.
         Added IM_TIFF_DEPTH keyowrd. 14 May 2013. DWF.

Copyright

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