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:
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 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.
Published date: 05/24/2022
Last modified date: 02/24/2022