this is a rough draft of the J801 gl2 reference. Please feel free to update...
Lab "Graphics - gl2 commands" gives an overview of the isigraph control and gl2 commands. See the other graphics labs for information on other aspects of gl2.
gl2 commands are defined in the jgl2 locale by gl2.ijs.
When an isigraph control requires painting the paint event is called. If the isigraph control is called g and it is in form abc, then verb abc_g_paint is called in the form's locale.
In the paint event the drawing commands are done to a memory context and when the paint event ends this memory context is copied to the isigraph screen surface.
Drawing command coordinates are in pixels where 0 0 is the upper left corner and positive x and y values are to the right and down.
isigraph events allow user interaction with the isigraph control with the keyboard and mouse.
glarc x y w h xa ya xz yz ; draw arc on the ellipse defined by rectangle. Arc starts at xa,ya and ends at xz,yz. Start and end points need not lie on the ellipse, they define a line from the center that intersects the ellipse.
glbrush '' ; select solid brush in current color
glbrushnull '' ; select null brush (leaves area painted with it unchanged)
glcapture type ; (not implemented) mouse capture. A capture is normally done in a mouse down event and a glcapture 0 is done in the mouse up. There are mmove events during a capture.
0 release 1 capture (no drawing) 2 line 3 box 4 ellipse 5 vertical line 6 horizontal line 7 8 9 followed by one or more rectangles. Type 7 boxes are moved. Type 8 boxes are resized. Type 9 defines new boxes and is normally done in the move event of a 7 or 8 capture. 10 cross hairs with optional clipping rectangle
glcaret x y w h ; (not implemented) create a text caret at x,y with a width and height of w h.
glclear ; Clear memory buffer to white and initialize context: default system font; glrgb 0 0 0; glpen 1 0; glnullbrush''; gltextxy 0 0; gltextcolor''; glclipreset''; glwindoworg 0 0 .
glclip x y w h ; intersect this rectangle with the original clip rectangle to restrict drawing
glclipreset ; restore original clip rectangle
glcmds ... ; takes a series of gl2 commands. Each command starts with an integer count followed by the command and data. Commands that return results can not be used in glcmds. Character data is passed as integer values.
glcmds 4 2056 100 100 6 2038 , a.i.'test' NB. gltextxy , gltext
glcursor n ; (not implemented) sets mouse cursor. Values are defined as IDC_... in gl2.ijs.
glellipse x y w h ; draw an ellipse in the rectangle with pen and brush
glfont fontspec ; font for text commands
gllines pts ; draw connected lines. pts is 0 or more points.
glnodblbuf b ; (not implemented) turns off double buffering (drawing to memory context). Drawing commands draw directly to the screen surface.
glpaint ; copy memory buffer to screen
glpen i [style] ; select pen. pen color is from last glrgb and is (1 >. i) units wide. If you need a null pen for the border of a filled area, make sure the pen color is the same as the interior color. style is from the gl2.ijs PS_...
glpie x y w h xa ya xz yz ; draw pie shaped wedge with pen and brush. Same parameters as garc.
glpixel i j ; draw pixel at i,j in current color
glpixels x y w h pixeldata ; pixeldata is an integer per pixel with ARGB values. If h is positive pixeldata is drawn top to bottom and otheriwse it is drawn from bottom to top.
glpixelsx x y w h address ; same as glpixels except the argument has the memory address of pixeldata.
glpolygon pts ; draw polygon in pen and brush
glqextent text ; return width and height text
glqextentw texts ; return widths for LF delimited texts
glqhandles '' ; returns hwnd, 0, 0. Used in OpenGL support and probably should be restricted to that use.
glqpixels x y w h; return pixeldata as integer per pixel with ARGB values
glqwh '' ; return width and height of the control in pixels
glrect x y w h ; draw rectangle with pen and brush
glrgb r g b ; set current color (alpha is 255)
glrgba r g b a ; set current color with alpha
glroundr x y w h rw rh ; (not implemented) draw rectangle with rounded corners defined by ellipse with width rw and height rh
glsel id ; select isigraph child of currently selected parent for graphic commands
glsel hwndc ; hwndc is the result of wd'qhwndc' for an isigraph control. Parent and child are selected as the wd and gl command targets.
gltext text ; write text in glfont and gltextcolor at gltextxy
gltextcolor '' ; glrgb color is set as color of text for gtext
gltextxy x y ; position for gltext
glwindoworg x y ; changes origin: that is, x and y are automatically added to subsequent command coordinates