TabGroup individual size



  • On 17/12/2016 at 16:58, xxxxxxxx wrote:

    All groups in a tabGroup are sized to the max size of each tab.
    For exemple if tab A got 3 elements and the tab B got 1 elements, you will have extra space in the tab B for matching the size of tab A. Is there a way to remove this extra size?

    Thanks in advance !



  • On 19/12/2016 at 09:17, xxxxxxxx wrote:

    Hi,

    Do you some code showing this?

    The size of tab pages groups is adapted to the size of its main TabGroup and not to their content.
    The TabGroup doesn't resize when the active tab page changes.



  • On 19/12/2016 at 09:29, xxxxxxxx wrote:

    Originally posted by xxxxxxxx

    The size of tab pages groups is adapted to the size of its main TabGroup and not to their content.

    Yep that is the problem, is there a workaround to fix it?

    Here a code sample as you said there are extra space in the second tab I didn't want. Since in my script (not this one) I deal with 1 tab that can have 400/800 height px and another tab with only 10/20 px is really not visual pleasante to have a lot of extra space dat you can't avoid.

    import c4d
      
    class MyDialog(c4d.gui.GeDialog) :
        dialog = None
      
        def CreateLayout(self) :
            if self.TabGroupBegin(id=1001, flags=c4d.BFH_LEFT, tabtype=c4d.TAB_TABS) :
            
                if self.GroupBegin(id=1011, flags=c4d.BFH_FIT, cols=2, title="1st tab") :
                    self.element = self.AddStaticText(id=1005, flags=c4d.BFH_LEFT, initw=275, name="a", borderstyle=c4d.BORDER_NONE)
                    self.element = self.AddStaticText(id=1006, flags=c4d.BFH_LEFT, initw=275, name="b", borderstyle=c4d.BORDER_NONE)
                    self.element = self.AddStaticText(id=1007, flags=c4d.BFH_LEFT, initw=275, name="c", borderstyle=c4d.BORDER_NONE)
                    self.element = self.AddStaticText(id=1008, flags=c4d.BFH_LEFT, initw=275, name="d", borderstyle=c4d.BORDER_NONE)
                    self.element = self.AddStaticText(id=1009, flags=c4d.BFH_LEFT, initw=275, name="e", borderstyle=c4d.BORDER_NONE)
                self.GroupEnd()
                
        
                if self.GroupBegin(id=1021, flags=c4d.BFH_SCALE, cols=2, rows=4, title="2nd tab") :
                    self.element = self.AddStaticText(id=1010, flags=c4d.BFH_LEFT, initw=275, name="a", borderstyle=c4d.BORDER_NONE)
                    self.element = self.AddStaticText(id=1011, flags=c4d.BFH_LEFT, initw=275, name="b", borderstyle=c4d.BORDER_NONE)
                self.GroupEnd()
      
            self.GroupEnd()
            
            return True    
      
      
    def main() :
        a = MyDialog()
        a.Open(c4d.DLG_TYPE_MODAL)
      
    if __name__=='__main__':
        main()
    


  • On 20/12/2016 at 04:02, xxxxxxxx wrote:

    There's no workaround for this. This is how the TabGroup gadget work and this kind of control doesn't usually resize its pages.
    You should maybe rethink your UI.


Log in to reply