home *** CD-ROM | disk | FTP | other *** search
- {*****************************************************************
- ** Windowlib **
- ** **
- ** © 1994-97 THOR-Software inc. **
- ** Version 1.10 / 27 May 1994 **
- ** **
- ** Useful graphics support for PCQ **
- *****************************************************************}
-
- {useful message classes. You can receive them by asking windowlib
- with RequestStart}
- CONST
- { --- IDCMP Classes ------------------------------------------------------ }
- NEWSIZE_f = $00000002; { window got a new size }
- REFRESHWINDOW_f = $00000004; { window must be redrawn }
- MOUSEBUTTONS_f = $00000008; { a mouse button has been pressed }
- MOUSEMOVE_f = $00000010; { the mouse pointer moved }
- GADGETDOWN_f = $00000020; { a gadget/field/slider has been pressed }
- GADGETUP_f = $00000040; { a gadget/field/slider has been released }
- MENUPICK_f = $00000100; { a menu item has been picked }
- CLOSEWINDOW_f = $00000200; { the user wants to close the window }
- RAWKEY_f = $00000400; { the user pressed a key on the keyboard }
- DISKINSERTED_f = $00008000; { a disk has been inserted in one drive }
- DISKREMOVED_f = $00010000; { a disk has been removed from one drive }
- ACTIVEWINDOW_f = $00040000; { the window got activated }
- INACTIVEWINDOW_f = $00080000; { the window got deactivated }
- INTUITICKS_f = $00400000; { a certain time has passed. A tick is a 6th of a second }
-
- {the next constants are for the MenuCommand structure and used to setup a
- menu. Each entry has a type as defined below}
- { --- Menu Command constants --------------------------------------------- }
- MC_MENU = 1; { entry is a menu }
- MC_ITEM = 2; { entry is a item of a menu }
- MC_SUBITEM = 3; { entry is a subitem of a item }
- MC_LASTMENU = $81; { dummy entry to mark end of menu }
- MC_LASTITEM = $82; { end of item list of a menu }
- MC_LASTSUBITEM = $83; { end of subitem list of a item }
- { please note that you MUST insert a MC_LAST... at the end of a item/subitem
- and menu }
-
-
- {some flags to be used in the MenuCommand structure}
- { --- Menu Command flags ------------------------------------------------- }
- MC_MENUENABLED = 1; {menu is active (menus only) }
- MC_NORMALMENU = 1; {same}
- {item and subitem only flags }
- MC_ITEMENABLED = $10; {item is active}
- MC_HIGHCOMP = $40; {item is beeing inverted }
- MC_CHECKIT = $01; {item is checkable}
- MC_TOGGLE = $08; {item is toggleable}
- {combined flags}
- MC_BAR = $C0; {item is a separator bar }
- MC_READONLY = $D0; {item is not selectable }
- MC_NORMAL = $50; {normal item type}
- MC_OFF = $40; {selectable, but disabled}
- MC_CHECKABLE = $59; {a checkmark item}
- MC_OFFCHECK = $49; {a disabled checkmark}
-
- { Each menu command entry consists of four entries:
- i) the menu command constant defining the type of the entry
- as defined above.
- ii) the menu command flags
- iii) a shortcut character, if any (items & subitems only)
- iv) a dummy which is not yet used
- v) the name of the entry as NUL-terminated string OR
- an empty string if flags are MC_BAR
-
- A sample menu command list:
- menubar : ARRAY[1..15] OF MenuCommand=(
- (MC_MENU,MC_NORMALMENU,0,0,"Menu 1"),
- (MC_ITEM,MC_NORMALITEM,'O',0,"Open..."),
- (MC_ITEM,MC_BAR,'\0',0,""),
- (MC_ITEM,MC_OFF,'S',0,"Save..."),
- (MC_LASTITEM,0,'\0',0,""),
- (MC_MENU,MC_NORMALMENU,'\0',0,"Flags"),
- (MC_ITEM,MC_NORMALITEM,'\0',0,"Style"),
- (MC_SUBITEM,MC_CHECKABLE,'P',0,"Plain"),
- (MC_SUBITEM,MC_CHECKABLE,'I',0,"Italic"),
- (MC_SUBITEM,MC_CHECKABLE,'B',0,"Bold"),
- (MC_SUBITEM,MC_CHECKABLE,'U',0,"Underline"),
- (MC_LASTSUBITEM,0,'\0',0,""),
- (MC_ITEM,MC_OFFCHECK,'\0',0,"Save ASCII"),
- (MC_LASTITEM,0,'\0',0,""),
- (MC_LASTMENU,0,'\0',0,""));
- }
-
- {here some monitor types. I only give a list of popular ones, but all
- monitor ID added to the system are valid here. Read the docs of your
- gfx card here to find out about them.}
- { --- Monitor Types ------------------------------------------------------ }
- {OR all types together to get monitor. PAL,NTSC etc. work only
- in 2.0 or higher...}
-
- {Monitor types...}
- MON_NTSC = $11000;
- MON_PAL = $21000;
- MON_VGA = $31004; {OR with HIRES, or you get SUPERLORES}
- MON_A2024 = $41000;
- MON_A2024_15 = $49000;
- MON_SUPER72 = $81000;
- MON_EURO36 = $71000;
- MON_EURO72 = $61004; {OR with HIRES, or you get SUPERLOWRES}
- MON_DBLNTSC = $91000;
- MON_DBLPAL = $A1000;
-
-
- MON_LORES = $0000;
- MON_HIRES = $8000;
- MON_SUPER = $8020;
- MON_HAM = $0800;
- MON_LACE = $0004;
- MON_VGALACE = $0001; {USE for VGA,EURO72}
- MON_EHB = $0080;
-
-
- { we define now some types to be used with the windowlib. Some of them
- are just of type Address, i.e. do not care what they mean. The window
- lib cares about them. Just keep them, but to not touch them, O.K. ? }
-
- TYPE
- ScreenPtr = Address; { object describing a screen }
- WindowPtr = Address; { object describing a window }
- GadgetPtr = Address; { object describing a gadget/field/slider }
- IntuiMessagePtr = Address; { object describing a message.
- This is NOT for beginners. All Request functions
- read INTEGERS, not this one! Just leave it
- alone, O.K. ?}
-
- { this structure defines a complete menu, see above for a sample
- menu }
-
- MenuCommand = RECORD
- MenuType : BYTE; { type of entry: item/subitem/menu/lastitem/lastsubitem/lastmenu }
- MenuFlags : BYTE; { special flags for appearance }
- ShortCut : CHAR; { shortcut character for items and subitems }
- reserved : BYTE; { do not touch it }
- MenuText : String; { the string }
- END;
- MenuCommandArray = ARRAY[0..0] OF MenuCommand; {define for own purposes}
-
- { some interal use only variables. Do not touch! }
- VAR
- ConsoleBase,
- DiskFontBase,
- LayersBase,
- GfxBase : Address;
-
-
-
- { Now we come to the procedures and functions supplied by the windowlib.
- They are all external and will be linked to the final program with the
- binary library. }
-
- { --- windowlib functions -------------------------------------------------}
-
- PROCEDURE SortCoords(VAR x1,y1,x2,y2 : SHORT);
- EXTERNAL;
- { sort two pairs of coordinates to be left,top,right,bottom }
-
-
- PROCEDURE ExitGraphics;
- EXTERNAL;
- { close graphic subsystem: You MUST call this before exit! }
-
-
- PROCEDURE InitGraphics;
- EXTERNAL;
- { initialize graphic subsytem: You MUST call this before starting}
-
-
- FUNCTION InstallStdClip(w : WindowPtr) : BOOLEAN;
- EXTERNAL;
- { installes standard cliprect in non-GZZ-windows. You can use this call
- to restore the cliprect back to default values after Clip,SetOffset.
- This call CAN fail, and will return FALSE in this case.
- It turns off the custom clipping done by Clip/SetOffset }
-
-
- PROCEDURE DeleteButton(g : GadgetPtr);
- EXTERNAL;
- { given a gadget, this procedure removes the gadget from the window
- and deletes it }
-
-
- PROCEDURE OffButton(g : GadgetPtr);
- EXTERNAL;
- { disable a gadget }
-
-
- PROCEDURE OnButton(g : GadgetPtr);
- EXTERNAL;
- { enable a gadget }
-
-
- PROCEDURE RefreshButton(g : GadgetPtr);
- EXTERNAL;
- { redraw a gadget if its gfx has been overdrawn }
-
-
- FUNCTION CreateTextButton(w : WindowPtr;x,y,xsize,ysize : SHORT;text : String) : GadgetPtr;
- EXTERNAL;
- { create a button with a text in it at given coordinates and given size.
- The size may be zero, in this case it's taken from the string, i.e. the
- button will be just big enough to hold it.
- This thingly is called a "bool gadget" in intuition terms, we call it
- "TextButton". You hear a GADGETUP_f request if the user presses this one
- (and you selected to hear these events in first place) }
-
-
- FUNCTION CreateTextToggle(w : WindowPtr;x,y,xsize,ysize : SHORT;text : String) : GadgetPtr;
- EXTERNAL;
- { create a toggle button with a text in it at given coordinates
- and given size. This is almost like a TextButton, but will remain in
- pressed / released position. It can be toggled on or off.}
-
- PROCEDURE SetToggle(g : GadgetPtr;state : BOOLEAN);
- EXTERNAL;
- { set state of a toggle gadget (on for TRUE or off for FALSE)};
-
- FUNCTION GetToggle(g : GadgetPtr) : BOOLEAN;
- EXTERNAL;
- { get state of a toggle gadget: TRUE is pressed position};
-
- FUNCTION IDFromGadget(g : GadgetPtr) : SHORT;
- EXTERNAL;
- { calculates the ID of a given gadget. They are numbered from 1 increasing
- in the order of generation }
-
-
- FUNCTION GadgetFromID(w : WindowPtr;id : SHORT) : GadgetPtr;
- EXTERNAL;
- { calculates the gadgethandle from the ID, returns NIL if not found }
-
-
- { The next calls handle the windowlib event machine. With RequestStart,
- you inform the lib to notify you about certain events, defined on top
- of this file (the IDCMPs). }
-
- PROCEDURE RequestStart(w : WindowPtr;what : INTEGER);
- EXTERNAL;
- { starts a request of given type (see constants above) at given window.
- The windowlib starts sending these events. You may request more than
- one at once by adding or or-ing the IDCMP values defined on top. }
-
-
- PROCEDURE RequestEnd(w : WindowPtr;what : INTEGER);
- EXTERNAL;
- { ends a request, i.e. windowlib does no longer send events of the given
- type. Like the procedure defined above, more than one event is accepted
- at one time. Just OR or add the values together }
-
-
- FUNCTION NextRequest(w : WindowPtr) : INTEGER;
- EXTERNAL;
- { returns the last event happened or 0 if nothing happens.
- This call DOES not wait, your program will continue to run.
- Please DO NOT USE NextRequest in a do-nothing loop since this
- will slow down your machine considerably. Use WaitRequest
- instead to wait until something has happened. }
-
-
- FUNCTION WaitRequest(w : WindowPtr) : INTEGER;
- EXTERNAL;
- { returns the last event happend or waits if nothing happend
- until something IS happening. This will send your program to
- sleep! }
-
-
-
- FUNCTION LastGadgetID(w : WindowPtr) : INTEGER;
- EXTERNAL;
- { returns the ID of the last gadget selected }
-
-
-
- FUNCTION MouseButton(w : WindowPtr) : BOOLEAN;
- EXTERNAL;
- { returns the state of the mouse button, may send task to sleep for
- max. one 6th of a second.
- This call returns ONLY the state of the LEFT mouse button (TRUE for
- pressed) as the right one is reserved for the menu. Please do not
- break the system law by using the right button for something else! }
-
-
- FUNCTION ModIDCMP(w : WindowPtr; new : INTEGER) : INTEGER;
- EXTERNAL;
- { modifies the IDCMP-flags. You should know what you're doing if you
- call this. Return the previous flags.
- This call should not used by beginners! HANDS OFF!
-
- The ordinary user should use the Request like functions defined
- above to do the job, since they are a) easier to use and b)
- friendly to the windowlib system. THIS ONE IS INTERNAL USE ONLY! }
-
-
- FUNCTION GetWindowMsg(w : WindowPtr) : IntuiMessagePtr;
- EXTERNAL;
- { returns the lastest message arrived at window w. After using it,
- you should reply it with ReplyMsg(msg).
-
- The same caveats go for this function as for the function on top.
- DO NOT USE! USE Request... instead! }
-
-
- FUNCTION WaitUntilWindow(w : WindowPtr) : IntuiMessagePtr;
- EXTERNAL;
- { send task to sleep untit message arrives, returns the message -
- already removed from window - in contrast to WaitMsg.
-
- This is also an INTERNAL USE ONLY FUNCTION! Use WaitRequest() or
- NextRequest() instead ! }
-
-
-
- FUNCTION OpenAWindow(left,top,wdth,hght,flgs: INTEGER; tit : String) : WindowPtr;
- EXTERNAL;
- { opens a window at given position, given size, flags and title. Returns
- a handle to that window - as needed by all other procedures.
- Flags should be 14 for most resons, see Libraries/Autodocs for more.
- THIS CALL MAY FAIL ! - Check the value: If NIL, there's no window !
- This call is only present for backward compatibility, use
- OpenScreenWindow with Screen set to NIL instead ! }
-
- FUNCTION OpenScreenWindow(s : ScreenPtr;left,top,wdth,hght,flgs : INTEGER; tit : String) : WindowPtr;
- EXTERNAL;
- { works like OpenAWindow, but opens window on given screen. NIL is the
- workbench.
- THIS CALL MAY FAIL ! }
-
- PROCEDURE CloseAWindow(w : WindowPtr);
- EXTERNAL;
- { closes given window. After this call, the windowpointer is no longer
- available.
- Works fine for both OpenAWindow and OpenScreenWindow.
- PLEASE CLOSE ALL WINDOWS you have opened! }
-
-
- FUNCTION OpenAScreen(left,top,wdth,hgth,dpth,flgs : INTEGER; tit : String) : ScreenPtr;
- EXTERNAL;
- { opens a new screen at left,top with given width and height.
- WARNING 1:left will be ignored prior to 2.0
- The screen depth is given in dpth.
- WARNING 2:not all depth will work, use them in a range of 1..6
- for MON_LORES or 1..4 with MON_HIRES.
- 2 to the power of dpth gives the number of available pens for this
- screen.
-
- The monitor type to use is determinated by flgs (see definitions above).
- WARNING 3:not all monitors support all types, some types
- (EHB,HAM) need a depth of 6 and NO LORES.
- The default title will be in tit.
- The return value is a handle to the screen.
- WARNING 4:THIS CALL MAY FAIL ! If it returns NIL, there's NO
- SCREEN !}
-
- PROCEDURE CloseAScreen(s : ScreenPtr);
- EXTERNAL;
- { closes a given screen (removes it from display and memory).
- You should close all windows of this screen prior to calling this
- (else this procedure does it for you...) }
-
- PROCEDURE SetColor(s : ScreenPtr;reg,red,green,blue : SHORT);
- EXTERNAL;
- { sets given color register=pen reg to a new color given
- by red,green,blue. They range from 0 to 15, with 15 beeing the
- maximum. 15,15,15 is white. }
-
-
- PROCEDURE GetColor(s : ScreenPtr;reg : SHORT;VAR r,g,b : SHORT);
- EXTERNAL;
- { read given color register, place the values in r,g,b }
-
-
-
- PROCEDURE WaitForIDCMP(w : WindowPtr; what : INTEGER);
- EXTERNAL;
- { wait until given IDCMP-flag arrives. They don't queue up in this
- release, so watch out. Call this only if you know what IDCMP is.
-
- ONCE AGAIN! DO NOT USE IT, USE NextRequest/WaitRequest INSTEAD!
- THIS ONE IS INTERNAL USE ONLY! }
-
-
- PROCEDURE Mouse(w : WindowPtr;VAR x,y : SHORT);
- EXTERNAL;
- { returns current mouse position. Because of multitasking, the values
- returned may be incorrect by a small amount if the mouse moved !
- The coordinates are relative to the window you gave. }
-
-
- PROCEDURE WaitLeftClick(w : WindowPtr;VAR x,y : SHORT);
- EXTERNAL;
- { wait until user presses left button and return the position where the
- mouse has been pressed }
-
-
- PROCEDURE WaitForClick(w : WindowPtr);
- EXTERNAL;
- { as above, but does not return mouse position }
-
-
- FUNCTION MouseDown(w : WindowPtr; VAR x,y : SHORT) : BOOLEAN;
- EXTERNAL;
- { returns position of the left mouse button - TRUE for down -
- and position of the mouse. This call may send your task to sleep
- for 1/6th second. }
-
-
- FUNCTION MouseMove(w : WindowPtr; VAR x,y : SHORT) : BOOLEAN;
- EXTERNAL;
- { as above, but waits until the mouse gets moved }
-
-
- PROCEDURE WaitForClose(w : WindowPtr);
- EXTERNAL;
- { waits until user presses the close gadget. It's your job to close
- the window with CloseAWindow - that's not done by this procedure }
-
-
- { The next calls are for creating gfx in the windows you opened with
- OpenScreenWindow/OpenAWindow. They take the window you want to draw in
- as an argument }
-
- PROCEDURE Color(w : WindowPtr; c : BYTE);
- EXTERNAL;
- { sets foreground drawing color=pen.
- The number of pens available depends on the screen you openend the window
- on. The contents of the pen is selected with SetColor() defined above.}
-
- PROCEDURE BgColor(w : WindowPtr; c : BYTE);
- EXTERNAL;
- { sets background color, used for text }
-
-
- PROCEDURE OlColor(w : WindowPtr; c: BYTE);
- EXTERNAL;
- { sets outline color, only used if Boundary(w,TRUE) called.
- A boundary will be drawn around objects created by
- PBox and PEllipse and the Area calls }
-
-
- PROCEDURE Boundary(w : WindowPtr; onoff : BOOLEAN);
- EXTERNAL;
- { if called with onoff=TRUE, all filled shapes are drawn with a
- frame of pen OlColor around them }
-
-
- PROCEDURE DrawMode(w : WindowPtr; mode : BYTE);
- EXTERNAL;
- { selects drawmode. The following modes are valid:
- 0 called JAM1. Draw with the foreground pen
- as defined by Color. This is the default.
- 1 called JAM2 and like JAM1, except for text.
- The background of the text is transparent for
- JAM1 and drawn by the pen defined with BGPen
- for JAM2
- 2 COMPLEMENT. The pixels get inverted by drawing
- over them. Useful if you want an operation to be
- undone easely. Draw it with COMPLETENT and to
- remove it, draw it again with COMPLEMENT.
- 4 INVERSEVID. Exchanges the meaning of the
- foreground and background pen.
- All modes can be combined by adding the values given in this list. }
-
-
- PROCEDURE SetDrawPattern(w : WindowPtr; pat : SHORT);
- EXTERNAL;
- { selects pattern for lines.
- Each bit in the variable pat defines one dot in a pattern of 16
- pixel length. Some useful values are
- 65535 for solid lines
- 21845 for dotted lines (each other pixel set)
- 13107 for even bigger dots
- 3855 for dashed lines
- 255 for even longer dashes.
- 4369 for tiny dots (each forth pixel set) }
-
-
- PROCEDURE ClearRaster(w : WindowPtr; color : BYTE);
- EXTERNAL;
- { fill entire window with given color }
-
-
- PROCEDURE ClearWindow(w : WindowPtr);
- EXTERNAL;
- { fill entire window with background color, set by BgColor }
-
- PROCEDURE SetWriteMask(w : WindowPtr; mask : BYTE);
- EXTERNAL;
- { sets bitplane mask. Only the bit planes with the
- corresponding bit set in the mask will be affected by graphic
- operations. Bit 0 is plane 0 and so on.
- 255 is the default, meaning all plains will be drawn into. }
-
-
- PROCEDURE DrawTo(w : WindowPtr; x,y : SHORT);
- EXTERNAL;
- { draws a line from last plot/position point to this one.
- The first point is set by Plot or Position }
-
-
- PROCEDURE Ellipse(w : WindowPtr; xm,ym,x,y : SHORT);
- EXTERNAL;
- { draws a ellipse around xm,ym with radii x,y }
-
-
- FUNCTION Locate(w : WindowPtr; x,y : SHORT) : BYTE;
- EXTERNAL;
- { returns color of point at x,y or -1 if the point is
- outside of the window }
-
-
- PROCEDURE Scroll(w : WindowPtr; x1,y1,x2,y2,dx,dy : SHORT);
- EXTERNAL;
- { scroll rectangle x1,y1,x2,y2 given amount dx,dy
- negative values are downwards/rightwards }
-
-
- PROCEDURE DrawText(w : WindowPtr;text : String);
- EXTERNAL;
- { write text at last position/plot point.
- The position is again determined by the last
- Position or Plot call }
-
-
- FUNCTION GetTextLength(w : WindowPtr;text : String) : SHORT;
- EXTERNAL;
- { returns length of text in pixels, using the actual font.
- The font can be set by another call, see below. }
-
-
- PROCEDURE Plot(w : WindowPtr; x,y : SHORT);
- EXTERNAL;
- { draw one point at x,y in foreground color, as set by
- the Color call }
-
-
-
- PROCEDURE Position(w : WindowPtr; x,y : SHORT);
- EXTERNAL;
- { selects next position for DrawTo,Text,...}
-
-
- PROCEDURE Line(w : WindowPtr; x1,y1,x2,y2 : SHORT);
- EXTERNAL;
- { draw a line from x1,y1 to x2,y2, coordinates are
- relative to the window and the color as been set
- by Color }
-
-
- PROCEDURE Fill(w : WindowPtr; x,y : SHORT);
- EXTERNAL;
- { starts flood fill at x,y. THIS CALL MAY FAIL
- if not enough memory for a temporary storage area
- is available ! }
-
-
- PROCEDURE PBox(w : WindowPtr; x1,y1,x2,y2 : SHORT);
- EXTERNAL;
- { draw a filled box from x1,y1,x2,y2 - draw frame around it
- if boudary is TRUE with the pen OlColor() }
-
-
- PROCEDURE Box(w : WindowPtr; x1,y1,x2,y2 : SHORT);
- EXTERNAL;
- { draw a frame from x1,y1 to x2,y2. The name is a bit
- misleading as this box does not get filled }
-
-
-
- PROCEDURE SetOffset(w : WindowPtr; x,y : SHORT);
- EXTERNAL;
- { sets coordinate offset. Normally, the leftmost, topmost point
- will have the coordinates 0,0 - after this call it's -x,-y.
- BY INSTALLING THIS OFFSET, THE POINTS ALREADY DRAWN WON'T MOVE!
-
- You should note that x,y is relative to an already installed
- offset anyway - so SetOffset(w,0,0) does nothing usefull.
- Use SetOffset(w,-x,-y) or InstallStdClip(w) to restore the old
- values. }
-
-
- PROCEDURE Clip(w : WindowPtr; x1,y1,x2,y2 : SHORT);
- EXTERNAL;
- { installes a clipping rectangle in given window - only
- points inside of the rectangle x1,y1,x2,y2 are affected
- by drawing. To remove the ClipRect again, call
- InstallStdClip(w).
- However, the coordinates of all points are not moved -
- use SetOffset to move point 0,0 to the left edge of
- your clipping rectangle.}
-
-
-
- { The next functions are so-called area-functions. You may
- record certain graphic operations by them, and doing them all
- at once with one call, filling the drawn shape with a
- given color. This is most useful for drawing filled polygones:
- Use a sequence of AreaMove/AreaDraw calls to setup the boundary
- points, and call CompleteArea() to draw it. If you called
- Boundary(w,TRUE) before, the boundary will be drawn in an
- additional color, defined by OlColor. The color which is used to
- fill the polygone is setup by Color(). }
-
-
- PROCEDURE AddAreaEllipse(w : WindowPtr; xm,ym,x,y : SHORT);
- EXTERNAL;
- { this is a area function. This means: calling this type of function
- stacks all operation back - the objects are drawn later with a
- call to CompleteArea.
- This call adds a filled ellipse at xm,ym, radii x,y to the object
- stack. }
-
- PROCEDURE AddAreaDraw(w : WindowPtr; x,y : SHORT);
- EXTERNAL;
- { this call adds a point to a filled polygon to the object stack.
- The polygon is completed with an AddAreaPoint or a CompleteArea.
-
- This call does actually not the drawing, call CompleteArea to
- make your object visible after defining all points. }
-
-
- PROCEDURE AddAreaMove(w : WindowPtr; x,y : SHORT);
- EXTERNAL;
- { complete old filled polygon - if any - and start a new one at
- x,y. This is again an area function, so its operation is
- invisible until a call to CompleteArea. }
-
- PROCEDURE CompleteArea(w : WindowPtr);
- EXTERNAL;
- { complete all objects and draw them, start a new invisible
- object definition. You must call this if you want to see
- your defined area-objects. }
-
-
- PROCEDURE PEllipse(w : WindowPtr; xm,ym,x,y : SHORT);
- EXTERNAL;
- { draw a filled ellipse at xm,ym with radii x,y.
- Cause this call uses area-functions, you should not use it
- inside of an area definition or all your objects get lost! }
-
-
- PROCEDURE SetAreaSize(w : WindowPtr; size : SHORT);
- EXTERNAL;
- { sets size of area object stack. Default is 256 points.
- You should call this if you get an area buffer overflow error, i.e.
- the program will abort with a warning message in this case.}
-
-
-
- PROCEDURE Dimensions(w : WindowPtr; VAR width,height : SHORT);
- EXTERNAL;
- { get size of drawable area in pixels from the window.
- This is NOT the size of the window itself, since the boundary
- ocupies some space. Dimensions=Window-Boundary !}
-
-
- PROCEDURE SelectPoint(w : WindowPtr; VAR x,y : SHORT);
- EXTERNAL;
- { let user select a point of the window, with a cross.}
-
-
- PROCEDURE DragBox(w : WindowPtr; xanc,yanc : SHORT; VAR x,y : SHORT);
- EXTERNAL;
- { let the user select the other edge of a rectangle.
- This call assumes the user is already pressing the mouse button,
- use this call together with SelectPoint to define a rectangle:
-
- SelectPoint(w,x1,y1);
- DragBox(w,x2,y2);
-
- will do this job - after all x1,y1,x2,y2 contain the rectangle }
-
-
-
- FUNCTION SetWindowFont(w : WindowPtr;name : String;size : SHORT) : BOOLEAN;
- EXTERNAL;
- { select the default font of the window.
- This call may fail if the desired font is not available.
-
- Specifying disk fonts is valid here, in this case the call will
- load the desired font from disk. }
-
-
-
- PROCEDURE Print(w : WindowPtr;text : String);
- EXTERNAL;
- { Print a string to the window. Unlike DrawText, all escape
- sequences of the console are interpreted, but Print is much slower! }
-
-
-
- PROCEDURE SetStyle(w : WindowPtr;style : SHORT);
- EXTERNAL;
- { Select the style of the window default font.
- 1 is underlined,
- 2 is bold,
- 4 is italic.
- Add the values for style combinations.}
-
-
- FUNCTION CreateStringField(w : WindowPtr;x,y,xsize,ysize : SHORT) : GadgetPtr;
- EXTERNAL;
- { Create a field ready for string entry. This is again
- an intuition "gadget" object. You receive a GADGETUP_f message if
- the user presses RETURN inside. The text he entered can be obtained
- by another call, definded below. }
-
-
-
- FUNCTION ActivateField(g : GadgetPtr) : BOOLEAN;
- EXTERNAL;
- { Activates a string field, returns TRUE on success.
- Activation means that the cursor gets drawn in this field,
- and user input goes to it. }
-
-
- FUNCTION BufferFromField(g : GadgetPtr) : String;
- EXTERNAL;
- { given a string field this call returns the text that has
- been entered in it. }
-
-
- { Again some slider related calls }
-
- PROCEDURE SetSlider(g : GadgetPtr;choices,viewable,first : SHORT);
- EXTERNAL;
- { set slider position, viewable elements and # of choices, and the
- intial position of the slider.
- If you want the user to select an item of a list consisting of
- 20 elements with 5 beeing shown on the screen, set
- choices to 20
- viewable to 5
- and first to whichever element is visible on top of the viewable
- selection. The elements are numbered from 0 to choices-1.
- If you don't want to maintain a list, just want to get a value with
- a slider, set viewable to one. }
-
-
- PROCEDURE SetSliderFirst(g : GadgetPtr;first : SHORT);
- EXTERNAL;
- { set only position of slider. Same as call above, but does
- not change the size of the list }
-
-
- FUNCTION CreateSlider(w : WindowPtr;x,y,xsize,ysize : SHORT;vert : BOOLEAN) : GadgetPtr;
- EXTERNAL;
- { create a slider gadget at position with given size.
- if vert is true, it's moveable vertically, else horizontally.
- The size of the knob of this slider is NOT set by this function,
- you have to do this with a call of SetSlider. This will also set the
- position of the knob. }
-
-
- FUNCTION FirstFromSlider(w : GadgetPtr) : SHORT;
- EXTERNAL;
- { returns current position of the slider, i.e. the number of
- the topmost element of the viewables. This varies from
- 0 to choices-viewable, as defined by SetSlider() }
-
-
-
-
- PROCEDURE CreateMenu(w : WindowPtr;cmd : Address);
- EXTERNAL;
- { create a menu, giving the MenuCommand structure.
- See the beginning of this file for how this
- structure looks like. }
-
-
- PROCEDURE DeleteMenu(w : WindowPtr);
- EXTERNAL;
- { delete the menu. }
-
-
-
- PROCEDURE LastMenu(w : WindowPtr;VAR menu,item,subitem : SHORT);
- EXTERNAL;
- { get number of last menu selected, returns -1 if not.
- menu, item, subitem are the numbers of the menu/item/subitem resp.
- counting from 0 and from left to right, from top to bottom.
- If one entry is -1, no menu/item/subitem has been selected. }
-
-
- PROCEDURE OnMenuPoint(w : WindowPtr;menu,item,subitem : SHORT);
- EXTERNAL;
- { enable given menu point. The numbering is the same as the
- one above. To enable a complete list of subitems of an item,
- set item to the correct item number and set subitem to -1. }
-
-
- PROCEDURE OffMenuPoint(w : WindowPtr;menu,item,subitem : SHORT);
- EXTERNAL;
- { disable given menu point, different direction of OffMenuPoint }
-
-
- PROCEDURE CheckMenu(w : WindowPtr;menu,item,subitem : SHORT;check : BOOLEAN);
- EXTERNAL;
- { set checkmark of a menupoint. Set if check is TRUE, else clear. }
-
-
- FUNCTION CheckMarkOfMenu(w : WindowPtr;menu,item,subitem : SHORT) : BOOLEAN;
- EXTERNAL;
- { returns the state of the checkmark of a given menu }
-
-
- PROCEDURE LastKey(w : WindowPtr;text : String;VAR qualifier : SHORT);
- EXTERNAL;
- { copies the last keyboard entry to text.
- "Text" should be at least 16 characters long. }
-
-
-
- PROCEDURE ScreenToBack(s : ScreenPtr);
- EXTERNAL;
- { move screen to background }
-
-
-
- PROCEDURE ScreenToFront(s : ScreenPtr);
- EXTERNAL;
- { make screen the topmost }
-
-
- PROCEDURE ShowTitle(s : ScreenPtr;showit : BOOLEAN);
- EXTERNAL;
- { show or remove title bar }
-
-
- PROCEDURE WBenchToFront;
- EXTERNAL;
- {move the workbench screen to front}
-
-
- PROCEDURE WBenchToBack;
- EXTERNAL;
- {move the workbench screen to back}
-
-
- PROCEDURE OpenWorkBench;
- EXTERNAL;
- {open the workbench screen}
-
- PROCEDURE CloseWorkBench;
- EXTERNAL;
- {close the workbench screen}
-