\begindata{text,538490844}
\textdsversion{12}
\template{default}
\define{global
}


\chapter{LAYOUT}


\italic{Layout} and its companion \italic{layoutview} provide a way to lay out 
a combination of ATK objects in a single rectangle with arbitrary positions 
and sizes.  Each object is given a fixed size and position.  Overlapping 
objects will generally work, although there are a few cases of advanced 
graphic operations which are not properly handled.


This document describes the user interface to layout.



\subsection{User mode versus authoring mode}


Layouts are built in an \italic{authoring mode}, in which the actual layout is 
being constructed or modified.  In \italic{user mode} the layout is fixed and 
the objects themselves are being filled in.


In user mode the layout does its best to get out of the way, passing all input 
to the component objects.  In authoring mode, input is interpreted by the 
layout itself rather than the component objects.  You switch between modes 
using the menus:


\leftindent{\paragraph{Enter Authoring} (no default key sequence) switches to 
authoring mode.


\paragraph{Exit Authoring} (default key sequence ESC-x) switches to user mode.

}

\subsection{Visual appearance}


In order to indicate when it is in authoring mode, layout uses a small "x" 
cursor and draws a dotted line around each component object.  One may be the a 
\italic{current selection,} which is surrounded by a solid line rather than a 
dotted line.  In certain cases, the current selection can be \italic{active}, 
in which case it receives input as it would in user mode.  You can tell an 
active selection because it highlights itself in some manner and (usually) 
posts its own cursor.  You can deactivate an active object with \italic{Enter 
Authoring} or \italic{Leave Authoring} from the menus or by selecting a 
different object.



\subsection{Selecting objects}


Click either button once on an object to select it.  Click somewhere else to 
cancel the selection.


Once you have selected an object you can move, resize, and rearrange it (as 
discussed later) or perform the following basic operations on it:


\leftindent{\paragraph{Paste object} (key sequence CTRL-y) replaces the 
currently selected object with the contents of the cut buffer.


\paragraph{Imbed object} (key sequence ESC-tab) prompts for the name of a data 
object which it then places inside the currently selected component.


\paragraph{Cut object} (key sequence CTRL-d) deletes the currently selected 
object and places its contents in the cut buffer.

}

\subsection{Activating objects}


Double click on an object to select it, make it active and pass the mouse 
click to it.  (Because mouse and keyboard input is passed into the active 
object, you must deactivate an object before you can drag or resize it.)



\subsection{Creating new objects}


Move the mouse while holding the button down to create a new object.  The 
points at which you start and end define opposite corners of the rectangle for 
the new object.   Layout will display a "rubber-band" rectangle showing where 
the new object will go. The newly created object will start out selected and 
active so that you can fill it in.


How a newly-created is initialized depends on the most recent choice from the 
following three menu options:


\leftindent{\paragraph{Filler on create} tells layout to use the "filler" 
object for newly created objects.  This is the default behavior.  Fillers are 
one convenient way to select insets.  See the separate documentation for 
filler.


\paragraph{Paste on create} tells layout to perform an automatic paste 
operation whenever it creates a new object.  This is especially useful in 
conjunction with arbcon.


\paragraph{Null on create} tells layout not to fill anything into newly 
created objects.  If you select this you will have to use the paste or imbed 
operations to fill in your objects.

}

\subsection{Moving and resizing objects}


To move an object, press a mouse button in the interior of the object and drag 
to the new position.  To resize, press close to an edge or corner and drag to 
its new position.  Layout will display a "rubber band" rectangle showing where 
the object will move to.  Moving and resizing select the object and place it 
in front of all other objects in the layout.


You can choose a granularity of control over object placement.  Finer 
granularity allows you greater precision of placement but makes it harder to 
line things up exactly.  The possibilities (on the menu) are:


\leftindent{\paragraph{Fine granularity} gives the maximum control over 
placement; you can move or resize objects to any pixel on the screen.  A pixel 
is approximately a typesetter's point, or 1/72 inch.


\paragraph{Medium granularity} gives placement to the nearest 1/12 inch (6 
pixels).


\paragraph{Coarse granularity} gives placement to the nearest 1/4 inch (18 
pixels).

}

