- {$IFC UNDEFINED UsingIncludes}
- {$SETC UsingIncludes := 0}
- {$ENDC}
-
- {$IFC NOT UsingIncludes}
- UNIT Menus;
- INTERFACE
- {$ENDC}
-
- {$IFC UNDEFINED UsingMenus}
- {$SETC UsingMenus := 1}
-
- {$I+}
- {$SETC MenusIncludes := UsingIncludes}
- {$SETC UsingIncludes := 1}
- {$IFC UNDEFINED UsingQuickdraw}
- {$I $$Shell(PInterfaces)Quickdraw.p}
- {$ENDC}
- {$SETC UsingIncludes := MenusIncludes}
-
- Const
- noMark = 0; {Symbole de marque pour MarkItem}
-
- { menu de messages defProc }
- mDrawMsg = 0;
- mChooseMsg = 1;
- mSizeMsg = 2;
- mDrawItemMsg = 4;
- mCalcItemMsg = 5;
- textMenuProc = 0;
- hMenuCmd = 27; {itemCmd == 0x001B ==> menu hiérarchique}
- hierMenu = -1; {un menu hiérarchique - pour l'appel InsertMenu}
- mPopUpMsg = 3; {menu messages defProc - placez vous-mêmes }
- mctAllItems = -98; {rechercher tous les éléments pour l'ID donné}
- mctLastIDIndic = -99; {la dernière entrée de la table des couleurs contient ceci dans le champ ID}
-
- Type
- MenuPtr=^MenuInfo;
- MenuHandle=^MenuPtr;
- MenuInfo=Record
- menuID:INTEGER;
- menuWidth:INTEGER;
- menuHeight:INTEGER;
- menuProc:Handle;
- enableFlags:LONGINT;
- menuData:Str255;
- End;
-
- MCEntryPtr=^MCEntry;
- MCEntry=RECORD
- mctID:INTEGER; {identificateur du menu. ID = 0 est la barre de menu}
- mctItem:INTEGER; {élément du menu. Item = 0 est un titre}
- mctRGB1:RGBColor; {l'utilisation dépend de l'ID et de l'élément}
- mctRGB2:RGBColor; {l'utilisation dépend de l'ID et de l'élément}
- mctRGB3:RGBColor; {l'utilisation dépend de l'ID et de l'élément}
- mctRGB4:RGBColor; {l'utilisation dépend de l'ID et de l'élément}
- mctReserved:INTEGER; {réservé pour un usage interne}
- END;
-
- {}
-
- MCTablePtr=^MCTable;
- MCTableHandle=^MCTablePtr;
- MCTable=Array[0..0] of MCEntry; { les entrées elles-mêmes }
- MenuCRsrcPtr=^MenuCRsrc;
- MenuCRsrcHandle=^MenuCRsrcPtr;
- MenuCRsrc=Record
- numEntries:INTEGER; {Nombre d'entrées}
- mcEntryRecs:MCTable; {ARRAY [1..numEntries] of MCEntry}
- END;
-
- PROCEDURE InitMenus; INLINE $A930;
- FUNCTION NewMenu(menuID: INTEGER;menuTitle: Str255): MenuHandle; INLINE $A931;
- FUNCTION GetMenu(resourceID: INTEGER): MenuHandle; INLINE $A9BF;
- PROCEDURE DisposeMenu(theMenu: MenuHandle); INLINE $A932;
- PROCEDURE AppendMenu(menu: MenuHandle;data: Str255); INLINE $A933;
- PROCEDURE AddResMenu(theMenu: MenuHandle;theType: ResType); INLINE $A94D;
- PROCEDURE InsertResMenu(theMenu: MenuHandle;theType: ResType;afterItem: INTEGER); INLINE $A951;
- PROCEDURE InsertMenu(theMenu: MenuHandle;beforeID: INTEGER); INLINE $A935;
- PROCEDURE DrawMenuBar; INLINE $A937;
- PROCEDURE InvalMenuBar; INLINE $A81D;
- PROCEDURE DeleteMenu(menuID: INTEGER); INLINE $A936
- PROCEDURE ClearMenuBar; INLINE $A934;
- FUNCTION GetNewMBar(menuBarID: INTEGER): Handle; INLINE $A9C0;
- FUNCTION GetMenuBar: Handle; INLINE $A93B;
- PROCEDURE SetMenuBar(menuList: Handle); INLINE $A93C;
- PROCEDURE InsMenuItem(theMenu: MenuHandle;itemString: Str255;afterItem: INTEGER); INLINE $A826;
- PROCEDURE DelMenuItem(theMenu: MenuHandle;item: INTEGER); INLINE $A952;
- FUNCTION MenuKey(ch: CHAR): LONGINT; INLINE $A93E;
- PROCEDURE HiliteMenu(menuID: INTEGER); INLINE $A938;
- PROCEDURE SetItem(theMenu: MenuHandle;item: INTEGER;itemString: Str255); INLINE $A947;
- PROCEDURE GetItem(theMenu: MenuHandle;item: INTEGER;VAR itemString: Str255); INLINE $A946;
- PROCEDURE DisableItem(theMenu: MenuHandle;item: INTEGER); INLINE $A93A;
- PROCEDURE EnableItem(theMenu: MenuHandle;item: INTEGER); INLINE $A939;
- PROCEDURE CheckItem(theMenu: MenuHandle;item: INTEGER;checked: BOOLEAN); INLINE $A945;
- PROCEDURE SetItemMark(theMenu: MenuHandle;item: INTEGER;markChar: CHAR); INLINE $A944;
- PROCEDURE GetItemMark(theMenu: MenuHandle;item: INTEGER;VAR markChar: CHAR); INLINE $A943;
- PROCEDURE SetItemIcon(theMenu: MenuHandle;item: INTEGER;iconIndex: Byte); INLINE $A940;
- PROCEDURE GetItemIcon(theMenu: MenuHandle;item: INTEGER;VAR iconIndex: Byte); INLINE $A93F;
- PROCEDURE SetItemStyle(theMenu: MenuHandle;item: INTEGER;chStyle: Style); INLINE $A942;
- PROCEDURE GetItemStyle(theMenu: MenuHandle;item: INTEGER;VAR chStyle: Style);
- PROCEDURE CalcMenuSize(theMenu: MenuHandle); INLINE $A948;
- FUNCTION CountMItems(theMenu: MenuHandle): INTEGER; INLINE $A950;
- FUNCTION GetMHandle(menuID: INTEGER): MenuHandle; INLINE $A949;
- PROCEDURE FlashMenuBar(menuID: INTEGER); INLINE $A94C;
- PROCEDURE SetMenuFlash(count: INTEGER); INLINE $A94A;
- FUNCTION MenuSelect(startPt: Point): LONGINT; INLINE $A93D;
- PROCEDURE InitProcMenu(resID: INTEGER); INLINE $A808;
- PROCEDURE GetItemCmd(theMenu: MenuHandle;item: INTEGER;VAR cmdChar: CHAR); INLINE $A84E;
- PROCEDURE SetItemCmd(theMenu: MenuHandle;item: INTEGER;cmdChar: CHAR); INLINE $A84F;
- FUNCTION PopUpMenuSelect(menu: MenuHandle;top: INTEGER;left: INTEGER;popUpItem: INTEGER): LONGINT; INLINE $A80B;
- FUNCTION MenuChoice: LONGINT; INLINE $AA66;
- PROCEDURE DelMCEntries(menuID: INTEGER;menuItem: INTEGER); INLINE $AA60;
- FUNCTION GetMCInfo: MCTableHandle; INLINE $AA61;
- PROCEDURE SetMCInfo(menuCTbl: MCTableHandle); INLINE $AA62;
- PROCEDURE DispMCInfo(menuCTbl: MCTableHandle); INLINE $AA63;
- FUNCTION GetMCEntry(menuID: INTEGER;menuItem: INTEGER): MCEntryPtr; INLINE $AA64;
- PROCEDURE SetMCEntries(numEntries: INTEGER;menuCEntries: MCTablePtr); INLINE $AA65;
-
- {$ENDC} { UsingMenus }
-
- {$IFC NOT UsingIncludes}
- END.
- {$ENDC}
Dernière mise à jour : Lundi, le 24 juin 2024