This document covers errors and omissions in the Pro Draw ARexx documentation. Compiled by Don Cox.
UNDOCUMENTED PRO DRAW AREXX COMMANDS
call FlowText(text, left,top,right, bottom)
Flows text into the defined rectangular area.
answer = GetObjText(obj)
Returns the current character, if the current object is a text object. Each character of a text string is a single (compound) object. Carriage return can also be returned as an object.
answer = GetTextSize(obj)
Returns width of character and point size.
answer = GetTextNext(obj)
Returns distance to next character.
answer = GetTextPosn(obj)
Returns x and y coords of bottom left corner of character.
Note: useful related commands (documented)
firstcharacter = pdm_GroupFirstObj(obj)
nextcharacter = pdm_GroupNextObj(obj)
lastcharacter = pdm_GroupLastObj(obj)
The characters in a string of text are sequentially numbered objects, and are grouped (unless you have ungrouped them). Pro Draw uses CR ("0d"x) as a line ending, not LF ("0a"x).
GetBitmapInfo() and SetBitmapInfo()
GetEPSFinfo() and SetEPSFinfo()
Used as follows:
obj = pdm_ClickOnObj()
obsize = pdm_GetObjSize(obj)
if pdm_IsBitmap(obj) = 1 then bitmapinfo = pdm_GetBitmapInfo(obj)
call pdm_SetBitmapInfo(obj,0,0,1,1,0) /* xoffset,yoffset,xscale,yscale,degrees (change of). Scale is based on 75 pixels per inch. This command does NOT alter the bitmap on screen. */
IsTransparent() and IsHidden()
These would test if an object is transparent or hidden, but don't appear to work.
PlotSmoothRad()
PlotArc()
These draw curves in a similar way to PlotBezier and PlotTurtle. I have not yet worked out the format for the parameters.
CurrentPoint()
A mystery.
Dot Matrix printing commands.
All the commands provided for Pro Page also exist in Pro Draw. I have not tested them.
NOTES ON VARIOUS COMMANDS
PageFirstObj()
PageLastObj()
Current page only - do not accept page numbers.
GetUserText
"prompts" is in the format "prompt:example". Limited to 20 characters?
ClickArea
Returns X and Y coordinates of top left and bottom right corners, not as stated.
GetClickPosn
Name of command wrong in manual.
CreatePage
Arguments in wrong order: the first argument is the number of the page in front of which new pages are inserted, the second is the number of pages. Thus CreatePage(4,3,) inserts 3 pages in front of page 4, which is renumbered as page 7. To add n new pages after the current page, use this function:
addpages: procedure
parse arg n, cpage
newpage = pdm_CreatePage(cpage,n,)
newpage = pdm_MovePage(newpage+n,newpage)
cpage = pdm_GoToPage(newpage+n)
return cpage
It is possible to crash Pro Draw by trying to go to page zero.
DeletePage
You must delete all the objects on the page first.
GetPageName
SetPageName
These do not work. Page names are not implemented in Pro Draw.
"Size" includes the control handles; "Visible Size" includes only the curves themselves.
SetLineWeight
Use 0.00 for "none".
SetLineJoin
Usage is SetLineJoin([obj],jointype). Jointypes are 0=mitre, 1=round, 2=bevel, 3=butt, not as stated.
SetFillPattern
GetFillPattern
Parameters are in wrong order in manual: angle should come before centerX.
GetGridOrder(obj)
Object must be a grid - but
IsGrid()
doesn't work. This is probably the worst bug in Pro Draw, as it effectively prevents any ARexx scripts from operating on grids.
IsCircle
IsEllipse
Don't distinguish between circles and ellipses. You can get round this with GetObjSize.
SetRulerType
4 is cm, 3 is picas, not as stated.
PlotBezier
PlotLine
PlotSmooth
You must call InitPlot before using these commands. The format for the number string is not as stated in the manual. Each point is defined with six numbers, which are separated by spaces. The first two numbers are the X and Y coordinates of the point; the other four are the coordinates of the control handles, and for these the position of the point is taken as zero. The point definitions are separated by commas.
If the point is a corner point, it is not necessary to include four zeros for the relative positions of the control handles.
You call ClosePlot or EndPlot after using these commands.
DrawEllipse
Width, height are radii, not diameters.
InitText
All the parameters are optional: "call pdm_InitText()" will produce the standard font requester. The third parameter (setsize) is the aspect ratio of the characters. Bolding works only on some fonts.
Text
Should be "call pdm_Text(text, coordX, coordY)", not as stated. Returns X and Y coords of next character. Use InitText before using this or FlowText.
SetPSPageSize
Applies to the whole document, not just the current page.
PrintDocPS
The sync parameter is not working: the command always returns immediately. This is a serious bug. A possible workaround is to send the drawing to Pro Page and print from there.
HOW TO DRAW A CURVE
Example:
box = pdm_ClickArea("Drag out box to show height of curve")
parse var box cornerX cornerY cornerX2 cornerY2
cornerY2 = strip(cornerY2) /* remove a space */
boxwidth = abs(cornerX2-cornerX)
boxheight = abs(cornerY2-cornerY)
curveleft = cornerX
curvetop = cornerY
/* Example data, might be calculated by the program */
curvesizeX = 5.4571 /* Width of curve - this is the width that is to be scaled to fit the box, not necessarily the actual width. e.g. to fit a letter I into a box area you might want to leave some space on each side. */