SELECTINTERACTION__DEFINE Name
SELECTINTERACTION__DEFINE
Purpose
The purpose of this routine is to implement the most basic of interactions.
An "interaction" is an operation that takes over control of a draw widget and
allows the user to interact with the draw widget in some way. For example,
drawing ROI's on a draw widget is a good example of an interaction. This will
be the basic interaction object many other interactions will inherit.
The philosophy of an interaction is that there is an object to "draw" in the
window. Once drawn, the object can be selected, moved, rearranged, resized, etc.
Then, when finished the interaction can report results to the real event handler
for the draw widget.
Much of the event handling for an interaction occurs in the INTERACTION_EVENTS
method of the object being drawn or manipulated. These objects are SELECTABLEOBJECTS
(e.g. BOX, CAT_ARROW, TEXTLINE, etc.) and must be written in a particular way. This
approach is, in my opinion, overly complicated at the moment, and new interaction
objects are difficult to write. I have given this subject a great deal of thought,
and have still not hit on the one simple, elegant idea. So, I leave this to you.
Authors
FANNING SOFTWARE CONSULTING BURRIDGE COMPUTING
1645 Sheely Drive 18 The Green South
Fort Collins Warborough, Oxon
CO 80526 USA OX10 7DN, ENGLAND
Phone: 970-221-0438 Phone: +44 (0)1865 858279
E-mail: davidf@dfanning.com E-mail: davidb@burridgecomputing.co.uk
Category
Objects. Syntax
theObject = Obj_New("SELECTINTERACTION")
Superclasses
CATATOM
CATCONTAINER IDLITCOMPONENT
IDL_CONTAINER
Event Structure
event = { ID:theObject, TOP:topObject, HANDLER:Obj_New(), EVENT_NAME='SELECTINTERACTION_EVENT', $
NAME: self._name, ACTION:"", CURRENTMODE:"", ... }
If the interaction is in DRAW mode, an event is generated immediately upon an UP event.
If the interaction is in INSERT mode, the action is similar, unless the ASK_ON_UP keyword
is set. Then, the event is sent only when the user responds to the CANCEL or ACCEPT buttons.
In any case, the ACTION field is always set to "ACCEPT" unless the CANCEL button is selected,
and then it is set to "CANCEL".
Class Structure
class = { SELECTINTERACTION, $
_ask_on_up: 0B, $ ; Flag for UP button dialog widget.
_color: "", $ ; The color of the object drawn.
_coord_object: Obj_New(), $ ; A coordinate object.
_drawID: Obj_New(), $ ; The draw widget whose events are being hijacked.
_drawID_events: IntArr(7), $ ; Storage for the draw widget event types.
_drawID_excl_event_obj: Obj_New(), $ ; The old exclusive event (if there is one).
_drawID_pixmap: Obj_New(), $ ; A pixmap for storing the drawID picture.
_drawID_event_objects: Ptr_New(), $ ; The event objects for the draw widget.
_contextmenu: Obj_New(), $ ; The context menu.
_linestyle: 0L, $ ; The linestyle of the object drawn.
_mode: "", $ ; The "mode" of the interaction: eg., INSERT or DRAW.
_noPicture: 0L, $ ; A flag: Should picture be restored at end of interaction?
_selectedObject: Obj_New(), $ ; A selectable interaction object that can be moved.
_statusbar: Obj_New(), $ ; A statusbar object. Can be passed messages, etc.
_sx: 0L, $ ; The static X location of a selected item.
_sy: 0L, $ ; The static Y location of a selected item.
_thick: 0L, $ ; The thickness of the line of the object drawn.
INHERITS CATATOM $
}
Messages
None.
Modification History
Written by: David W. Fanning, 10 February 2004.