Online Eiffel Documentation |
Documentation Home > Class Libraries > EiffelVision 2 > EiffelVision Interface Content > Properties |
EiffelStudio |
EiffelVision Pick and Drop |
Pick and drop is a mechanism which allows data to be transported from a source object to a target. Any Vision2 object inheriting EV_PICK_AND_DROPABLE can be used to transport or receive data.
Two necessary components for a pick and drop transport are a source and a target, both of which must conform to EV_PICK_AND_DROPABLE. The data that is to be transported is known as a pebble.
The following steps need to be undertaken to set up a simple pick and drop:
A simple example of this is demonstrated here:
button1.set_pebble ("A PND transport has occured%N") button2.drop_actions.extend (agent print (?))
As print takes an argument of type STRING_8, button2 becomes a valid target for the pebble contained in button1. Right clicking the mouse pointer over the source will start the transport, and right clicking with the mouse pointer over a valid target will end the transport. The transport can be canceled anytime with a simple left click, just as you would do in EiffelStudio.
Note: When a transport completes, the pebble that was transported is passed as an argument to all features in the targetsdrop_actions whose argument type matches the pebble
There are three different modes of transport available for pick and drop. They are listed below with details of their use:
When mode_is_pick_and_drop or mode_is_drag_and_drop then the shape of the mouse cursor changes to reflect whether the current GUI component below the mouse accepts the pebble or not. Calling set_accept_cursor allows you to customize this cursor used to represent a valid target while calling set_deny_cursor allows you to customize the cursor used for non valid targets.
Copyright 1993-2006 Eiffel Software. All rights reserved. |