<HTML>
<HEAD>
  <META NAME="GENERATOR" CONTENT="Adobe PageMill 2.0 Mac">
  <TITLE></TITLE>
</HEAD>
<BODY BGCOLOR="#ffffff">

<P ALIGN="CENTER"><IMG SRC="../Images/views.gif" WIDTH="450" HEIGHT="90" ALIGN="BOTTOM" NATURALSIZEFLAG="3"></P>

<P><A NAME="Overview"></A><B>Overview of View Management</B></P>

<P>Views are a rectangular subset of a window.</P>

<P>Views simplify the management of the user interface elements in a window
by allowing windows to be broken up into more manageable components. Thus
a window with a line of icons along the top, an editable field, and a couple
of scrollbars may have several dozen views--one for each scrollbar, one
for the edit area, and one for each icon button along the top.</P>

<P>### More about views</P>

<P><B>Creating Views</B></P>

<P>YAAF uses the &quot;Visual Basic&quot; model for managing views. Views
are considered to be self-contained objects which manage a small subset
of the window. Views also expose a custom interface to the rest of the application;
some views can b completely self-contained, and some may require access
to external databases or files.</P>

<P>There are two ways a veiw can be created; either manually or by reading
information about the view's placement from a view resource. View resources
are currently created by <B>CompileVRes</B>; this creates a 'VRes' view
which defines the location of a view.</P>

<P>Views which are created from a view resource must register themselves
with a <B>view factory</B>; this is a mechanism for creating a view from
it's definition in a 'VRes' resource.</P>

<P><A NAME="Rectangles"></A><B>Rectangular Regions</B></P>

<P>At it's heart, a view is simply a rectangular subset of a window or a
parent's view.</P>

<P>### More on rectangles</P>

<P><A NAME="Drawing"></A><B>Drawing</B></P>

<P>Drawing in a view is done through the XGDraw object. This is a stack-based
object which sets the clipping region to the view's location in the window,
sets the coordinate system so that (0,0) is at the upper left of the view.</P>

<P>### More on drawing</P>

<P><A NAME="Colors"></A><B>Colors</B></P>

<P>Drawing is performed in RGB space. To maximize portability, the object
Color is defined which stores the RGB values of the current foreground or
background color. Defined in &lt;XDrawData.h&gt;, this can also store a
palette ID for a predefined palette that is used for drawing.</P>

<P>### More on colors.</P>

<P><A NAME="Fonts"></A><B>Fonts</B></P>

<P>### More on fonts.</P>

<P><A NAME="Classes"></A><B>Classes</B></P>

<BLOCKQUOTE>
  <P><A HREF="../Classes/XGOwner.html">XGOwner</A></P>
  <BLOCKQUOTE>
    <P>This is the object which &quot;owns&quot; collections of views. Both
    XGViews and XGWindows are descendant of XGOwner, which means that both
    can contain at least one view.</P>
  </BLOCKQUOTE>
  <P><A HREF="../Classes/XGView.html">XGView</A></P>
  <BLOCKQUOTE>
    <P>The root of the view management system. To create your own view object
    (such as a control, an edit region, or something else), you would create
    a class which inherits it's functionality from the XGView class.</P>
  </BLOCKQUOTE>
  <P><A HREF="../Classes/XGPrinter.html">XGPrinter</A></P>
  <BLOCKQUOTE>
    <P>This is the printer object; this defines a single global object which
    provides basic printing. (Not available on X.)</P>
  </BLOCKQUOTE>
  <P><A HREF="../Classes/XGDraw.html">XGDraw</A></P>
  <BLOCKQUOTE>
    <P>The core drawing class; this provides for drawing inside of a view.</P>
  </BLOCKQUOTE>
  <P><A HREF="../Classes/XGFont.html">XGFont</A></P>
  <BLOCKQUOTE>
    <P>Basic font handling routine; this manages fonts and font handles in
    a portable manner.</P>
  </BLOCKQUOTE>
  <P><A HREF="../Classes/XGViewFactory.html">XGViewFactory</A></P>
  <BLOCKQUOTE>
    <P>This is the basic view factory object, used internally by YAAF for building
    views from a 'VRes' resource.</P>
  </BLOCKQUOTE>
  <P><A HREF="../Classes/XGArgStream.html">XGArgStream</A></P>
  <BLOCKQUOTE>
    <P>Created by a view factory to permit a custom view to store static initialization
    variables in a 'VRes' resource and pull it from the resource.</P>
  </BLOCKQUOTE>
  <P><A HREF="../Classes/XGViewTemplate.html">XGViewTemplate</A></P>
  <BLOCKQUOTE>
    <P>The view template object; this inserts the specified view into a linked
    list that is accessed by the XGViewFactory.</P>
  </BLOCKQUOTE>
</BLOCKQUOTE>

<P><A NAME="Macros"></A><B>Macros</B></P>

<BLOCKQUOTE>
  <P><A HREF="../Classes/function.html#RegisterView">RegisterView</A></P>
  <BLOCKQUOTE>
    <P>If the view is constructed in the proper fashion, this macro expands
    to an XGViewTemplate declaration.</P>
  </BLOCKQUOTE>
  <P><A HREF="../Classes/function.html#RegisterViewID">RegisterViewID</A></P>
  <BLOCKQUOTE>
    <P>This constructs the XGViewTemplate from the name of the view class and
    a different view identifier.</BLOCKQUOTE>
</BLOCKQUOTE>
</BODY>
</HTML>
