/* TEACH GO_POLYARROW                          Ben Rabau, 27th Aug 1993

This file shows a few examples of arrows which can be dragged arround.
These objects are based on the class "go_polyline" (TEACH * GO_POLYLINE).

For more general detailed information see

HELP * GO
REF * GO

 */

;;; Requires the following files to be loaded:
uses go;
uses go_polyarrow;

;;; It also requires the GO window to be active:
go_init_rc();


;;; Create a few arrows:
vars arrow1, arrow2;

newgo_polyarrow() -> arrow1;
newgo_polyarrow() -> arrow2;

;;; Show them on the screen:
go_add_to( arrow1 , go_default_pane );
go_centre_to(-100, 0,  arrow1 );    ;;; move it to the left (see TEACH * GO)
go_add_to( arrow2 , go_default_pane );

;;; To make it easier to recognise we can make arrow1 red:
'red' -> go_fgcolour( arrow1 );

;;; The arrow heads can be made resized by influencing the "go_border" slot.
;;; However this slot is not active, so you would have to go_internal_redraw the
;;; arrow. The go_arrow_size() method does it for you:
4 -> go_arrow_size( arrow1 );

;;; The arrow can become a single arrow by changing the slots:
;;; go_from_arrow or go_to_arrow to true or false.
;;; However these slots are not active, so you need to go_redraw the arrows:
false -> go_from_arrow( arrow1 );
false -> go_to_arrow( arrow2 );
go_redraw( arrow1 );
go_redraw( arrow2 );

;;; You can also change the arrow by Direct Manipulation (DM), see
;;; also TEACH * GO_DRAG.

;;; If made editable with go_make_editable() then the DM features are:
;;; 1. If the arrow is picked up in the go_middle then it is moved as
;;;    a whole.
;;; 2. If the arrow heads are picked up then the arrow streches
;;;    accordingly.
go_make_editable( arrow2 );

;;; You can add additional points with:
5 -> go_npoints( arrow2 );

;;; When you move the editors (which might overlap if only one line is
;;; available), you will see a polyline-arrow.

;;; To stop do:
go_make_uneditable( arrow2 );

;;; Note: If you try to pick up a polyarrow it can be easier on some of its
;;; lines than on others.

;;; As with all polylines and polygons you can influence the rounding. E.g.:
go_smooth( arrow2 );
go_roughen( arrow2 );


;;; eof

--- C.all/lib/proto/go/teach/go_polyarrow
--- Copyright University of Sussex 1993. All rights reserved.
