\Header{drawDetails}{Customising grid Drawing}
\alias{draw.details}{drawDetails}
\alias{postDrawDetails}{drawDetails}
\alias{preDrawDetails}{drawDetails}
\keyword{dplot}{drawDetails}
\begin{Description}\relax
These generic hook functions are called whenever a grid grob is drawn.
They provide an opportunity for customising the drawing of a
new class derived from grob (or gTree).
\end{Description}
\begin{Usage}
\begin{verbatim}
drawDetails(x, recording)
draw.details(x, recording)
preDrawDetails(x)
postDrawDetails(x)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] A grid grob. 
\item[\code{recording}] A logical value indicating whether a grob
is being added to the display list or redrawn from the display list. 
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
These functions are called by the \code{grid.draw} methods for grobs
and gTrees.

\code{preDrawDetails} is called first during the drawing of a grob.
This is where any additional viewports should be pushed (see,
for example, \code{grid:::preDrawDetails.frame}).  Note that
the default behaviour for grobs is to push any viewports in the
\code{vp} slot, and for gTrees is to also push and up any viewports in the
\code{childrenvp} slot so there is typically nothing to do here.

\code{drawDetails} is called next and is where any additional
calculations and graphical output should occur (see, for example,
\code{grid:::drawDetails.xaxis}.  Note that the default behaviour
for gTrees is to draw all grobs in the \code{children} slot
so there is typically nothing to do here.

\code{postDrawDetails} is called last and should reverse anything
done in \code{preDrawDetails} (i.e., pop or up any viewports that were
pushed;  again, see,
for example, \code{grid:::postDrawDetails.frame}).  Note that the
default behaviour for grobs is to pop any viewports that were pushed
so there is typically nothing to do here.

Note that \code{preDrawDetails} and \code{postDrawDetails} are
also called in the calculation of \code{"grobwidth"} and
\code{"grobheight"} units.
\end{Details}
\begin{Value}
None of these functions are expected to return a value.
\end{Value}
\begin{Author}\relax
Paul Murrell
\end{Author}
\begin{SeeAlso}\relax
\code{\Link{grid.draw}}
\end{SeeAlso}

