[Home] [Prev] [Next] [Up]


YAAF_core: View Management

A 'view' is a subset of a window which has it's own drawing, mouse click and other semantics. A 'view' allows a complex window display to be broken down into managable subsets.

Each view is a rectangle which is a subset of it's parent view. Each view can contain children views which further partition the view.

The YAAF library manages views in a way a little different from other applications. On the Macintosh version, a view is nothing more than the rectangle that bounds the view; the view code does little more than provide for the management of the rectangle geometry, and hit detection.

Actually creating a 'drawing context' is the responsibility of the XGDraw object. A stack object, an XGDraw object actually sets the clipping of the view and sets the view as the current target for drawing stuff.

Views can be created through using a view factory mechanism; a view factory is an object which knows how to create a view from a resource specification.

View Factory

XGViewFactory

The view factory object; this abstract class is the root of all objects which provide translation from a resource specification to a constructed view.

XGArgStream

Used by the view factory mechanism; arguments which are used to specify the parameters of the view being constructed are passed through using this class.

View Management

XGView

The view itself. All custom controls, custom views and other objects which display to the window must inherit from this class.

XGDraw

Drawing is performed by creating one of these on the stack. This provides a stack-safe and thread-safe access to drawing in a view.


[Home] [Prev] [Next] [Up]