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

    TreeView Header Sorting

    Scheduled Pinned Locked Moved SDK Help
    3 Posts 0 Posters 298 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

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

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

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

      ---------
      Any information on how this actually works? I see that there is a method TreeViewFunctions::GetHeaderSortArrow(), but there is no arrow on any of the column headers. So, one supposes that I supply the arrow and which column currently is used for sorting?

      Also, would TreeViewFunctions::HeaderClick() be used to possibly initiate sorting (change ascending/descending for instance)?

      Thanks,

      1 Reply Last reply Reply Quote 0
      • H Offline
        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 10:00, xxxxxxxx wrote:

        No clue, as I haven´t used this yet but I´d be interested in knowing it too. 🙂

        1 Reply Last reply Reply Quote 0
        • H Offline
          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 10:04, xxxxxxxx wrote:

          I think that I have this 'sorted' (bah-dum-bah). 😉

          GetHeaderSortArrow() wants a non-zero value to determine sort direction (though the docs don't specify what values are expected - eh hem). I'm using 0 for no sort, -1/1 for sorted directions.

          HeaderClick() can be used to change sort direction or select a new sort column.

          Here's my code for TreeViewFunctions:

          LONG GetHeaderSortArrow(void* root, void* userdata, LONG lColID)  
          {  
               rroot =     (ResultsRoot* )root;  
               if (rroot->GetSortCol() == lColID)     return rroot->GetSortDir();  
               return 0;  
          }  
          Bool HeaderClick(void* root, void* userdata, LONG lColID, LONG lChannel, Bool bDblClk)  
          {  
               // Ignore double-clicks and middle/right mouse buttons  
               if (bDblClk)                                   return FALSE;  
               if (lChannel !=     BFM_INPUT_MOUSELEFT)     return FALSE;  
               rroot =     (ResultsRoot* )root;  
               if (rroot->GetSortCol() == lColID)          rroot->InvertSortDir();  
               else                                             rroot->SetSortCol(lColID);  
               return     TRUE;  
          }  
          

          P.S.: Note that the actual sorting must be done in your own code when conditions warrant (change of column, change of sort direction).

          3D Designer, now you know. 🙂

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