-- Compiler MenuDefs
-- MStone and Tiberi October 31, 1979  11:00 PM
-- Tiberi November 2, 1979  3:32 PM

DIRECTORY
	PointDefs: FROM "PointDefs",
	StyleDefs: FROM "StyleDefs",
	ObjectDefs: FROM "ObjectDefs";

MenuDefs: DEFINITIONS =
BEGIN OPEN ObjectDefs;

MenuItem: TYPE = RECORD
	[
	link: MenuItemHandle, 
	menu: MenuHandle,
	selected, inverted: BOOLEAN,
	tl,br: PointDefs.ScrPt,
	string: STRING, 
	proc: MenuProc
	];
MenuHandle: TYPE = POINTER TO menu Object;
MenuItemHandle: TYPE = POINTER TO MenuItem;

MenuProc: TYPE = PROCEDURE [item: MenuItemHandle];

CreateMenu: PROCEDURE [orientation: MenuOrientation, tl: PointDefs.ScrPt, title: STRING] RETURNS [menu: MenuHandle];
AddMenuItem: PROCEDURE [menu: MenuHandle, string: STRING, proc: MenuProc] RETURNS [MenuItemHandle];

ForAllMenus: PROCEDURE [proc: PROCEDURE [menu: MenuHandle]];
ForAllMenuItems: PROCEDURE [menu: MenuHandle, proc: MenuProc];
OverWhichItem: PROCEDURE [pt: PointDefs.ScrPt] RETURNS [item: MenuItemHandle];
IsOverItem: PROCEDURE [pt: PointDefs.ScrPt, item: MenuItemHandle]
	RETURNS [BOOLEAN];

PlotMenu, ShowMenu, HideMenu:  PROCEDURE [menu: MenuHandle];
BugItem: MenuProc;

Select, SelectOnly, Deselect,
HighlightMenuItem, ClearMenuItem: MenuProc;


--access to parts:
IsSelected:  PROCEDURE [item: MenuItemHandle] RETURNS [BOOLEAN];
MenuString:  PROCEDURE [item: MenuItemHandle] RETURNS [STRING];
SetMenuString: PROCEDURE [item: MenuItemHandle, string: STRING];
MenuAnchorPoint:  PROCEDURE [item: MenuItemHandle]
	RETURNS [PointDefs.ScrPt];
WhichMenu: PROCEDURE[item: MenuItemHandle] RETURNS [menu: MenuHandle];
MenuStyle: PROCEDURE RETURNS [StyleDefs.StyleHandle];

END.