More than 2 elements in gui.ShowPopupDialog?



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

    On 18/03/2012 at 20:59, xxxxxxxx wrote:

    I am creating a popup dialog when a user clicks a bitmap button, and everything works fine. The only issue is that the popup will only show AT MOST two of my popup string items....what if I want 3...or 4...or 8?

    Is there some kind of limit to the number of items that you can show in a popup or is it a bug?

    myContainer=c4d.BaseContainer()
    myContainer.SetString(0, "Choose Layout&d&")
    myContainer.SetString(1, "Default Layout")
    myContainer.SetString(2, "Horizontal Layout")
    myContainer.SetString(3, "Vertical Layout")

    gui.ShowPopupDialog(myDialog(), myContainer, c4d.MOUSEPOS, 2, 6)

    Thanks!
    Marc



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

    On 18/03/2012 at 21:41, xxxxxxxx wrote:

    nevermind...found out that i had to put a "dummy" element in between the title and the first element...why? no clue...

    myContainer=c4d.BaseContainer(4)
    myContainer.SetString(0, "Choose Layout&d&")
    myContainer.SetString(1, "")
    myContainer.SetString(2, "Default Layout")
    myContainer.SetString(3, "Horizontal Layout")
    myContainer.SetString(4, "Vertical Layout")



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

    On 19/03/2012 at 07:46, xxxxxxxx wrote:

    The popup id#'s start at 900000.
    So your first one should start there.

    If you start them at 0. You'll run into problems:
    0 - Creates a separator
    1 - Sets the name of the menu: (used for submenus) : bc.SetString(1, "Menu name");

    Typically you should never start a container at 0 or 1. To avoid clashing with other ID#'s.

    -ScottA



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

    On 19/03/2012 at 07:58, xxxxxxxx wrote:

    Really? Well it would help if the SDK stated that :)

    The example they have shows their ID's starting at 0.

    Thanks Scott!



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

    On 19/03/2012 at 09:46, xxxxxxxx wrote:

    Let me re-phrase that to avoid any possible confusion.
    You can start from zero if you really want to. So technically the doc isn't wrong.
    But because zero and one are tied to a special menu type. You'll have to jump over them and start your popup entries at #2.
    That feels a bit odd and confusing to me because I'm used to dealing with arrays starting at zero.
    So I prefer to start them from something more obvious and zero based like 900000.

    This is what Yannick posted for me when I was working on a C++ popup project:
    -ID's in the range 1000 to 899999 inserts a C4D command: Example: bc.SetString(id, "CMD");
    -The ID's between 900000(FIRST_POPUP_ID) and 999999, can be used for your own menu items.

    The numbers between  900000 - 999999 can be used for any menu items. Not just the popup gui.
    So you don't have to start your popup from 900000 if you don't want to. That's just where the available block of ID's begins. And that's where I personally tend to start from.

    -ScottA



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

    On 19/03/2012 at 09:52, xxxxxxxx wrote:

    cool thanks for the clarification!


Log in to reply