Below is a example that I created to learn the Draw method syntax:
handler mainForm.onopen() {
// Draw Example
Draw draw; // Create an object to process the Draw methods
// Declare some variables to use for color index values
int whiteIndex, redIndex, greenIndex, blueIndex, blackIndex;
whiteIndex = draw.indexFromColor( 0, 0, 0);
redIndex = draw.indexFromColor(255, 0, 0);
greenIndex = draw.indexFromColor( 0, 255, 0);
blueIndex = draw.indexFromColor( 0, 0, 255);
blackIndex = draw.indexFromColor(255, 255, 255);
draw.attachForm(mainForm); // Attach the Draw object to a form
draw.begin();
draw.fg(redIndex); // Set the Foreground Color to RED
draw.bg(blueIndex); // Set the Background Color to BLUE
draw.textColor(greenIndex); // Set the Text Color to GREEN
draw.font(fntBold); // Set the Text Font to BOLD
draw.textAlign(22); // Set the Text Alignment to Bottom Right
draw.underline(ulDot); // Set the Text Underlining to Dotted
draw.line(clrFG,0,50,90,50); // Draw a RED Horizontal Line 90 pixels long
draw.line(clrFG,90,50,90,80); // Draw a RED Vertical Line 30 pixels long
draw.pixel(clrFG,45,45); // Draw a RED dot (i.e. a single point)
draw.rect(clrFG,0,15,30,45,0); // Draw a RED Square of 30 pixels
draw.fg(blueIndex); // Change the Foreground Color to BLUE
draw.rect(clrFG,45,15,75,45,15); // Draw a BLUE Circle of 30 pixels
draw.rect(clrFG,10,55,80,65,0); // Draw a BLUE Rectangle 70 pixels long
draw.rect(clrFG,10,70,80,90,10); // Draw a BLUE Rounded Rect. 70 pixels long
draw.frame(clrFG,10,95,50,135,0,1);// Draw a Frame
draw.end();
}