3.33 DM_GetValue
Using this function you can query attributes of DM objects. For the attributes which are allowed for the relevant object type please refer to the “Object Reference”.
DM_Boolean DML_default DM_EXPORT DM_GetValue
(
DM_ID objectID,
DM_Attribute attr,
DM_UInt index,
DM_Value *data,
DM_Options options
)
Parameters
-> DM_ID objectID
This parameter describes the object whose attribute you want to query.
-> DM_Attribute attr
This parameter describes the object attribute you want to query. All attributes permitted are defined in the file IDMuser.h.
-> DM_UInt index
This parameter is analyzed only in vector attributes of objects and describes the index of the desired object (e.g. text in listbox).
In this parameter you can query the attribute value. You should make sure that you read out the correct element out of this union. For the data type of each attribute please refer to the “Object Reference”.
-> DM_Options options
With this parameter you can control which form of texts are returned by DM, if the corresponding attribute is of the text-type. The following assignment is possible for this parameter:
Return Value
TRUE |
The object could be queried successfully. |
FALSE |
The attribute is not permitted for this object. |
Example
Querying the contents of an editable text in an object-callback function.
DM_Boolean DML_default DM_CALLBACK CheckFilename __1(
(DM_CallBackArgs *, data))
{
DM_Value value; /*structure for DM_GetValue*/
/* get current contents */
if (DM_GetValue(data->object, AT_content, 0, &value,
DMF_GetLocalString))
/* check the datatype */
if(value.type == DT_string)
See Also
Built-in function getvalue() in manual “Rule Language”