/* TEACH GO_CLASSES                             Ben Rabau, 27th Aug 1993

This file shows an examples of every simple object which can be visualised.
They can be dragged around as described in TEACH * GO_DRAG, be changed
and manipulated as described in TEACH * GO  and TEACH * MAKE_EDITABLE.

See HELP * GO_CLASSES for a hierarchical view of all classes.

For more general detailed information see

TEACH * GO
HELP * GO
REF * GO

         CONTENTS - (Use <ENTER> g to access required sections)

 -- Simple objects
 -- Extra features
 -- Composite objects

 */
;;; Requires the following file to be loaded:
uses go;

;;; The following files will be loaded by the above or autoloaded:
/*
uses go_point;
uses go_polyline;
uses go_polyarrow;
uses go_square;
uses go_rectangle;
uses go_oblong;
uses go_polygon;
uses go_arc;
uses go_circle;
uses go_bitmap;
uses go_text;
uses go_text_input;
 */

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

/*
-- Simple objects -----------------------------------------------------
 */
;;; We now make a few simple objects. They all appear in the middle
;;; of the screen and can be moved around by holding the left most
;;; mouse button down over the object while dragging to a new location.

vars
     a_point     = newgo_point(),      ;;; TEACH * GO_POINT
     a_line      = newgo_polyline(),   ;;; TEACH * GO_POLYLINE
     an_arrow    = newgo_polyarrow(),  ;;; TEACH * GO_POLYARROW
     a_polygon   = newgo_polygon(),
     a_rectangle = newgo_rectangle(),  ;;; TEACH * GO_RECTANGLE
     an_oblong   = newgo_oblong(),     ;;; TEACH * GO_OBLONG
     a_square    = newgo_square(),
     an_icon     = newgo_bitmap(),     ;;; TEACH * GO_BITMAP
     an_arc      = newgo_arc(),        ;;; TEACH * GO_ARC
     a_circle    = newgo_circle(),     ;;; TEACH * GO_CIRCLE
     a_text      = newgo_text(),       ;;; TEACH * GO_TEXT
     a_text_input= newgo_text_input(); ;;; TEACH * GO_TEXT_INPUT

go_add_to(a_point,      go_default_pane );
go_add_to(a_line,       go_default_pane );
go_add_to(an_arrow,     go_default_pane );
go_add_to(a_polygon,    go_default_pane );
go_add_to(a_rectangle,  go_default_pane );
go_add_to(an_oblong,    go_default_pane );
go_add_to(a_square,     go_default_pane );
go_add_to(an_icon,      go_default_pane );
go_add_to(an_arc,       go_default_pane );
go_add_to(a_circle,     go_default_pane );
go_add_to(a_text,       go_default_pane );
go_add_to(a_text_input, go_default_pane );

/*
-- Extra features -----------------------------------------------------
 */
;;; NOTES:
;;;        - Some classes have interesting variants like filled/transparent
;;;          or open/closed
;;;        - Open Polygons are in fact polylines (see TEACH * MAKE_EDITABLE)
;;; Examples:
false    -> go_closed(a_polygon);

true     -> go_filled(a_square);         ;;; No longer transparent color
'yellow' -> go_bgcolour(a_square);       ;;; Now has a yellow interior
'red'    -> go_fgcolour(a_square);       ;;; Now has a red border
;;; If you move the square over one of the objects created before the square
;;; (a_point, a_line, an_arrow, a_polygon, a_rectangle or an_oblong) then
;;; the square will obscure the other object. All other objects are created
;;; on top of the square.

/*
-- Composite objects --------------------------------------------------
 */
;;; There is one composite object called "go_group". It can contain
;;; an arbitrary number of objects. See also TEACH * GO_GROUP

vars a_group = newgo_group();
go_add_to( a_group , go_default_pane );

;;; E.g. move things together and then to form a simple go_group:
go_centre_to( 100, 150, a_text);
go_centre_to( 100, 100, an_icon);
go_centre_to( 100, 100, a_circle);
go_add_to( a_text,   a_group );
go_add_to( an_icon,  a_group );
go_add_to( a_circle, a_group );

;;; From now on all three objects move as a unit.


;;; eof;

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