On 09/05/2013 at 02:46, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R14
Platform:
Language(s) : C++ ;
---------
Hi,
i have a description resource with a cycle element, and i need to extend that cycle dynamically in my plugin code.
It's working well with the code below, but now i also want to add icons to the cycle items.
Does anybody know how to do this ?
I already tried to do it similarly to the AsyncDialog SDK-Example, but that one has a Dialog instead of a Resource file, so it's a little defferent and the method does not work in my case..
here's the code, the interesting part is in the for loop :
// get cycle-container from description
BaseContainer* bc = description->GetParameterI(CLONE_LAYER, NULL);
if(bc==NULL) return;
bc->SetParameter(DESC_NAME, GeData("Layer"));
BaseContainer layerCycle;
// add static cycle items
layerCycle.SetParameter(0L, GeData("none"));
layerCycle.SetParameter(1L, GeData("new parent layer"));
// add dynamic cycle items
LONG layerCounter = 2L;
for(unsigned int i=0;i<layerList.size();i++){
IconData layerIcon;
layerList[i]->GetIcon(&layerIcon);
layerCycle.SetParameter(i+2L,GeData(layerList[i]->GetName()+"&"+PtrToString(&layerIcon)+"&"));
// how to add an icon to this item ?
}
// put cycle back into the description
bc->SetParameter(DESC_CYCLE, GeData(layerCycle));
This is to be a layer picker that should always display all layers in the doc with their corresponding colors plus two additional options.
thanks,
Daniel