(****************************************************************************) (* *) (* GSX Support Module : BUTTON *) (* =========================== *) (* A BUTTON is a bar area on the screen, which can be selected by pressing *) (* a mouse ( or keyboard ) button. *) (* *) (* 23.1.1988 Wolfgang Muees, Hagenring 22, 3300 Braunschweig *) (* *) (****************************************************************************) DEFINITION MODULE GSXBUTON; TYPE BUTTON; (* That's what we want! *) ButtonProc = PROCEDURE ( CHAR ); (* Called with input terminator *) PROCEDURE CreateButton ( x, y, dx, dy : CARDINAL; p : ButtonProc ) : BUTTON; (* Creates a new button. x, y denote lower left egde of button bar, dx = width, dy = height. p is a procedure executed if a terminating character is returned from input device. *) PROCEDURE DeleteButton ( VAR Button : BUTTON ); (* Deletes a button, deallocates storage for other purposes. *) PROCEDURE CursorAtButton ( Button : BUTTON ) : BOOLEAN; (* After a mouse button is pressed, cursor coordinates are tested if they are in range of specified button area. *) PROCEDURE FlipButtonArea ( Button : BUTTON ); (* Used to hightlight / lowlight a button area after pressing them. *) PROCEDURE ExecuteButton ( Button : BUTTON; C : CHAR ); (* If you have found the propper button with CursorAtButton then a call to ExecuteButton will do it. *) END GSXBUTON.