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

    TreeViewCustomGui MakeVisible()

    SDK Help
    0
    2
    248
    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

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 06/07/2006 at 15:04, xxxxxxxx wrote:

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

      ---------
      I'm not getting the expected results with this (and it appears to be the only possible way to scroll to a selected element so that it is visible).

      My TreeView is 'virtual'. That is, subitems are only filled in when a folder-type item is opened. Until then, it holds a temporary item to allow opening by the user.

      Nonetheless, when an item is to be shown, the tree is first unfolded to that item, filling in the necessary hierarchy - so it is no longer virtual. Then I call tree->MakeVisible(selectedItem), but instead of scrolling to make the item visible, it actually backs out and closes several folder levels (?). Why would this happen if the item is non-virtual and visible through unfolding?

      All that I really need here is the scrolling part so that this item is within the UserArea visible region. The unfolding part must be done by my own code since the tree is virtual.

      // Collapse All Folders - so that only the result is displayed
      root.ExpandAll(FALSE);
      // Unfold to search result
      // The item matching result is made the selected item (verified)
      root.Unfold(ri->GetFilename().GetString());
      // This keeps folding back several levels
      tree->MakeVisible(root.GetSelected());

      Thanks,

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

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 06/07/2006 at 17:17, xxxxxxxx wrote:

        After some consideration, it appears that MakeVisible() calls TreeViewFunctions::Open() whether it IsOpened() or not. Since my code for Open() is particular to the virtual nature of the hierarchy, MakeVisible() did not like this at all.

        The solution here is to set a mode before MakeVisible() that just skips the Open() code and then unset the mode after MakeVisible(). Works perfectly!

             // Collapse All Folders  
             root.ExpandAll(FALSE);  
             // Unfold to search result  
             root.Unfold(ri->GetFilename().GetString());  
        #ifdef C4D_R9  
             if (root.GetSelected())  
             {  
                  root.SetSearchMode(TRUE);  
                  tree->MakeVisible(root.GetSelected());  
                  root.SetSearchMode(FALSE);  
             }  
        #endif
        
        1 Reply Last reply Reply Quote 0
        • First post
          Last post