The ControlData Service Class
The service class
ControlData accesses information about controls which was compiled from the property bag specifications in the various form files.
The method ControlData_FindObjects
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
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:
Member | Description |
level | Specifies the nesting level of the control relative to the initial parent |
root | Specifies the root offset of the control in its storage area. |
type | Specifies the object type of the control. |
count | Specifies the number of collection members in the control. |
resource | always set to zero here. |
The parameters of the method are as follows:
Parameter | Description |
iRoot | Specifies the root offset of the parent of the controls to be found. |
objInfo | Receives the tObjInfo records for each control found in the order in which they are found. |
maxObjects | Specifies the maximum number of entries allowed in the objInfo parameter. |
This method returns the number of interface objects found.
The method ControlData_FindProperty
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
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:
Parameter | Description |
ctlType | Specifies 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. |
propName | is 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. |
iCode | is 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.
The method ControlData_GetFontSize
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
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:
Parameter | Description |
iCode | Specifies 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. |
inXml | Specifies 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 |
value | Receives 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.
The method ControlData_GetProperty
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
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:
Property | Description |
iCode | Specifies 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. |
inXml | Specifies 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. |
value | Receives 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.
The method ControlData_GetValue
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
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:
Parameter | Description |
iCode | Specifies 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.
The method ControlData_LoadCode
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
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:
Parameter | Description |
ctlRoot | Specifies the root offset of the control whose code vector is to be accessed. |
cmpOnly | Specifies 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.
The method ControlData_ReplaceValue
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
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:
Parameter | Description |
iCode | Specifies the offset in the global code block of the value code to be replaced. |
opc | Specifies the opcode of the replacement value. |
subc | Specifies 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.
The method ControlData_SaveCode
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
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:
Parameter | Description |
ctlRoot | Specifies the root offset of the control whose code vector is to be saved. |
iStart | Specifies the start in the global code block of the code to be saved. |
The method has no return value.