Class: DfBaseList [Abstract]

Properties  Events  Methods    Index of Classes

An intermediate class that is used as the basis for all "item- and form-based" classes

This is an abstract class and should never be used by a developer for object instantiation. While a developer could use this class for sub-classing, it is not encouraged.



Library: Windows Application Class Library

Package: none (class defined in runtime)

Mixins: Cm_List_Mixin Cm_Menu_Mixin DFListMenu_Mixin


DFBaseList is an intermediate class that is used as the basis for all "item- and form-based" classes. This includes: menus (MenuBar, PopupMenu), entry forms (form, ComboForm), buttons (Button, Radio, CheckBox), lists (list) and entry tables (grid). All of the low-level item-based messages item_changed_state, value, aux_value, etc.) and form-based messages form_width, form_margin, etc.) are introduced in this class. This is an abstract class and is not intended for subclassing or instantiation.

Of Special Note

The DFBaseList class is the basic for most of the DataFlex control classes. This include single item classes (form, button, radio, etc.) and multiple item classes (list, grid, etc.). A number of important properties and messages are defined at this class level.

In older programs you will see the keyword item before the index value (e.g., set Value 0 to "x"). The item keyword is optional. Its usage is no longer recommended.

Single-Item and Multi-Item Objects

The DfBaseList class is used as the basis for single-item and multi-item classes. A single-item object can be thought of as a multi-item class with only a single item. When setting item and form properties, this single item is usually identified as item 0. This simplifies the interface by allowing a single set of messages to be used with single- and multple-item objects. This does add a slight overhead to the interface by requiring that the single item number always be identified as item 0.

Multi-item objects are initialized with an empty list. The items must be added by the program. This is done using the commands item_list, on_item, end_item_list, or by using the messages add_item, insert_item, delete_item, and delete_data. The item_list commands tend to be used for creating static items. The messages are used for more-dynamic list manipulation. Normally you should use the messages (add_item, etc.) for all list creation. They are more-flexible and they allow you to use a single interface for static and dynamic list maintanence.

Single-item objects (form, button, radio, ComboForm, etc.) do not have to be added to an item list - the single item already exists. You control these values by setting their item and form properties (always for item 0).


Often a multi-item object needs to be arranged in rows. A row consists of a display area of one or more columns. Rows are defined by setting the line_width property. This expects two parameters: the number of columns in a row and the number of rows. Normally you only need to specify the number of columns and would like the object to calculate the number of rows based on the size of the object. This is done by passing a zero for number of rows. By default, the number of columns is 0. This creates a single-column list.

Set Line_Width to 1 0 // two columns, 
Set Line_Width to 3 0 // four columns

The line_width of single-item objects will always be 0, 0.

Item-Based Properties

Item properties are those properties that are associated with a single item. Items exist independently of their display area. For example, a list object that can visually display five rows of data may contain 10 items or no items. An item may appear in any position within an object's display area or it may not appear in the display at all. Each item stores information in a number of item properties. The most-commonly used item properties are value, aux_value, message, shadow_state, entry_state, item_changed_state, and select_state. In addition, a number of item-based messages are supported to manipulate this item data. The most-commonly used messages are: send add_item, send delete_data, send insert_item, send delete_item, get item_count, and get/set current_item. Item properties and messages must be passed an item number. If an item number is not passed, the "current" item is used. If it is not clear what the current item will be (and it often is not) you should simply pass the item number in your message.

Set Value 0 to "John"

Get Item_Changed_State 3 to state
Get current_item to itm
Get shadow_state itm to state


Forms represent a display region. For example a display area may consist of 3 rows by 4 columns. There will be 12 forms (or form display regions) for this area. A number of display properties may be assigned to each form region. These properties all begin with the Form prefix. Examples of form properties are form_width, form_height, form_row, and form_datatype.

Form properties must be set passing a form number and the property setting. The form number must be passed.

Set Form_margin 0 to 20
Get Form_Height 10 to Var

There are many form messages. It would be rather tedious to have to assign each form property to each form region in the display. Fortunately, this is not required. The following rules are applied when creating form properties:

Most form properties will not need to be set. The class will usually set the appropriate form value for you. If a subclass does not refer to a form property in its documentation, you probably will not need to set it.

A form property applied to Item 0 (set form_property 0 to value) will be copied to all other form regions.

A form property applied to any form in the first column is copied to all other forms within the column. Number of columns is determined by setting the line_width property. When used with row-based objects, the form properties are most-often used with columns, and the reference Set Form_property item item# to value should probably be thought of as Set Form_property item column# to value.