KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Marking the selected menu item
PRODUCT: 4D | VERSION: 6.5 | PLATFORM: Mac & Win
Published On: March 30, 2001
Your current browser may not allow you to download the asset. We recommend Mozilla Firefox or Google Chrome.
Log In

Normally when you select the custom menu item, 4D does not automatically mark the item that you have selected. This must be done procedurally with the command SET MENU ITEM MARK.

The following is a sample method that will switch the marker between the menu items.

C_INTEGER($1;$2)

C_INTEGER($mBar;$mItem)
C_LONGINT($3;$ProcessNumber;$TotalItem)
$mBar:=$1
$mItem:=$2
$ProcessNumber:=$3
$TotalItem:=Count menu items($mBar;$ProcessNumber)
For ($i;1;$TotalItem)
 If ($i=$mItem)
  ` Place a mark in the menu item
 SET MENU ITEM MARK($mBar;$i;Char(18);$ProcessNumber)
 Else
  ` Remove a mark from the menu item
  SET MENU ITEM MARK($mBar;$i;"";$ProcessNumber)
 End if
End for

When the menu item is selected, the above method will be called to perform this task, producing the following result.











Item3 is selected.


Note: On Windows, the menu item is assigned the standard check mark.