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
    • Recent
    • Tags
    • Users
    • Login

    ShowPopupDialog

    Scheduled Pinned Locked Moved PYTHON Development
    10 Posts 0 Posters 798 Views
    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 Offline
      Helper
      last edited by

      On 28/11/2013 at 11:01, xxxxxxxx wrote:

      Hey,

      I try to create a PopUp Menu like the default from cinema - with more menus around the mouse position

      i get a single menu item but can`t get a second menu item. has one a short example ?

      Thanks

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

        On 28/11/2013 at 13:42, xxxxxxxx wrote:

        post your code, there is an extensive example in the sdk under gui.ShowPopUpDialog()

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

          On 28/11/2013 at 13:53, xxxxxxxx wrote:

          i get a popup with one menu

          menu = c4d.BaseContainer()
            
          functionsmenu = c4d.BaseContainer()
          functionsmenu.SetString(1, 'men');
          functionsmenu2 = c4d.BaseContainer()
          functionsmenu2.SetString(1, 'men 2');
            
            
          menu.SetContainer(IDM_FUNCTIONSMENU, functionsmenu) 
          menu.SetContainer(IDM_GROUPMENU, functionsmenu2)      
            
          result = gui.ShowPopupDialog(cd=None, bc=menu, x=c4d.MOUSEPOS, y=c4d.MOUSEPOS, flags=c4d.POPUP_CENTERVERT|c4d.POPUP_EXECUTECOMMANDS)
            
          
          
          1 Reply Last reply Reply Quote 0
          • H Offline
            Helper
            last edited by

            On 28/11/2013 at 15:01, xxxxxxxx wrote:

            The documentation shows to use BaseContainer.InsData(), not any of the setter methods.

            Best,
            -Niklas

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

              On 28/11/2013 at 15:55, xxxxxxxx wrote:

              the example show it with SetStrings 
              [URL-REMOVED]#c4d.gui.ShowPopupDialog

              my problem is not to add a submenu - my problem is i like to add more than the one menu at the time - like the cinema default popup menu


              [URL-REMOVED] @maxon: This section contained a non-resolving link which has been removed.

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

                On 29/11/2013 at 04:10, xxxxxxxx wrote:

                your code is technically correct, on which c4d version are you ? for me the code does run just fine 
                in r14/15 . are you sure that your container ids are properly set / unique ?

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

                  On 29/11/2013 at 04:25, xxxxxxxx wrote:

                  i use R15 -

                  right is the menu i get - it work - but is not what i want 🙂

                  _<_img src="http://hantmade.com/wp-content/uploads/c4d_plugincafe.png" height="443" width="453" border="0" /_>_

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

                    On 29/11/2013 at 05:35, xxxxxxxx wrote:

                    hm,

                    I am not quite sure what you mean with 'what I want'. here is a small and recursive example 
                    building a menu tree.

                    import c4d
                    import random
                    from c4d import gui
                    #Welcome to the world of Python
                      
                      
                    def main() :
                        cid, menu =  getMenueContainer(c4d.FIRST_POPUP_ID, 0, 3, 8) 
                        result = gui.ShowPopupDialog(None, menu, c4d.MOUSEPOS, c4d.MOUSEPOS, 
                                                     c4d.POPUP_CENTERVERT|c4d.POPUP_EXECUTECOMMANDS)
                      
                    def getMenueContainer(cid, curdepth, maxdepth, maxitems, root = c4d.BaseContainer()) :
                        """
                        """
                        if curdepth <= maxdepth:
                            children = []
                            for i in xrange(random.randint(1, maxitems)) :
                                item = c4d.BaseContainer()
                                item.SetString(1, 'Item_{0}'.format(i))
                                cid, item = getMenueContainer(cid, curdepth + 1, maxdepth, maxitems, item)
                                cid += 1
                                root.SetContainer(cid, item)
                        return cid, root
                        
                      
                    if __name__=='__main__':
                        main()
                    
                    1 Reply Last reply Reply Quote 0
                    • H Offline
                      Helper
                      last edited by

                      On 29/11/2013 at 05:38, xxxxxxxx wrote:

                      Hey Littledevil,

                      thanks for that code - sorry for my bad description

                      I don`t mean to get a tree menu i like to get a menu with more than one menus - a round that mouse position - like the default popup menu in cinema (get it with "v")

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

                        On 29/11/2013 at 05:52, xxxxxxxx wrote:

                        Ah ok. You are talking about the pie menus. Unfortunately they are not exposed in python 
                        (and I think they aren't in cpp too). You would have to write your own system and open 
                        several borderless GeDialogs simultaneously and then render the 'button content' into these
                        dialogs with a GeUserArea (for example nikklas button thingy class). Has always been on my
                        'would be fun to do' list, but i never managed to get to it, so I am not sure if it is possible.

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