Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Get string value of combo box children

    SDK Help
    0
    3
    357
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      Helper
      last edited by

      On 25/10/2016 at 09:21, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:    
      Platform:      
      Language(s) :

      ---------
      I have a dynamic combo box that is filled with string values.

      For example:

      AddComboBox(MY_COMBOBUTTON, BFH_LEFT, 160) 
      AddChild(MY_COMBOBUTTON, CUBE, "Cube")      
      AddChild(MY_COMBOBUTTON, SPHERE, "Sphere" ) 
      Etc...

      How can I get the string value of for example the second child.
      In this case Sphere?

      GetString(MY_COMBOBUTTON) or GetString(SPHERE) just gives the numeric string value of the child.

      Of course I can do it by "redo" the dynamic fill, but I would think that there is a way to get the string value of the combo box child.

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        On 26/10/2016 at 03:10, xxxxxxxx wrote:

        Hi,

        it's not possible to get the strings from a ComboBox dialog gadget. Instead I'd go the other way round. Have an array or list with the strings to be used in the ComboBox and use the array index as ID of the children. Then you can simply use the value of the ComboBox to go back into your array and get your string.

        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          On 26/10/2016 at 04:16, xxxxxxxx wrote:

          Yes, that is what I am doing, but I thought I could use the storage of the combobox.

          Thanks, Pim

          1 Reply Last reply Reply Quote 0
          • First post
            Last post