Parameter Block Flags

The following are the block/descriptor flags. One or more flags may be OR'd together as in P_AUTO_CONSTRUCT | P_AUTO_UI.

P_VERSION - Indicates that a version number is expected immediately after the flags field, before the reference number field. This version number will be stored as type ParamBlockDesc2::version and returned as a IParamBlock2::GetVersion().

P_CLASS_PARAMS - Indicates this block holds class-level parameters which are attached to the ClassDesc2 for the plug-in. Such class level parameters are shared by each instance of the class. The block is automatically allocated by and stored in the descriptor. You get at its parameters via GetValue()/SetValue() calls on the descriptor.

P_AUTO_CONSTRUCT - Indicates the parameter block2 will be constructed and referenced automatically to its owner in the call to ClassDesc2::MakeAutoParamBlocks(). If this flag is set, the parameter block's reference number in the owning object should be given immediately following the flag word in the descriptor constructor. See <auto_construct_block_refno> .

P_AUTO_UI - Indicates this block supports automatic UI rollout management in calls to ClassDesc2::BeginEditParams(), ClassDesc2::EndEditParams(),ClassDesc2::CreateParamDlg(), ClassDesc2::CreateParamDialog(), etc.

If set, the <auto_ui_parammap_specs> must be supplied in the descriptor constructor.

P_HASCATEGORY - The category field that can be used to order rollups (see Class IRollupWindow) to various Parameter Map creation methods. In order to use the category field with AutoUI, this flag has to be declared together with P_AUTO_UI in the ParamBlockDesc2. An additional int, that describes the category has to be appended to the parameter list after the ParamMap2UserDlgProc* proc parameter. The same thing is true for multimaps. The P_HASCATEGORY field can only be declared for the whole pblock. That means, that every multimap has to have the category parameter. To use the standard value ROLLUP_CAT_STANDARD can be used. In the example below 4900 is used as the integer describing the category;

static  ParamBlockDesc2 std2_shader_blk ( std2_shader,
_M("shaderParameters"), 0, &stdmtl2CD,
P_AUTO_CONSTRUCT + P_AUTO_UI + P_HASCATEGORY, SHADER_PB_REF,
//rollout
IDD_DMTL_SHADER4, IDS_KE_SHADER, 0, 0, &shaderDlgProc, 4900,
// params
std2_shader_type, _M("shaderType"), TYPE_INT, 0, IDS_JW_SHADERTYPE,

P_USE_PARAMS - Indicates that this block shares (exactly) the parameter definitions from another descriptor. This is used to specify an already established ParamBlockDesc2 instance whose parameters you wish to share. This effectively gives the referring descriptor a pointer to the established descriptors parameter definitions array. In this case no other parameters definition can be supplied to referencing descriptors constructor.

P_INCLUDE_PARAMS - Indicates that this block loads in a copy the parameter definitions from another descriptor. This is used to take a copy of an already established descriptor's parameters, to which you can add extra parameter definitions in the referencing descriptors constructor. This provides a method to reuse common parameters, but note it is a copy; any subsequent changes to the referenced descriptor's parameter definitions are not reflected in the referencing descriptor.

You give the pointer to the ParamBlockDesc2 supplying the existing parameter definitions following the other optional block-level parameters: following the flag word is the block's reference number if P_AUTO_CONSTRUCT is specified, then the rollout dialog template info if P_AUTO_UI is specified, then the pointer to the sourcing descriptor if P_USE_PARAMS or P_INCLUDE_PARAMS is specified. For example:

static  ParamBlockDesc2 metal2_param_blk ( shdr_params, _M("shaderParameters"), 0, &metalCD, P_AUTO_CONSTRUCT + P_USE_PARAMS,
// pblock refno 0,
// use params from existing descriptor
&const_param_blk
);

P_SCRIPTED_CLASS - This is for internal use only. It means that the descriptor was defined on the fly as a side-effect of writing a scripted plug-in.

P_TEMPORARY - This is for internal use only.

P_TEMPLATE_UI - This indicates that dialog templates will be provided or constructed.

P_CALLSETS_ON_LOAD - Signals that this block should have IParamBlock2::CallSets() called on it during post-load processing on scene loads &merges. This effectively ensures that all PBAccessor::Set() methods will be called after the flagged parameter block is fullyloaded, so that they can track loaded parameter values, forexample. This allows a single point for parameter value tracking inthe PBAccessor::Set() and precludes the need for individual objects to implementparameter load callbacks to do this tracking themselves. P_MULTIMAP - Indicates that the block being described will have more than onerollup/map. If you specify this flag, the constructor interpretsthe rollup template and parameter definitions arguments in amodified syntax. For more information see the topic Using Multiple Roll-ups.