08-27-2016, 07:44 PM
Still looking for a simple way to test for the existence of a menuGroup, I came up with this:
It works! Would you consider this a desirable workaround to avoid multiple menu group items?
Code:
uint32_t mGroupIndex = -1;
uint32_t mGrpCount = HDI_CORE_ILLUSTRATOR-> menuGroupCount();
std::auto_ptr<hdi::core::MenuGroup> thisGrp;
if (mGrpCount>0) {
for (int i = 1; i<mGrpCount; i++) {
thisGrp = HDI_CORE_ILLUSTRATOR->menuGroupAtIndex(i);
if (thisGrp->isPartial()) break;
if (thisGrp->text()=="About Some Plugins"){
AIMenuItemHandle aiHandle(thisGrp->aiMenuItemHandle());
AIMenuGroup aiGroup(thisGrp->aiMenuGroup());
this->__aboutMenuGroup = hdi::core::__accessCtor(aiGroup, aiHandle);
mGroupIndex = i;
break;
}
}
}
if (mGroupIndex<0) {
// create new __aboutMenuGroup
}
It works! Would you consider this a desirable workaround to avoid multiple menu group items?