MGH_DGWINDOW__DEFINE Class
MGH_DGwindow Purpose
This class encapsulates a widget application containing a direct
graphics window. The window displays the results of one or more
direct-graphics commands, each stored in an MGH_Command object
Category
Widgets, Direct Graphics. Properties
The following properties (ie keywords to the Init, GetProperty &
SetProperty methods) are supported:
COMMANDS (Init, Get, Set)
A list of MGH_Command objects specifying commands to be
executed each time the window is drawn.
DIMENSIONS (Init, Get, Set)
A 2-element array specifying the width & height of the
graphics window.
EXPAND_STATUS_BAR (Init, Get, Set)
This property determines whether the the "status bar" beneath
the draw widget is expanded or collapsed. Default is 1 (expanded).
MOUSE_ACTION (Get)
A 3-element string array specifying the mouse handler object
to be associated with each mouse button. Mouse press, release
& motion events that originate from the draw widget are sent
to "mouse handler" objects, one handler per mouse
button. These handlers are created and destroyed by the
SetUpMouseHandler method. For an MGH_DGwindow object, the
MOUSE_ACTION property is set to ['Pick','None','Context']
and cannot be changed.
RESIZEABLE (Init, Get)
Set this value to 1 (the default) to allow the base to be
resized and 0 to suppress resizing. The value cannot be
changed after initialisation because WIDGET_CONTROL does not
support this.
NAME (Init, Get, Set)
A name for the plot, to be used in forming file names.
RESIZEABLE (Init, Get)
This property controls what action is taken in response to
resize events. Valid values are:
0 - Base resizing does not change the window dimensions.
1 - Base resizing changes the window dimensions.
2 - Base resizing changes the window dimensions in such a
way that the aspect ratio is preserved. This is the
default.
TITLE (Get)
The title appears in the base widget's title bar. It is
calculated from the picture name.
TOOLTIP (Get)
The tool tip appears when the cursor hovers over the draw
widget. It is calculated from the picture name.
USE_PIXMAP (Init, Get)
This property specifies whether graphics commands will be sent
straight to the window (0) or rendered first in an off-screen
pixmap (1). Default is 0.
###########################################################################
This software is provided subject to the following conditions:
1. NIWA makes no representations or warranties regarding the
accuracy of the software, the use to which the software may
be put or the results to be obtained from the use of the
software. Accordingly NIWA accepts no liability for any loss
or damage (whether direct of indirect) incurred by any person
through the use of or reliance on the software.
2. NIWA is to be acknowledged as the original author of the
software where the software is used or presented in any form.
###########################################################################
Modification History
Mark Hadfield 2000-07:
Written, based on XWINDOW by David Fanning.
Mark Hadfield 2001-06:
Modified for the following name change: MGHdgCommand ->
MGH_Command. This reflects the fact that command objects are not
restricted to a Direct Graphics context.
Mark Hadfield 2001-09:
The Plot method is now deprecated in favour of NewCommand.
Mark Hadfield 2001-1:
- Added a DrawToClipboard method and a corresponding Edit.Copy
menu item based on David Fanning's CLIPBOARD routine.
Mark Hadfield, 2002-09:
- Increased maximum number of positional parameters allowed by
the NewCommand method to 4.
Mark Hadfield, 2002-10:
- Updated for IDL 5.6.
- Added mouse handling, using mouse-handler objects as in
MGH_Window. Code is adapted from the latter but only two
mouse handlers are available (Pick & Context) and they cannot
be changed.
Mark Hadfield, 2004-03:
- Renamed all "DrawTo" methods to "WritePictureTo". This
was done for consistency with MGH_Window, MGH_Player and
MGH_DGplayer.
- Added a "WriteToImageFile" method..