home *** CD-ROM | disk | FTP | other *** search
- /*
- ELLIPSE TOOL
-
- Modifiers:
- ALT will constrain the ellipse to a circle
- Double Clicking will bring up a requester which allows you to set
- the dimensions of the ellipse
- */
-
- msg = PDSetup.rexx(2)
- units = getclip(pds_units)
- if msg ~= 1 then exit_msg(msg)
-
- cr = '0a'x
- width = getclip(pduserelliwidth)
- height = getclip(pduserelliheight)
-
- if units > 2 then
- do
- width = pdm_ConvertUnits(1, units, width)
- height = pdm_ConvertUnits(1, units, height)
- end
-
- size = pdm_GetForm("Enter size of ellipse", 8, "Width:"width || cr"Height:"height)
- if size = '' then exit_msg()
-
- parse var size width '0a'x height
-
- if ~(datatype(width, n) & datatype(height,n)) | width <= 0 | height <= 0 then
- exit_msg("Invalid Entry")
-
- if units > 2 then
- do
- width = pdm_ConvertUnits(units, 1, width)
- height = pdm_ConvertUnits(units, 1, height)
- end
-
- call setclip(pduserelliwidth, width)
- call setclip(pduserelliheight, height)
-
- xrad = width / 2
- yrad = height / 2
-
- rect = pdm_ClickEllipse("Click", xrad, yrad)
- if rect = '' then exit_msg()
-
- left = word(rect, 1)
- top = word(rect, 2)
-
- call pdm_DrawEllipse(left, top, xrad, yrad)
-
- exit_msg()
-
- exit_msg: procedure expose units
- do
- parse arg message
-
- if message ~= '' then call pdm_Inform(1,message,)
- call pdm_SetUnits(units)
- call pdm_AutoUpdate(1)
- exit
- end
-