[[Property:title|Object editor]]
[[Property:weight|5]]
[[Property:uuid|f00025e2-f39b-d0a2-9b2b-207768771905]]
An object editor is a tool which allows you to edit the properties of a selected [[EiffelBuild Notation|object]] . Common properties include minimum width and height, color, text etc. 

An object editor can only reference one [[EiffelBuild Notation|object]]  at once, and when not empty, it is considered to be "targeted" to the [[EiffelBuild Notation|object]]  whose properties it references. 

[[Image:object-editor]]  

The screenshot above shows a floating object editor. The docked object editor is almost identical except that it is located within the EiffelBuild main window.

==Docked object editor==

The docked object editor is displayed to the right hand side of the EiffelBuild main window. This editor is always displayed and is permanently linked to the [[Layout constructor| layout constructor]] . This means that whenever the selected [[EiffelBuild Notation|object]]  changes in the [[Layout constructor| layout constructor]] , the docked object editor becomes targeted to this [[EiffelBuild Notation|object]] . 

==Floating object editors==

These object editors appear in their own window, and you may open as many of these as you wish.

To open a new floating object editor, [[EiffelBuild Notation|drop]]  an [[EiffelBuild Notation|object]]  on  [[Image:icon-object-editor-color]] , displayed in the [[Main toolbar| main toolbar]]  and also in each existing object editor. The new object editor will then be targeted to the [[EiffelBuild Notation|object]]  that was [[EiffelBuild Notation|dropped]] . 

{{note|If the [[EiffelBuild Notation|object]]  targeted to floating object editor is deleted, then the editor will be destroyed. This helps stop the screen becoming cluttered with empty editors. }}

As a shortcut to a complete [[EiffelBuild Notation|pick and drop]]  transport, you may hold down the Ctrl key while starting the [[EiffelBuild Notation|pick]] , which will immediately open a new floating object editor targeted to the [[EiffelBuild Notation|object]]  you clicked. 

==General use==

When an object editor is targeted to an [[EiffelBuild Notation|object]] , you will see that controls are available within the editor to customize that [[EiffelBuild Notation|object]] . Although every different type of [[EiffelBuild Notation|object]]  will have different sets of properties that may be modified, the manipulation of these properties is as standardized as possible. Below are some general rules that apply: 
* String properties inputted via a text field are updated within the object every time a key is pressed
* Integer properties inputted via a text field are only updated within the object when return is pressed, or the input box looses the focus.
* Almost without exception, a push button which controls a property, will open up a dialog, allowing the property to be edited. Examples are colors, pixmaps and events.
* If when you attempt to modify a property, it returns back to its original value, it means that the value you attempted to enter was invalid. For example, looking at the screen show above, if you enter -50 into the minimum_height text field and press return, it will revert back to 23. This is because the minimum_height of an <eiffel>EV_BUTTON</eiffel> may not be set to less than 0. To find allowable values for properties of an [[EiffelBuild Notation|object]] , consult the [[EiffelVision Introduction|EiffelVision 2]]  documentation. 

All properties that may be manipulated in an object editor correspond directly to a property of the [[EiffelVision Introduction|EiffelVision 2]]  control that is represented by the [[EiffelBuild Notation|object]]  (Displayed in an object editor as '''type'''). There is one exception to that rule though, and that is the '''Name''' field which is specific to EiffelBuild. This field is used for your identification of the [[EiffelBuild Notation|object]]  and as the attribute name in the generated code. For example, when EiffelBuild generates code corresponding to the [[EiffelBuild Notation|object]] targeted in the editor shown above, it would declare the EiffelVision 2 component as - button1: EV_BUTTON 

{{note|You may have as many object editors targeted to the same [[EiffelBuild Notation|object]]  as you wish. Whenever a change is made to the [[EiffelBuild Notation|object]]  through one of the editors, all other editors targeted to that [[EiffelBuild Notation|object]]  are synchronized. }}

==Using Constants==

All fields that may use constants have a button marked with the constants symbol  [[Image:icon-format-onces-color]] , which when selected, modifies the field to allow selection of the desired constant. A combo box is displayed with all valid constants (matching the type of the property) displayed, from which you may select the constant you wish to use. To remove the use of the constant, simply press the constants button again, which removes the constant, and sets the property to a manifest value representing the previous value of the last selected constant.

==Advanced property manipulation==

Although many of the properties of [[EiffelBuild Notation|objects]]  are relatively simple, and can be manipulated with <eiffel>STRING</eiffel> or <eiffel>INTEGER</eiffel> values, there are others that require more complicated control mechanisms. The following [[EiffelBuild Notation|object]]  properties have more complicated interfaces warranting further explanation: 
*  [[Merging radio button groups]]  
*  [[Positioning table children]]  
*  [[Positioning fixed children]]  

For all "top level" objects (those contained within the [[Widget selector|widget selector]]  which are to be generated as individual classes), a check button marked "Generate as client" is available towards the top of the Object Editor. If this is checked, the generated class uses the widget type of the object as a client, otherwise it inherits directly from the widget's class.
<span id="events"></span> 
==Event connection==

As well as being able to manipulate the standard properties of an [[EiffelBuild Notation|object]] , facilities are provided for connecting to the events of an [[EiffelBuild Notation|object]] . Looking at the object editor screenshot above, you will see that there is a button marked '''Select events''' which is also available in all targeted editors. 

{{note|The button will be marked '''Modify events''' when one or more events are already selected for the current [[EiffelBuild Notation|object]] . }}

Clicking this button will cause the following dialog to be displayed:

[[Image:event-selection-dialog]]  

Looking at the screenshot above, you will see that this dialog contains all the action_sequences available for the <eiffel>EV_BUTTON</eiffel> to which the object editor is targeted.

If you check a button connected with one of the action sequences, you will be then able to enter the name of a feature that you wish to connect to the action sequence. The screenshot above shows the user has connected a feature named `button_pressed' to the `select_actions'. When [[EiffelBuild: Code Generation|code is generated]] , this will cause EiffelBuild to generate an empty feature named `button_pressed' already connected to the `select_actions' of the button. 

{{note|You will only be allowed to enter valid and unique Eiffel feature names. If a name is invalid, it will be highlighted in red, and a dialog will warn you when you attempt to close the dialog. }}

{{seealso|<br/>
[[Create an object|Create an object]]  <br/>
[[Delete an object|Delete an object]]  }}




