Add and remove items in cycle/combobox



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 05/12/2004 at 05:09, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   8.100 
    Platform:   Windows  ;   
    Language(s) :     C++  ;

    ---------
    Hello,
    has anybody a code sample or any hint, how to add and remove items to a cycle/combobox? I tried a lot, but can't get it working.
    P.S.: I created the combobox in GetDDescription().
    Thanks for any help.
    Torsten



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 08/12/2004 at 01:22, xxxxxxxx wrote:

    Put them in the DESC_CYCLE subcontainer of the description.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 08/12/2004 at 01:50, xxxxxxxx wrote:

    Thank you Mikael.
    But i posted my question 2 weeks ago, tried everything, but can't get a solution. Maybe, i don't understand the usage of Subcontainers.
    I create my Combobox in GetDDescription
    ...
    BaseContainer unit = GetCustomDataTypeDefault(DTYPE_LONG);
    unit.SetString(DESC_NAME, "Active Object");
    unit.SetContainer(DESC_CYCLE, cycle);
    DescID descid(DescLevel(ACTIVEOBJECTINDEX, DTYPE_LONG, ID_OSCENE));
    if (!description->SetParameter(descid, unit, DescLevel(ID_OBJECTPROPERTIES)))
            return false;
    ...

    1. i tried to save "unit" for later use as a member variable, but it doesn't work.
    2. I tried to access the BaseContainer of my combobox, but what's the id of the container (descid ???)

    Thanks for all replies.
    Torsten



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 12/12/2004 at 09:19, xxxxxxxx wrote:

    I can access the combobox as Mikael said through DESC_CYCLE. But adding items doesn't work:

    void AddItems()
    {     AutoAlloc<Description> desc;
         if (!desc)
         {     return;
         }
         if(!((PluginObject* )this)->GetDescription(desc,0))
         {     return;
         }
         
         const BaseContainer *descbase = desc->GetParameterI(DescLevel(ACTIVEOBJECTINDEX),NULL);
         if(descbase )
         {     BaseContainer *combobox = descbase ->GetContainerInstance(DESC_CYCLE);
              if(combobox != NULL)
              {     GePrint("Container found");
                   //Container OK, now add items
                   combobox->SetString(10,"Test1");
                   combobox->SetString(11,"Test2");
                   
              }
         }
    }

    What's wrong?



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 12/12/2004 at 18:30, xxxxxxxx wrote:

    Howdy,

    Well, correct me if I'm wrong, but doesn't your code need to be inside MyPlugin::GetDDescription()?

    Adios,
    Cactus Dan



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 12/12/2004 at 22:49, xxxxxxxx wrote:

    I create the combobox in GetDDescription, but have to add items to the combobox later, during execution of the plugin.
    Maybe, that the only way to manipulate the combobox is in GetDDescription. Is that so?

    Torsten



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 13/12/2004 at 08:11, xxxxxxxx wrote:

    Howdy,

    Yes, I believe GetDDescription() is constantly called so your descriptions would be getting rebuilt all the time.

    Adios,
    Cactus Dan


Log in to reply