proc redline : redbutton_clicked { if(redbutton_clicked == true) { currentColour = "red"; } } proc greenline : greenbutton_clicked { if(greenbutton_clicked == true) { currentColour = "green"; } } proc blueline : bluebutton_clicked { if(bluebutton_clicked == true) { currentColour = "blue"; } } proc colourMode: currentColour { if(currentColour =="red") { greenX=greenX; greenY=greenY; redX is mouseClickX; redY is mouseClickY; } else if(currentColour == "green") { redX=redX; redY=redY; greenX is mouseClickX; greenY is mouseClickY; } else if(currentColour == "blue") { redX=redX; redY=redY; greenX is mouseClickX; greenY is mouseClickY; } } ##this is correcting the axis so origin is 0,0 proc correctAxisRedX: redX { if(redX < x) { displayRedX is redX-x; } } proc correctAxisRedY: redY { if(redY > y) { displayRedY is y-redY; } } proc correctAxisGreenX : greenX { if(greenX < x) { displayGreenX is greenX-x; } } proc correctAxisGreenY : greenY { if(greenX > x) { displayGreenY is y-greenY; } }