ParameterEdit

Description: Draws an interface to allow the user to choose how to edit a parameter. Used in tag widgets.
Returns: Self
Usage: Steady State only.
Function Groups: Graphics, Variable
Related to: NumericParameterEdit | ParameterSet
Format: \ParameterEdit(ParmVal, ParmPtr, Enable, Title, Modules, Contexts, Parameters, TitleWidth, StartIndex, PtrWaitClose, DialogRoot[, FocusID, Description])
Parameters:  
ParmVal
The variable to be changed. Metadata indicating the revision number (always 0) must be attached.
ParmPtr
Code Pointer to the parameter value so the ParameterEdit modules can dissect and categorize it
Enable
Flag - TRUE to enable the drawing of this parameter edit module.
Title
Title for this parameter
Modules
Array of module names (snap-ins such as ParmEditColor, etc.) for parameter editing
Contexts
No longer used. Should be set to INVALID. Context is always Code.
Parameters
Parameters for the parameter edit modules. A multidimensional array, where each sub-array is a parameter list for each of the entries in the Modules array.
TitleWidth
Width allotted for the title. If Invalid, uses a standard size (160px).
StartIndex
Starting Index for Parm Edit Modules
PtrWaitClose
Set to true to tell caller to wait to close
DialogRoot
Calling dialog window
FocusID
Optional focus ID value from 0 to 32767 . Defaults to 1 if the control is enabled, otherwise 0. The parameter edit control will have two parts and thus use two ID values: the one specified (or the default) and one greater than that.
Description
Optional text, describing this parameter
Comments: Metadata indicating the version number must be added to the ParmVal parameter. For example,
{ Set up variables for ParameterEdit }
    MetaData(Value, "Revision") = 0;

Do not attempt to modify parameter values directly. Rather, set this to a copy of the Parms array value and then reassign this when updated. For example:

{ In the init state: } 
    MyPanelParm = MyOldPanelParm = Parms[#MyParm];

{ In the main panel: }
  ParameterEdit(MyPanelParm, ParmDefs[#MyParm], ...);
  If MyPanelParm != MyOldPanelParm || Valid(MyPanelParm) != Valid(MyOldPanelParm);
  [
    MyOldPanelParm = Parms[#MyParm] = RootValue(MyPanelParm);
  ]

Wrappers such as NumericParameterEdit exist to make this function easier to use. See: ParameterEdit Snap-ins

Example:

GUITransform(0, 1, 1, 0                      { Unit Outline               },
             1 - (Left)                      { Left Scaling               },
             Top + PickValid(Height, 0)      { Bottom Scaling             },
             Right                           { Right Scaling              },
             1 - (Top + TitleBarHeight)      { Top Scaling                },
             1                               { Overall Scaling            },
             0, 0                            { Trajectory, Rotation       },
             PickValid(DrawOptions, 1), 0    { Visibility, Reserved       },
             0, 0, 0                         { Selectability              },
             ParmEditObj = \ParameterEdit(
                             TextHAlign      { Parameter Value            },
                             CodePtr         { Pointer to Parm Code       },
                             PickValid(DrawOptions, 1) { Enable Flag      },
                             \GetPhrase(PickValid(ParmLabel, \HorizAlignmentLabel))
                                                                  { Title },
                             Modules         { Array of Parm Edit Modules },
                             Contexts        { Contexts for Edit Modules  },
                             Parameters      { Parameters for Edit Modules},
                             Invalid         { Title Width                },
                             Invalid         { Start Index                },
                             PtrWaitClose    { Wait to close              },
                             DialogRoot      { Calling dialog window       }
                           ));

ParameterEdit Snap ins