ScrollGroupBegin: Just first element is shown



  • 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



  • 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()
      
    
    


  • 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.


Log in to reply