4D v13.4Pop-up Menus/Drop-down Lists |
||
|
4D v13.4
Pop-up Menus/Drop-down Lists
Pop-up Menus/Drop-down Lists
Pop-up menus and drop-down lists are objects that allow the user to select from a list. You manage the items displayed in the pop-up menu using an array. An array is a list of values in memory that is referenced by the name of the array (see the section Arrays and Form Objects). A pop-up menu/drop-down list displays an array as a list of values when you click on it. The names “Pop-up menu” and “Drop-down list” refer to the same objects; “Pop-up menu” is part of Mac OS terminology and “Drop-down list” is part of Windows. As the following example shows, the appearance of these objects differs slightly according to the platform: Windows You initialize the object by loading a list of values into an array. You can do this in several ways:
If you need to save the user’s choice into a field, you would use an assignment statement that runs after the record is accepted. A complete Case statement in the object method might look like this: Case of In the Events section of the Property List window, you would select each event that you test for in your Case statement. Arrays always contain a finite number of items. The list of items is dynamic and can be changed by a method. Items in an array can be modified, sorted, and added to. For information about creating and using an array, refer to the Arrays chapter in the 4D Language Reference manual. You can assign the Goto Page standard action to a pop-up menu/drop-down list (“Action” theme of the Property List). When this action is selected, 4D will automatically display the page of the form that corresponds to the number of the object that is selected in the drop-down list. For example, if the user selects the third item of the list, 4D will display the third page of the current form (if it exists). |
PROPERTIES
Product: 4D |