The protocol let you draw anything you want in a form. You record a sequence to draw and it will be drawn when a window update is requested.
A drawing context specify how a drawing primitive will be rendered. You define a drawing context first and reuse it with drawing primitive. Drawing context are global to the application, so may be reused with any form.
This defines a new drawing context. The drawing context may be used with drawing primitive as an extra parameter ($dc=ID) or with some widget such as labels. It is never used without some extra parameters:
This defines a font ID which may be used to define one or more drawing context. The parameters are:
This defines a pen ID usable to define one or more drawing context. The parameters are:
This defines a brush ID usable to define one or more drawing context. The parameters are:
You find here the various drawing primitives normally found in a GUI toolkit. In general, you combine the primitive with a predefined drawing context using the $dc=name named parameter. The drawing context is identified with the parameter "dc".
Drawing primitives are recorded in a Form context, either at the form creation, or by using the Setcontext primitive. They are not drawn as they are defined. They are only recorded. They will be drawn either when the form is exposed, or when a Refresh primitive is sent.
Move some area of a form. The move is done immediatly.
Clear the form using the specified (generally) drawing context. This also forgets the previously recorded primitives.
This draw a filled arc (depending on the drawing context choosen). x1,y1 and x2,y2 represents two points on the edge of the circle. xc,yc represents the center of the circle.
Refresh only an area of a form. It sets a clipping using the speficied coordinate and perform the drawing. It may be used instead of refresh. It will generally be used combined with blit below. When scrolling complex drawing, we use blit to move a large portion of the drawing we record the new drawing primitive and then we only perform the drawing on the "missing" area.
Draws a line between two points.
Draw a rectangle. Not filled. The two points represent two opposite corners of the rectangle.
Draw some text at the x,y coordinate. The extra parameter dc is generally supplied (drawing context).
Not used for now. To be reviewed.
Draw a filled polygon. The last point is automatically connected to the first.
Draw a filled rectangle. startx,starty represents the left top corner.
Draw the recorded primitives immediatly. This primitive is only useful on a dialog already visible.