|
GEOS SDK TechDocs
|
|
4.2 The Visible Object Document
|
4.4 The Vis Class Tree
Visible objects can be used in innumerable situations; with a little work from the application developer, they provide dozens of useful features including
-
Knowledge of Their Bounds
Every visible object knows exactly where in the application's document it sits and exactly how big it is. It can easily change its own bounds, either moving itself in the document space or resizing itself.
-
Ability to Draw Themselves
Every visible object is responsible for drawing itself. When it receives a drawing message (
MSG_VIS_DRAW
), it must recognize the context of the message and draw itself appropriately.
VisClass
does not have a default handler for
MSG_VIS_DRAW
; each subclass must handle this message itself.
-
Input Handling
Pointer and click events as well as keyboard input can be automatically transmitted through the view to the VisContent if desired. Several combinations of event pass-throughs are available. When the VisContent receives a mouse event, it can intercept and handle it or pass it on to whatever object is under the pointer. If the VisContent does not handle the event (such as
MSG_META_PTR
) explicitly, the message will automatically be passed on to the object under the pointer.
-
Geometry Management
Both the view and the VisContent can interact to provide specific sizing behavior for the window and content. Additional geometry management is available to help a VisComp composite object manage its children.
-
Object Tree Management
Messages may easily be passed to an object's parent or children. Also, objects may be added to or removed from the visible tree without difficulty.
-
Use of VisMonikers
In addition to simply drawing itself, a visible object can have a visible moniker that it can draw as well. This simplifies drawing text or handling
MSG_VIS_DRAW
in that the moniker can be set beforehand and simply drawn with a single call.
Using visible objects allows an application a lot more flexibility in display and input handling than is available with the generic objects. It also requires more programming; however much of the most difficult work is made easy by the view and VisContent objects. The application does not have to worry about clipping or scrolling or even determining what type of input event is taking place. All this is somewhat automatic and can, for the most part, be ignored.
|
GEOS SDK TechDocs
|
|
4.2 The Visible Object Document
|
4.4 The Vis Class Tree