|
GEOS SDK TechDocs
|
|
1.1 GenView Model
|
1.3 The GenViewControl Object
The GenView is a powerful and flexible object that does most of your display work for you. It is designed to provide not only the functionality required by nearly all applications but also many additional features that more advanced applications will use. The following goals helped shape the GenView:
-
Common functionality
The view, like all of GEOS, is designed with common application functionality in mind. Those functions common to many applications are integrated as much as possible to relieve programmers of having to code and debug the same features again and again.
-
Consistency of use
The view, like every generic UI object, allows all GEOS applications to behave and look consistent. Users find this important when using several different applications.
-
Ease of use
The view, in its simplest form, is almost trivial to implement. Applications can gain a scrolling window by adding very little code (as evidenced in the Hello World program).
-
Expandability
Using the view's more advanced features requires little more than incremental changes to an application; you can easily and quickly add scaling to or change the background color of your view.
To meet these goals, the view provides several advanced features and makes them easy to use for all applications. All the following features are available to applications with limited effort, and most are expandable to be very powerful.
-
Drawing to the view
Drawing to the view is simple, as simple as calling the proper graphics routines to draw to a GState. The view will send a
MSG_META_EXPOSED
to its content object whenever the document must be drawn (for example, when the view scrolls or when a window has uncovered a portion of the view); the content then simply must draw it. The view will handle all necessary clipping, placement, scaling, and translation for the video driver. See Documents in a View
.
-
Scrolling
You can set up your view to be scrollable and all scrolling to be automatic. You can also cause the view to scroll or even change how the view scrolls. See Scrolling
.
-
Scaling
Every view has a scale factor that determines the scale at which the document is drawn. You may leave this at the default (the normal size), or you may dynamically change it. The view simply asks the content object to redraw its document, and the view will handle all the scaling geometry. See Document Scaling
.
-
Sizing
Because most Views are resizable, you can easily alter the sizing behavior of your view. You may also set it to have a certain minimum, maximum, or fixed size. See Document and View Size
.
-
Setting the Background Color
Depending on the view's purpose, you may wish it to be either the same color as its GenPrimary parent or a different color. The View in Hello World, for example, is white; it could easily be any other color. See Setting the Background Color
.
-
Handling Input
Unless your view is display-only, your content will be able to handle either pointer or keyboard events passed through it. You can specify the level of input you want and easily get mouse or typed character events. In addition, the Ink standard for pen input is also supported.
-
Setting the Content Size and Origin
Every content object has a size associated with it. The size defines where the content sits in the coordinate space and what part of the coordinate space the view has access to for scrolling. Every view also has an origin describing which part of the content is currently visible. See Documents in a View
.
-
Changing the Content
Although most Process objects will hang on to their Views, it is possible to change the view's content object. This is most likely used by applications that use the VisContent rather than the Process object as their content. See Setting the Content
.
-
Defining Children of the view
Every view may have UI objects designated as its children. These objects may appear at any edge of the view. By defining special scroller objects as children of the view, you can alter their placement; for example, you could have the vertical scroller always appear on the left rather than whatever is the default (typically the right). See Children of the View
.
|
GEOS SDK TechDocs
|
|
1.1 GenView Model
|
1.3 The GenViewControl Object