\subsection{Deleting objects}


To delete an object, resize it so it has a small height or width, or select 
\italic{Cut} from the authoring menu.  This will automatically remove the 
object and place its contents in the cut buffer.



\subsection{Handling overlapping objects}


When two objects overlap, one appears in front of the other and partially or 
totally obscures it on the display.  Layouts try to handle this gracefully but 
there are certain cases (printing, incremental scrolling) in which you may 
obtain unexpected results from overlapping objects.  You can move an object to 
the front simply by resizing or dragging it.  Other operations which affect 
the overlapping order are:


\leftindent{\paragraph{Move to back} (key sequence ESC-d) moves the currently 
selected object behind other objects in the layout.  Layout will not move an 
object behind another which would completely obscure it.  You may need to use 
this if you can't find an object because it is completely obscured by others.


\italic{Make background} (key sequence ESC-b) moves the currently selected 
object to the back and expands it to fill the entire layout.  Background 
objects automatically resize themselves when the layout is resized.  You can 
stop this by dragging their edges away from the edges of the layout.  You can 
not, however, move a background object other than resizing it.

}

\subsection{Variable versus fixed objects}


Some components of a layout, such as titles, may be fixed for all time while 
other components are intended to be edited or otherwise changed.  Layout 
supports a distinction between variable objects, which are allowed to receive 
input, and fixed objects, which are not.


\leftindent{\paragraph{Make variable} (key sequence ESC-v) allows the 
currently selected object to receive input (and thus edit itself) in user 
mode.  This is the standard case.


\paragraph{Make fixed} (key sequence ESC-f) allows the currently selected 
object to receive input (and thus edit itself) only in Authoring mode.  You 
would use this for titles and other decorations of the layout which the end 
user is not expected to change.

}

\subsection{Special Considerations}


The update routine in layoutview uses clipping regions (not just rectangles) 
to prevent behind objects from overwriting in-front objects.  As the update 
runs down the component list, which is ordered front to back, it accumulates a 
residual clipping region by subtracting out already drawn objects.  There is 
one case in which this fails:  text sometimes moves its window up or down with 
a blt operation, not noticing that the source of the blt isn't all there.  A 
redraw (control L) fixes this, of course.


Printing has certain problems.  Scaling assumes that one pixel on the screen 
corresponds to one point (1/72 inch); imbedded objects such as raster images 
may have different rules.  Overlapping objects are printed inconsistently - on 
the screen the object in front writes both the black and the white contents of 
its visual rectangle, regardless of any object behind it, but in the printed 
output the front object simply overprints the back object.  Generally you 
should avoid printing overlapping objects.




Author:  John H Howard

Last updated: 
 \
\begindata{writestamp,538756488}
Datastream version: 1
%o %A, %Y at %u:%M
andysans12
724628462
\enddata{writestamp,538756488}
\view{writestampview,538756488,667,0,0}




\begindata{bp,537558784}
\enddata{bp,537558784}
\view{bpv,537558784,669,0,0}
Copyright 1992 Carnegie Mellon University and IBM.  All rights reserved.

\smaller{\smaller{$Disclaimer: 

Permission to use, copy, modify, and distribute this software and its 

documentation for any purpose is hereby granted without fee, 

provided that the above copyright notice appear in all copies and that 

both that copyright notice, this permission notice, and the following 

disclaimer appear in supporting documentation, and that the names of 

IBM, Carnegie Mellon University, and other copyright holders, not be 

used in advertising or publicity pertaining to distribution of the software 

without specific, written prior permission.



IBM, CARNEGIE MELLON UNIVERSITY, AND THE OTHER COPYRIGHT HOLDERS 

DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING 

ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.  IN NO EVENT 

SHALL IBM, CARNEGIE MELLON UNIVERSITY, OR ANY OTHER COPYRIGHT HOLDER 

BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY 

DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 

WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS 

ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 

OF THIS SOFTWARE.

 $

}}\enddata{text,538490844}
