KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Adding Pop Up Menus to the form
PRODUCT: 4D | VERSION: | PLATFORM: Mac & Win
Published On: May 19, 2000

4D has many commands that allow you to create an interactive user interface. One of them is the Pop up menu command. It displays a pop-up menu at the current location of the mouse. Suppose you want to create a pop-up menu for an object. The pop-up menu command must be included in your object method to enable this feature.

Here is a sample of a popup method:

Here is a text copy of the code shown above for you to cut-and-paste into your own project:
str:="item1;item2;item3" `List of contents
selectedItem:=Pop up menu(str) `Returns the number of the selected item
Case of
 : (selectedItem=1)
  `Do something
 : (selectedItem=2)
  `Do something
 : (selectedItem=3)
  `Do something
End case