4D v16.3

Setting list properties

Home

 
4D v16.3
Setting list properties

Setting list properties  


 

The current item properties area contains an entry area for the item’s Reference. The Reference is designed as a unique ID for the item. It is of use only when you manage lists using methods or when you have enabled the Save as Reference option for a list field or variable (see Save as Value or Reference).

When you need to use the language to determine which item in a list a user selects (e.g., which item in a hierarchical menu is selected), you can identify the user’s choice using the Reference of the item. For more information, see the Hierarchical Lists chapter in the 4D Language Reference manual.

The Lists editor offers the Modifiable Element option for each element of a list. It is checked by default. 

This option is only used with lists displayed in the form of hierarchical lists or tab controls. Its action is different in both cases.

Note: When a list is associated with a combo box (see Combo Boxes), the elements are always modifiable.

A list can also be used to specify the items in a “hierarchical list” object. When the list is used in this manner, you can control whether each item in the list can be edited by the user. If a list item is modifiable, the user can hold down the Alt key under Windows or Option key under Mac OS and click on the item (or simply click twice) to get an insertion point. An editable item in a hierarchical list is shown below:

In this case, the Modifiable Element option lets you allow the user to modify the element of the hierarchical list.

When a list is associated with tab controls, you can enable or disable each tab control that corresponds to an item of the list. A disabled tab control will be displayed in gray in the form. In the following example, the tab control “Henderson” is disabled:

In this case, the Modifiable Element option lets you enable the tab control corresponding to the element.

You can associate a small icon with an item in a list. When the list is displayed in a scrolling area or on a tab, this icon appears to the left of the value.

The small icons that you use are stored either in the picture library, or in ‘cicn’ or ‘pict’ type resources.

Compatibility note: Using "resources" is no longer recommended in 4D because this technology is now obsolete (for more information, refer to Resources in the 4D Language Reference manual). These options are only kept for compatibility. We recommend that you use library pictures.

To associate a small icon with a list value:

  1. Select the list then the value with which you want to associate the icon.
  2. Choose an option from the Source menu of the Icon area.
    This menu is used to indicate the source of the icon (the Picture Library option is recommended).
    When you choose an option, the contents of the Icon ID menu are updated in order to list all the pictures available in the database that correspond to the type set in the Source menu.
  3. Choose a value from the Icon ID combo-box.

    The icons are listed in number/name form. If you have chosen the “Picture Library” option, the Icon ID menu contains all the pictures stored in the library.
    The icon is added to the left of the label in the list of items:

Note: Depending on the size of the icons you use, you may need to modify the list’s height. For more information, refer to “Setting the minimum height of a list” section below.

To delete an icon reference, select the value in the “Icon ID” combo-box and hit Backspace or enter 0.

When a list is used as a choice list, you can display list items in bold, italic, and/or underline. 

To apply styles, select the value in the list and check the Bold, Italic and/or Underline options as desired. You can choose several options if you want to combine the styles. The following illustration shows the bold and italic attributes applied to a list item.

When the list is used as a choice list, the selected style attributes will be used, as shown in the following illustration:

When 4D displays a list as a choice list, it uses the font size of the hierarchical list object to determine the vertical spacing between adjacent list items. If you use a list to specify the values of a hierarchical list, you can specify a larger vertical spacing.

The main reason you would want to do this is to provide additional space for icons that are attached to list items. Or, you can use this feature simply to spread out the list items.

To specify a minimum height, enter a value in points in the “Lines height” entry area.
The effects of this value are displayed immediately in the list of items area. The following illustrations show the effect of increasing the minimum height:

4D allows you to specify whether a list of items can be changed by the user when it is displayed as a choice list. By default, a list is not modifiable. 

If you allow a list to be user modifiable, the user has access to a special List editor when using the database. The special List editor is for the assigned list only. The user cannot add lists, delete lists, or change any other list. If a list is modifiable, the user can make any necessary changes to that list’s items. 

If a list is modifiable, the Modify button is enabled in the List dialog box when using the database. 

When the user clicks this button, the “user” List editor is displayed. The following shows this List editor:

To make the list user-modifiable:

  1. Select the list that you want to make modifiable.
  2. Check the Editable by user option in the “List Properties” area:

    The list can then be modified by the users of the database.

To prevent the user from modifying a list, select the list and deselect the Editable by user option.

 
PROPERTIES 

Product: 4D
Theme: Lists

 
HISTORY 

 
ARTICLE USAGE

4D Design Reference ( 4D v16)
4D Design Reference ( 4D v16.1)
4D Design Reference ( 4D v16.3)