I have created a custom GUI which I am using in the Attribute Manager.
No problems there.
I am registering the custom gadget using following piece of code:
Bool RegisterMyGadgetDataTypeGui()
{
static BaseCustomGuiLib myMyGadgetGUIlib;
ClearMem(&myMyGadgetGUIlib, sizeof(myMyGadgetGUIlib));
FillBaseCustomGui(myMyGadgetGUIlib);
// register the custom gadget as version 1.0.0.0 (= 1000)
if (!InstallLibrary(MYGADGET_CUSTOMGUI_PLUGINID, &myMyGadgetGUIlib, 1000, sizeof(myMyGadgetGUIlib)))
return false;
if (!RegisterCustomGuiPlugin(GeLoadString(IDS_MYGADGETCUSTOMGUISTRING), 0, NewObjClear(MyGadgetCustomGUI)))
return false;
return true;
}
Now, I was wondering, since this is registered inside a plugin, what if I want to reuse this gadget in a different plugin project?
Do I simply copy over the source code for this gadget and perform the same registration call, using the same pluginID?
I understand that MyGadgetCustomGUI - which is derived from CustomGuiData
- only needs to be registered once in a Cinema 4D session. But how to know if one or more plugins are installed which want to use the same custom GUI, and thus only one of these plugins should register the custom GUI?
Is there a manual, or detailed documentation available discussing this topic?
I did a search on "library" and all I could find was IsLibraryInstalled(Int32 id)
, which makes me assume I should check in every plugin for the particular custom GUI library, and only install the library of not already installed. But then? Should I still perform the RegisterCustomGuiPlugin
for this custom gadget, in every plugin?