Skip to content

gmSCControlDataClass

The service class ControlData accesses information about controls which was compiled from the property bag specifications in the various form files.


Prototype

int ControlData_FindObjects(int iRoot,tObjInfo* objInfo,int maxObjects);

The ControlData_FindObjects method scans all symbols within the scope of a specified parent and returns information about each interface, or control, object found in an array of tObjInfo structure entries. This structure has the following members:

MemberDescription
levelSpecifies the nesting level of the control relative to the initial parent
rootSpecifies the root offset of the control in its storage area.
typeSpecifies the object type of the control.
countSpecifies the number of collection members in the control.
resourcealways set to zero here.

The parameters of the method are as follows:

ParameterDescription
iRootSpecifies the root offset of the parent of the controls to be found.
objInfoReceives the tObjInfo records for each control found in the order in which
they are found.
maxObjectsSpecifies the maximum number of entries allowed in the objInfo parameter.

This method returns the number of interface objects found.


Prototype

int ControlData_FindProperty(int ctlType,char* propName,int iCode);

The ControlData_FindProperty method locates an assignment value for a property specified via its control type code and property identifier. Its parameters are:

ParameterDescription
ctlTypeSpecifies the type of the control whose property value is to be found. It is either
an opcode value or the root offset of a control class or coclass.
propNameis the name of the property. This is either a subcode name of the opcode or the
name of a property in the scope of the class or coclass. It is in null-terminated
form.
iCodeis the starting offset in the global code block where the search for the assignment
should begin.

If the property is recognized and if an assignment to that property is present then its code starting offset is returned; else zero is returned.


Prototype

int ControlData_GetFontSize(int iCode,int inXml,char* value);

The ControlData_GetFontSize method returns the string value of a Font Size property whose assignment value code starting offset is specified. Its parameters are:

ParameterDescription
iCodeSpecifies the starting offset in the global code block of the right-hand-side of an
assignment to the font size property. This will typically be determined by the
method ControlData_FindProperty.
inXmlSpecifies how the result is to be determined. If zero, the result string is simply
the return value from ControlData_GetProperty whose size units are in
Points. In XML, all sizes are in logical Pixels — i.e., 72 points/inch
versus 96 pixels/inch for scaling used in Xml
valueReceives the string representation derived from the right-hand-side code, in null
terminated form, as modified for use in Xml contexts.

The method returns the length of the result.


Prototype

int ControlData_GetProperty(int iCode,int inXml,char* value);

The ControlData_GetProperty method returns the string value of a property whose assignment value code starting offset is specified. Optionally, the value string is modified to make it usable within Xml text. Its parameters are:

PropertyDescription
iCodeSpecifies the starting offset in the global code block of the right-hand-side of an
assignment to the desired property. This will typically be determined by the method
ControlData_FindProperty.
inXmlSpecifies if the value is to be modified. If it is nonzero, then any quote
characters or less than characters in value string will be replaced by """ or
”<” respectively.
valueReceives the authored value string derived from the right-hand-side code, in null
terminated form. The standard code authoring method is used to produce this string.

The method returns the length of the result string.


Prototype

int ControlData_GetValue(int iCode);

The ControlData_GetValue method returns the integer value of a property whose assignment value code starting offset is specified. Its parameter is:

ParameterDescription
iCodeSpecifies the starting offset in the global code block of the right-hand-side of an
assignment to the desired property. This will typically be determined by the method
ControlData_FindProperty.

If the property value is numeric or an enumeration entry, then its integer value is returned; else a zero is returned.


Prototype

int ControlData_LoadCode(int ctlRoot,int cmpOnly);

The ControlData_LoadCode method loads the property code vector associated with a control instance into the next available bytes of global code storage and returns the offset of the starting byte. Its parameters are:

ParameterDescription
ctlRootSpecifies the root offset of the control whose code vector is to be accessed.
cmpOnlySpecifies what code is to be used. If nonzero, the original compiled code only
should be used, not the modified analysed code.

If the control has no code vector associated with it of the requested type, then a zero is returned; else its starting offset is returned. Note that when the code vector is no longer needed the user must reset the global code vector size back to this value.


Prototype

int ControlData_ReplaceValue(int iCode,int opc,int subc);

The ControlData_ReplaceValue method replaces the value of a property whose value code starting offset is specified. Its parameters are as follows:

ParameterDescription
iCodeSpecifies the offset in the global code block of the value code to be replaced.
opcSpecifies the opcode of the replacement value.
subcSpecifies the subcode value of the replacement.

There is no requirement that the size of the replacement code be the same as the size of the original code; therefore, the method returns the final size of the global code block.


Prototype

void ControlData_SaveCode(int ctlRoot,int iStart);

The ControlData_SaveCode method saves the current code block associated with a control instance in the compiled code area of that control. Its parameters are as follows:

ParameterDescription
ctlRootSpecifies the root offset of the control whose code vector is to be saved.
iStartSpecifies the start in the global code block of the code to be saved.

The method has no return value.