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

    ScrollGroupBegin: Just first element is shown

    Scheduled Pinned Locked Moved PYTHON Development
    3 Posts 0 Posters 458 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 27/04/2017 at 02:42, xxxxxxxx wrote:

      Hey all,

      Id like to create a scroll group with multiple items.

      class Dlg(gui.GeDialog) :  
        def CreateLayout(self) :  
            self.ScrollGroupBegin(200, c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT, c4d.SCROLLGROUP_HORIZ | c4d.SCROLLGROUP_VERT)  
            self.AddCheckbox(201, c4d.BFH_SCALEFIT | c4d.BFV_TOP, initw=200, inith=0, name="AAAAAA")  
            self.AddCheckbox(202, c4d.BFH_SCALEFIT, initw=200, inith=0, name="BBBBBB")  
            self.AddCheckbox(203, c4d.BFH_SCALEFIT, initw=200, inith=0, name="CCCCCC")  
            self.GroupEnd()  
            return True  
        
      class Name(plugins.CommandData) :  
        dialog = None  
        def Execute(self, doc) :  
            if self.dialog is None: self.dialog = Dlg()  
            return self.dialog.Open(dlgtype=c4d.DLG_TYPE_ASYNC, pluginid=PLUGIN_ID, defaultw=100, defaulth=100)  
        def RestoreLayout(self, sec_ref) :  
            if self.dialog is None: self.dialog = Dlg()  
            return self.dialog.Restore(pluginid=PLUGIN_ID, secret=sec_ref)  
        
      if __name__ == "__main__":  
         bmp = bitmaps.BaseBitmap()  
         dir, f = os.path.split(__file__)  
         fn = os.path.join(dir, "res", "icon.tif")  
         bmp.InitWith(fn)  
         plugins.RegisterCommandPlugin(id=PLUGIN_ID,   
                                      str="Name",  
                                      info=0,  
                                      help="Name",   
                                      dat=Name(),  
                                      icon=bmp)
      

      But there is just the first item shown in window.
      What Im doing wrong?

      Greetings
      rownn

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

        On 27/04/2017 at 02:56, xxxxxxxx wrote:

        You have to make another group inside it.
        So like that the scroll group will affect all items present in this group

          
        import c4d
          
        class Dlg(c4d.gui.GeDialog) :
            def CreateLayout(self) :
                if self.ScrollGroupBegin(200, c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT, c4d.SCROLLGROUP_HORIZ | c4d.SCROLLGROUP_VERT) :
                    if self.GroupBegin(201,  c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT, initw=200, inith=100) :
                        self.AddCheckbox(202, c4d.BFH_SCALEFIT | c4d.BFV_TOP, initw=200, inith=0, name="AAAAAA")
                        self.AddCheckbox(203, c4d.BFH_SCALEFIT, initw=200, inith=0, name="BBBBBB")
                        self.AddCheckbox(204, c4d.BFH_SCALEFIT, initw=200, inith=0, name="CCCCCC")
                    self.GroupEnd()
                self.GroupEnd()
                return True
          
          
        def main() :
            dialog = Dlg()
            dialog.Open(dlgtype=c4d.DLG_TYPE_MODAL_RESIZEABLE)
          
        if __name__=='__main__':
            main()
          
        
        
        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          On 28/04/2017 at 04:35, xxxxxxxx wrote:

          One more thread down, gr4ph0s 🙂

          Just want to add a few links to the C++ side of things for future readers, maybe useful for Python developers as well:
          In GeDialog manual this peculiarity of ScrollGroups is explicitly mentioned (not telling this to say "you should have known before", really not).
          In C++ SDK examples gedialog_gadgets.cpp also contains an example on how to use ScrollGroups.

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