Gadgets > Creating GUI Applications with Rogue Wave Views Studio > Using Inspector Classes > Components of an Inspector Panel > Editors
 
Editors
Editors are objects of the type IlvStIEditor used to edit inspected values.
Editors Associated with Accessors
In most cases, the value to be inspected is directly retrieved by its accessor and is then modified via the associated editor graphically represented by a gadget.
Here is a list of the gadget classes that can be associated with an editor:
*IlvTextField
*IlvNumberField
*IlvToggle
*IlvStringList
*IlvOptionMenu
*IlvScrolledComboBox
*IlvSelector
*IlvSpinBox
There is one class of editor for each one of the gadget classes enumerated above. These editor classes are encapsulated in the class IlvStIDefaultEditorBuilder, a subclass of IlvStIEditor, and are therefore transparent for the user. If you want to create an editor and associate it with a gadget, you have to build an instance of the class IlvStIDefaultEditorBuilder and provide it with the name of the gadget that you want to attach to it. When this instance is initialized, it creates an editor that corresponds to the type of the specified gadget. The created editor is managed as a child editor of the IlvStIDefaultEditorBuilder instance.
In the following example, we have an accessor, represented by the floatAccessor variable, that is used to inspect the float mode of a number field. Here is how you would create an editor and associate it with this accessor to handle a toggle named "floatToggle" in an inspector panel.
IlvStIEditor* editor =
new IlvStIDefaultEditorBuilder("floatToggle”, floatAccessor);
addEditor(editor);
Editors Not Associated with Accessors
In certain rare cases, inspected values can be so complex that they cannot be handled by an IlvStIPropertyAccessor object. It would be easier, for example, to fetch an array of values directly from the inspected object and place it in a matrix rather than going through an IlvStIPropertyAccessor and trying to fit the value array in an IlvStIProperty object. In this case, you have to derive a class from IlvStIEditor and redefine the following virtual methods:
*virtual IlBoolean initialize() = 0;
*virtual IlBoolean apply() = 0;
*virtual IlBoolean connectHolder(IlvGraphicHolder* holder);
*virtual IlBoolean isModified() const;
*virtual void setModified(IlBoolean = IlTrue);
For more information about these methods, see the Rogue Wave Views Studio Reference Manual.
Instances of these derived editors are added to an inspector panel like any other editors by calling the method IlvStIEditorSet::addEditor.

Version 6.0
Copyright © 2015, Rogue Wave Software, Inc. All Rights Reserved.