On 05/09/2014 at 02:13, xxxxxxxx wrote:
Thanks for the advice.
However, I do not work because I do not fully understand.
Please advice a little more.
Bool GetDDescription(BaseDocument* doc, BaseContainer& data, Description* description, DESCFLAGS_DESC& flags)
{
DescID did = DescLevel( MDATA_ID, DTYPE_NONE, 0);
BaseContainer settings;
settings.SetInt32(DESC_CUSTOMGUI, CUSTOMGUI_BITMAPBUTTON);
settings.SetString(DESC_NAME, "My Button");
settings.SetBool(BITMAPBUTTON_BUTTON, true);
settings.SetInt32(DESC_GUIOPEN, true);
settings.SetBool(BITMAPBUTTON_BUTTON, true);
settings.SetBool(BITMAPBUTTON_TOGGLE, true);
settings.SetInt32(BITMAPBUTTON_ICONID1, ICON_ID1);
settings.SetInt32(BITMAPBUTTON_ICONID2, ICON_ID2);
if (!description->SetParameter(did,settings,DescLevel(MDATA_G))) return false;
flags |= DESCFLAGS_DESC_LOADED|DESCFLAGS_DESC_RECURSIONLOCK;
return ToolData::GetDDescription(doc, data, description, flags);
}
Bool Message(BaseDocument* doc, BaseContainer& data, Int32 type, void* t_data)
{
switch(type)
{
case MSG_DESCRIPTION_COMMAND:
{
DescriptionCommand *dc = (DescriptionCommand* ) t_data;
switch(dc->id[0].id)
{
case ICON_ID1:
// do something here...
break;
}
}
break;
}
}
Bool SetDParameter(BaseDocument* doc, BaseContainer& data, const DescID& id, const GeData& t_data, DESCFLAGS_SET& flags)
{
int Command = id[0].id;
if(Command == ICON_ID1)
{
// do something here...
}
return SUPER::SetDParameter(doc, data, id, t_data, flags);
}