MENUS
Get the state of menu item
You can test or set bits in this field via:
FN BITTST(#[mHndl&]+_menuEnable, 31 - bitToBeTested)
and
FN BITSET(#[mHndl&]+_menuEnable, 31 - bitToBeSet)
The Bit functions reverse the bit order, so bit 31 is what we would normally consider bit 0, etc., hence the 31 - bit#. You can also build bitfields of your own (masks or presets, if you will), and POKE LONG the whole thing in there to enable/disable the entire menu at once.
menuH& = FN GETMHANDLE(_mFileMenu)
LONG IF menuH&
gFilesEnableFlags& = [[menuH&]+_MenuEnable]
IF (gFilesEnableFlags& AND BIT(_iOpen)) THEN CALL ENABLEITEM(menuH&,_iOpen)
IF (gFilesEnableFlags& AND BIT(_iSave)) THEN CALL ENABLEITEM(menuH&,_iSave)
IF (gFilesEnableFlags& AND BIT(_iSaveAs)) THEN CALL
ENABLEITEM(menuH&,_iSaveAs)
END IF
where, normally,
_mFileMenu = 1
_iOpen = 2
_iSave = 5
_iSaveAs = 6
_iQuit = 8
|