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

    LayoutFlushGroup with TabGroups and ScrollGroups

    Scheduled Pinned Locked Moved PYTHON Development
    3 Posts 0 Posters 519 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 05/12/2017 at 06:02, xxxxxxxx wrote:

      Hey guys,

      I've come across this weird behaviour, when dealing with LayoutFlushGroup in conjunction with TabGroups and ScrollGroups..

      Please have a look at my gif + the stripped down code.
      Obviously I am doing something wrong... any ideas? Confused

      https://www.dropbox.com/s/y2atcony081ftow/LayoutFlushProblem.py?dl=0

      Thanks & Cheers,
      Lasse

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

        On 05/12/2017 at 06:26, xxxxxxxx wrote:

        You have to make another group inside the ScrollGroupBegin and flush this one
        Which would give us

        import c4d
        from c4d import gui
        #Welcome to the world of Python
         
        class Localizer_Dialog(gui.GeDialog) :
            def CreateLayout(self) :
                self.SetTitle("Title")
                # Menu
                self.MenuFlushAll()
                self.MenuSubBegin("Info..")
                self.MenuSubEnd()
                self.MenuFinished()
                 
                if self.GroupBegin(0, c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT, 0, 0, "") :
                    if self.TabGroupBegin(1, c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT, c4d.TAB_TABS) :
                        if self.GroupBegin(2, c4d.BFH_SCALEFIT, 3, 0, "Textures") :
                            if self.ScrollGroupBegin(3, c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT, c4d.SCROLLGROUP_VERT | c4d.SCROLLGROUP_HORIZ) :
                                if self.GroupBegin(4, c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT, 0, 0, "") :
                                    self.AddStaticText(100, c4d.BFH_CENTER, 0, 0, "INTITALI")
                                    
                                    self.GroupEnd()#0
                                self.GroupEnd()#0
                            self.GroupEnd()#1
                        self.GroupEnd()#2
                    self.GroupEnd()#3
                 
                return True
             
            def InitValues(self) :
         
                self.LayoutFlushGroup(4)
                self.AddStaticText(101, c4d.BFH_CENTER, 0, 0, "FLUSHED")
                self.LayoutChanged(4)
         
                return True
         
        def main() :
            dialog = Localizer_Dialog()
            dialog.Open(dlgtype=c4d.DLG_TYPE_ASYNC,pluginid=12345678,xpos=1000,ypos=500,defaultw=500,defaulth=250)
         
        if __name__=='__main__':
            main()
        
        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          On 05/12/2017 at 09:28, xxxxxxxx wrote:

          Thanks for the quick answer gr4ph0s!
          I think i tried that before asking, but nonetheless.. that did the trick!!

          Thanks !

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