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

    Unfolded TreeView

    SDK Help
    0
    3
    549
    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
      Helper
      last edited by

      On 11/10/2017 at 13:40, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   R17 
      Platform:   Windows  ;   
      Language(s) :     C++  ;

      ---------
      Hello.

      I add a tree view custom gui in a dialog.
      Is there any option to initialize the tree as unfolded ?

      Thank you!

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

        On 12/10/2017 at 01:19, xxxxxxxx wrote:

        The folded state is define by the IsOpen function.
        Simply make return to false for the first time, then after get the obj.GetBit(c4d.BIT_OFOLD)
        And in your Open function which is trigger when something is open/closed
        make something like
                if onoff:
                    obj.SetBit(c4d.BIT_OFOLD)
                else:
                    obj.DelBit(c4d.BIT_OFOLD)

        Of course this method work for any BaseList2D but for any customDataType simply make a Bool member variable who gonna store the state of the folding.

        Additionnaly I really suggest you to read thoses following blog post about tree view
        TreeView made simple - Part 1[URL-REMOVED]
        Treeview made simple – Part 2[URL-REMOVED]


        [URL-REMOVED] @maxon: This section contained a non-resolving link which has been removed.

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

          On 12/10/2017 at 02:04, xxxxxxxx wrote:

          Hi,

          basically you define yourself the fold state of every node in the tree view by the return value of TreeViewFunctions::IsOpened(). Its counterpart is TreeViewFunctions::Open(), which requests to fold or unfold a certain node. It's on you to work with these. For example always returning true from IsOpened() will result in an unfolded and unfoldable tree.

          And then there are TreeViewCustomGui::MakeVisible() and TreeViewCustomGui::ShowObject(), which make use of above functions to reveal a certain node in the tree.

          Edit: Ooopsy, gr4ph0s was faster...

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