2 Copyright © 1995-2003, The AROS Development Team. All rights reserved.
3 Copyright © 2001-2003, The MorphOS Development Team. All Rights Reserved.
7 #include "intuition_intern.h"
9 /*****************************************************************************
12 #include <intuition/intuition.h>
14 AROS_LH2(void, OffMenu
,
17 AROS_LHA(struct Window
*, window
, A0
),
18 AROS_LHA(UWORD
, menunumber
, D0
),
21 struct IntuitionBase
*, IntuitionBase
, 30, Intuition
)
24 Disable a whole menu, an item or a sub-item depending on
28 window - The window, the menu belongs to
29 menunumber - The packed information on what piece of menu to disable
41 OnMenu(), ResetMenuStrip()
47 *****************************************************************************/
50 AROS_LIBBASE_EXT_DECL(struct IntuitionBase
*,IntuitionBase
)
53 struct Menu
*thismenu
;
54 struct MenuItem
*thisitem
;
56 DEBUG_OFFMENU(dprintf("OffMenu: Window 0x%lx MenuNumber 0x%lx\n", window
, menunumber
));
58 IntuitionBase
= IntuitionBase
; /* shut up the compiler */
60 thismenu
= window
->MenuStrip
;
62 if (MENUNUM(menunumber
) != NOMENU
)
64 for (i
= 0; i
< MENUNUM(menunumber
) && thismenu
; i
++)
66 thismenu
= thismenu
->NextMenu
;
71 if (ITEMNUM(menunumber
) == NOITEM
)
73 thismenu
->Flags
&= ~MENUENABLED
;
77 thisitem
= thismenu
->FirstItem
;
79 for (i
= 0; i
< ITEMNUM(menunumber
) && thisitem
; i
++)
81 thisitem
= thisitem
->NextItem
;
86 if (SUBNUM(menunumber
) != NOSUB
)
88 thisitem
= thisitem
->SubItem
;
89 for (i
= 0; i
< SUBNUM(menunumber
) && thisitem
; i
++)
91 thisitem
= thisitem
->NextItem
;
98 thisitem
->Flags
&= ~ITEMENABLED
;
102 } /* if (thismenu) */
104 } /* if (MENUNUM(menunumber) != NOMENU) */