On 11/09/2013 at 16:09, xxxxxxxx wrote:
Hi there Niklas,
I'm calling this from my tool plugin's SetDParameter() - so that when my cycle element changes it's id, an update is triggered on the userarea to redraw itself.
I thought it would have something to do with calling them on an instance, but the userarea is instanced in the icustomgui and not the tool plugin's class - so I couldn't work out how that was done. The customgui plugin itself is inserted via the tool's GetDDescription() using the customgui's plugin id. How do I make a call to the customgui element if the userarea is not instanced in the tool plugin's class itself?
// Registered customgui plugin:
class MyCustomUA : public GeUserArea
{
//functions etc..
}
class MyCustomGui : public iCustomGui
{
MyCustomUA MCU;
// functions etc.. including the following
void CustomGuiRedraw()
{
MCY.Redraw()
}
}
class MyCustomData : public CustomGuiData
{
// functions etc..
}
// Registered tool plugin:
class MyTool : public DescriptionToolData
{
// functions etc.. no instances to the customgui is used anywhere,
// the only reference to the customgui at all is in the description below
GetDDescription(doc, data, description, flags)
{
.....
cid = DescLevel(ID_HOME_GROUP_CUSTOMGUI, DTYPE_LONG, 0);
if(!id_Home || cid.IsPartOf(*id_Home,NULL))
{
BaseContainer bc = GetCustomDataTypeDefault(DTYPE_LONG);
bc.SetLong(DESC_CUSTOMGUI,ID_MY_CUSTOMGUI); // registered plugin
bc.SetBool(DESC_GROUPSCALEV, TRUE);
bc.SetBool(DESC_GUIOPEN, TRUE);
bc.SetLong(DESC_SCALEH, TRUE);
bc.SetString(DESC_NAME, "");
bc.SetString(DESC_SHORT_NAME, "");
if(!description->SetParameter(cid, bc, DescLevel(ID_HOME_GROUP_CUSTOMGUI_GROUP))) return TRUE;
}
return SUPER::GetDDescription(doc, data, description, flags);
}
}
WP.
P.s. on a slightly different note, I've been meaning to send you a PM sometime too regarding a topic here from some time a go. I'll try whizzing one over in the next few weeks, hope that is o.k.