Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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

    What message or Id do I get when the user select a tab in my dialog?

    Cinema 4D SDK
    2
    3
    836
    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.
    • P
      pim
      last edited by r_gigante

      I have a command plugin with a dialog (1 res file).
      Is there a way to detect that the user clicked a tab in the dialog.
      So, not a button or any other field, but a tab?

      1 Reply Last reply Reply Quote 0
      • M
        m_adam
        last edited by m_adam

        Hi @pim you can access the current TabID by querying GetInt32 on the TabGroup's ID.

        Here you get a complete example of tab usage.

        import c4d
        
        class Dlg(c4d.gui.GeDialog):
            def CreateLayout(self):
                if self.TabGroupBegin(1000, c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT, tabtype=c4d.TAB_TABS):
                    
                    if self.GroupBegin(1001, c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT, 0, title="First Tab", groupflags=c4d.BFV_BORDERGROUP_FOLD_OPEN):
                        self.GroupEnd()
                        
                    if self.GroupBegin(1002, c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT, 0, title="Second Tab", groupflags=c4d.BFV_BORDERGROUP_FOLD_OPEN):
                        self.GroupEnd()
        
                self.GroupEnd()
                self.AddButton(1003, c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT, name="Activate second Tab")
                
                return True
            def Command(self, id, msg):
                # Id of the TabGroupBegin
                if id == 1000:
                    print self.GetInt32(1000)
                    
                # Id of the Button
                if id == 1003:
                    self.SetInt32(1000, 1002)
                
                return True
            
        # Main function
        def main():
            dlg = Dlg()
            dlg.Open(c4d.DLG_TYPE_MODAL_RESIZEABLE)
        
        # Execute main()
        if __name__=='__main__':
            main()
        

        Finally please read and stick to the How to Post Questions (especially about tagging system).

        If you have any question, please let me know.
        Cheers,
        Maxime!

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

        1 Reply Last reply Reply Quote 2
        • P
          pim
          last edited by

          Thank you!
          In future I will set the tags.

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