Rogue Wave Views
Prototypes Package API Reference Guide
Product Documentation:

Rogue Wave Views
Documentation Home
List of all members | Public Member Functions
IlvAccessorDescriptor Class Reference

Accessor description. More...

#include <ilviews/protos/useracc.h>

Public Member Functions

 IlvAccessorDescriptor (IlvAccessorCategory=Miscellaneous)
 See below.
 
 IlvAccessorDescriptor (const char *description, IlvAccessorCategory category, IlUInt parameterCount, IlBoolean variableCount ...)
 Constructor. More...
 
 IlvAccessorDescriptor (const char *description, IlvAccessorCategory category, const char *label, IlvValueTypeClass **defaultType, IlUInt parameterCount, IlBoolean variableCount ...)
 Constructor. More...
 
 IlvAccessorDescriptor (const char *description, IlvAccessorCategory category, const char *label, IlBoolean defaultValues, IlvValueTypeClass **defaultType, IlUInt parameterCount, IlInt variableCount,...)
 Constructs a new accessor descriptor. More...
 
IlvAccessorCategory getCategory () const
 Returns the category of the accessor. More...
 
const char * getCategoryString () const
 Returns a string describing the accessor category. More...
 
virtual IlString makeLabel (const IlvUserAccessor *a) const
 Produces a string describing the effect of an accessor. More...
 

Detailed Description

Accessor description.

Library: ilvproto

The IlvAccessorDescriptor class is used to provide Studio with the information needed to edit the parameters of a subclass of IlvUserAccessor.

If you write your own subclasses of IlvUserAccessor to implement new actions to associate with prototypes, you must provide a subclass of IlvAccessorDescriptor for every new subclass of IlvUserAccessor. Moreover, the name of the IlvAccessorDescriptor subclass must match the name of the IlvUserAccessor subclass. For example, for an accessor class named IlvSampleAccessor, the corresponding accessor descriptor class must be called IlvSampleAccessorDescriptorClass.

Your accessor descriptor subclass must only include a constructor; there are no arguments. This constructor must call the IlvAccessorDescriptor constructor with the arguments that correspond to your accessor class.

The accessor descriptor subclass can be defined locally in the source file of a user accessor class. It is instantiated only once by the IlvRegisterUserAccessorClass macro.

See also
IlvAccessorParameter, IlvRegisterUserAccessorClass, IlvUserAccessor.

Constructor & Destructor Documentation

§ IlvAccessorDescriptor() [1/3]

IlvAccessorDescriptor::IlvAccessorDescriptor ( const char *  description,
IlvAccessorCategory  category,
IlUInt  parameterCount,
IlBoolean  variableCount ... 
)

Constructor.

See below.

§ IlvAccessorDescriptor() [2/3]

IlvAccessorDescriptor::IlvAccessorDescriptor ( const char *  description,
IlvAccessorCategory  category,
const char *  label,
IlvValueTypeClass **  defaultType,
IlUInt  parameterCount,
IlBoolean  variableCount ... 
)

Constructor.

See below.

§ IlvAccessorDescriptor() [3/3]

IlvAccessorDescriptor::IlvAccessorDescriptor ( const char *  description,
IlvAccessorCategory  category,
const char *  label,
IlBoolean  defaultValues,
IlvValueTypeClass **  defaultType,
IlUInt  parameterCount,
IlInt  variableCount,
  ... 
)

Constructs a new accessor descriptor.

Parameters
descriptionThe short descriptive text that appears in the Prototype Inspector help line.
categoryThe category of this new accessor.
labelThe string used to build the label of the accessor item in the Prototype Inspector tree gadget. This string can contain "%s" specifiers that will be replaced by the accessor parameters.
defaultValuesSpecifies whether the variable argument list of the constructor includes default values (see below).
defaultTypeSpecifies the default type of the accessor, which will be used to initialize the Type field of the Prototype Inspector. The default type can be NULL if the field must not be initialized.
parameterCountThe number of parameters described in the variable argument list of the constructor.
variableCountIf it is greater than zero, the accessor accepts a variable number of parameters. In this case, the last line of the matrix is validated when the Prototype Inspector creates a new line in the accessor parameter matrix, using the editing information of the previous line.

The remaining arguments are a sequence of couples (or triples if defaultValues is IlTrue) of the form <lab,type [,defaultVal]> . The lab parameter is the label that will appear in the first column of the accessor parameter matrix for this parameter. The type parameter specifies this parameter type, and is of type IlvAccessorParameter**. This parameter type is used by Studio to create an appropriate editing field in the second column of the parameter editing matrix in the Prototype Inspector. There are a number of predefined accessor parameter types that you can use for this argument (see the list further). defaultVal must be specified only if the defaultValues argument is IlTrue. In this case, defaultVal is a string used to initialize the parameter.

Member Function Documentation

§ getCategory()

IlvAccessorCategory IlvAccessorDescriptor::getCategory ( ) const

Returns the category of the accessor.

Returns
The category of the accessor.

§ getCategoryString()

const char* IlvAccessorDescriptor::getCategoryString ( ) const

Returns a string describing the accessor category.

The following global variables are predefined and you can pass their addresses as the argument type in the variable argument list of the constructor of IlvAccessorDescriptor. If none of these parameter types suit your needs, you will have to write your own subclass of IlvAccessorParameter, create an instance of that class, and provide the constructor of IlvAccessorDescriptor with the address of a pointer to this instance. If the accessor parameter can take a value from a known set of possible values, you can also create an instance of the IlvAccessorParameter base class and pass the possible values to the constructor.

§ makeLabel()

virtual IlString IlvAccessorDescriptor::makeLabel ( const IlvUserAccessor a) const
virtual

Produces a string describing the effect of an accessor.

This method can be overridden to produce more accurate descriptions of the effect of a given accessor in the group editor of Studio.

Parameters
aAccessor to describe.
Returns
A string describing the effect of the accessor.

© Copyright 2017, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.