| Online Eiffel Documentation

EiffelStudio

# Type selector

The type selector contains all the available Vision2 types supported by EiffelBuild. These are the basic building blocks for your system.

The types are organized into three groups - Primitives, Containers and Items. All types that may be used in EiffelBuild have a text in uppercase, corresponding to their type in EiffelVision2. For example, looking at the screenshot above, the BUTTON item represents an EV_BUTTON, and the EV_COMBO_BOX item represents EV_COMBO_BOX.

Note: The types available in the type selector are fixed, and cannot be modified. Almost all EiffelVision2 components are available.

## Creating a new object

Objects are the building blocks used in EiffelBuild to construct your interface. To create a new object for use in your system, pick the type corresponding to the type of object you wish to create,and drop onto an object representation. If an object is full, or does not allow other objects of the new type to be contained, then you will not be able to drop on it.

For example, if you have just started a new project, pick HORIZONTAL_BOX from the type selector, and drop it on the EV_TITLED_WINDOW object displayed in the layout constructor. This will build you a new object of type EV_HORIZONTAL_BOX, parented in the window. If you then pick a BUTTON from the type selector, you will not be able to drop it on the EV_TITLED_WINDOW, as a window may only contain one child and is therefore currently full. You may however, drop on the EV_HORIZONTAL_BOX object you had just created, as the box is empty, and has space for multiple children. Doing so, will create a new objectof type EV_BUTTON, parented in the box.

This shows how simple it is to Build new objects in EiffelBuild, you just need access to the parent object to drop the selected type into.

You may drop an object directly from the Type Selector into the widget selector which creates the object as a "top level object" ensuring that upon generation, it is represented by an individual set of classes. These top level objects may then be re-used within your interface as desired.

Note: To understand the types accepted, and the capacity of objects, you should consult the EiffelVision2 library reference.

## Changing the type of an existing object

Why would you want to change the type of an existing object, when you could just delete it and create a new object?

Imagine you have spent some time constructing a complicated interface. You have an EV_VERTICAL_BOX with children many levels deep. You realize that you wanted the EV_VERTICAL_BOX to be of type EV_HORIZONTAL_BOX. If you delete the object, all children contained will also be deleted, which in this case, is not what you want. Changing the type of the object does actually delete the object internally, but will automatically re-parent all of its children into the new object.

To perform a type change, pick the object that you wish to change, and drop it on an item in the type selector representing the desired new type. All existing children of the old object will be automatically re-parented in the new object.

The following rules govern if the type of an existing object may be changed to a new type:

- The parent of the existing object must accept children of type corresponding to the new type.
- The new type must be able to accept all of the existing objects children.

See Also
Layout constructor