[[Property:title|Type selector]]
[[Property:weight|4]]
[[Property:uuid|893343c2-417f-90c5-147e-941bc232fe43]]
The type selector contains all the available EiffelVision 2 types supported by EiffelBuild. These are the basic building blocks for your system.

[[Image:type-selector]]  

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 [[EiffelVision Introduction|EiffelVision 2]] . For example, looking at the screenshot above, the <eiffel>BUTTON</eiffel> item represents an <eiffel>EV_BUTTON</eiffel>, and the <eiffel>COMBO_BOX</eiffel> item represents <eiffel>EV_COMBO_BOX</eiffel>. 

{{note|The types available in the type selector are fixed, and cannot be modified. Almost all [[EiffelVision Introduction|EiffelVision 2]]  components are available. }}

==Creating a new object==
[[EiffelBuild Notation|Objects]]  are the building blocks used in EiffelBuild to construct your interface. To create a new [[EiffelBuild Notation|object]]  for use in your system, [[EiffelBuild Notation|pick]]  the type corresponding to the type of object you wish to create,and [[EiffelBuild Notation|drop]]  onto an [[EiffelBuild Notation|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 [[EiffelBuild Notation|drop]]  on it. <br/>

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

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

You may drop an object directly from the Type Selector into the [[Widget selector|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 [[EiffelVision Introduction|EiffelVision 2]]  library reference. }}

==Changing the type of an existing object==

Why would you want to change the type of an existing [[EiffelBuild Notation|object]] , when you could just delete it and create a new [[EiffelBuild Notation|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 <eiffel>EV_VERTICAL_BOX</eiffel> to be of type <eiffel>EV_HORIZONTAL_BOX</eiffel>. 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, [[EiffelBuild Notation|pick]]  the [[EiffelBuild Notation|object]]  that you wish to change, and [[EiffelBuild Notation|drop]]  it on an item in the type selector representing the desired new type. All existing children of the old [[EiffelBuild Notation|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 [[EiffelBuild Notation|object]]  must accept children of type corresponding to the new type. 
* The new type must be able to accept all of the existing [[EiffelBuild Notation|objects]]  children. 

{{seealso|<br/>
[[Layout constructor|Layout constructor]]  <br/>
}}




