Programming Guide:xppguide

The complete presentation space - XbpPresSpace() Foundation

Instances of the XbpPresSpace class are complete presentation spaces (PS). They can be used by all functions of the GRA Engine. This includes complex graphic output that consists of graphic segments. If a complex graphic is to be displayed in Xbase Parts subclassed from XbpWindow, an XbpPresSpace object must be connected to the window device of this Xbase Part. If a drawing is displayed in an XbpDialog window, for example, the output device is XbpDialog:drawingArea and the PS must be connected to its window device:

oDialog := XbpDialog():new()               // Create an XbpDialog 
oDialog:create( ,, {0,0}, {600,400} )      // window 

oPS     := XbpPresSpace():new()            // Create a PS 
oDevice := oDialog:drawingArea:winDevice() // Get the device context 

oPS:create( oDevice )                      // Link device context 
                                           // to PS 
GraLine( oPS, {0,0}, {600,400} )           // Display drawing 

The example demonstrates different steps necessary for using a complete PS. The device context (the output device) is returned by the :winDevice() method, and linked to the PS by passing it to the :create() method. Then a drawing can be created in the PS using Gra..() functions and the output appears in the XbpDialog window. Since the PS does not buffer screen output, the code that creates a drawing must repeatedly be executed after xbeP_Paint events.


If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.