On 18/07/2017 at 05:41, xxxxxxxx wrote:
Hello and thank you very much for your help.
Here is what I did.
Description:
const DescID* single_id = description->GetSingleDescID();
DescID cid = DescID( DescLevel( USER_AREA_PARAM, DTYPE_LONG, 0 ) );
if ( !single_id || cid.IsPartOf(*single_id, NULL) ) {
BaseContainer settings = GetCustomDataTypeDefault(DTYPE_LONG);
settings.SetLong(DESC_CUSTOMGUI, USER_AREA_PLUGIN_ID);
settings.SetString(IMAGE_PATH_STRING, image_filename);
if (!description->SetParameter(cid, settings, DescLevel(GROUP_PARAM_ID))) {
return FALSE;
}
}
Property table and type:
static CustomProperty table_properties[] = {
{ CUSTOMTYPE_END, 0, 0 }
};
LONG table_type[] = {
DA_LONG
};
In iCustomGui Constructor:
image_path = settings.GetString(IMAGE_PATH_STRING);
In iCustomGui CreateLayout:
//AddUserArea
//AttachUserArea(user_area, ....);
user_area.setImagePath(image_path);
As it is right now, it works exactly as I want.
The problem is that since I have to load a new image based on the path, it happens constantly every time the layout is changed.
Can I use SetDParameter to set a value in IMAGE_PATH_STRING of USER_AREA_PARAM ?
It feels like I have to use a CustomDataType.
Thank you for your time !