Results 1 to 5 of 5

Thread: Nodes

  1. #1
    thinBasic MVPs
    Join Date
    Oct 2012
    Location
    Germany
    Age
    55
    Posts
    1,555
    Rep Power
    174

    Nodes

    I have not found any Nodes yet- so I made my own.

    This example consists of two files, put them both to same folder and run NodeTest which is a simple file-explorer written in TBGL+FILE that has a treeview to display my computer and below noded volumes and folders and a simple list to display the files.

    Main attention should be on the Nodes-Unit which handles tree & relations of nodes while the NodeTest.tBasic is just one of possible uses for nodes. It would be great to have this improved in speed & fuctionality - there are not all functions fully tested yet

    Perhaps some ideas to this,

    Minversion 1.9.5.0. (or when did Array Scan the improve?)
    Edit: Added NODE_SetBranch(Index, Flag)-Function to set a whole branch of tree to either %NODE_COLLAPSED or %NODE_EXPANDED
    - not recommended to use expand on a whole tree before it is completely filled with data - leads to uncomfortable behaviour since the nodes don't know yet if they are expandable...
    Attached Files Attached Files
    Last edited by ReneMiner; 20-05-2013 at 18:12.
    I think there are missing some Forum-sections as beta-testing and support

  2. #2
    thinBasic MVPs
    Join Date
    Oct 2012
    Location
    Germany
    Age
    55
    Posts
    1,555
    Rep Power
    174
    Here's another example for using Nodes. This time it's just two trees - you can choose to attach "random" nodes as sibling or child to any node of whichever tree you want. Just click one of those Buttons... The function which does the important stuff is CTRL_Button_Click().

    You'll need the Nodes.tBasicU from the post above placed next to this file.

    Also Minversion 1.9.5.0

    Edit: last change was just some scroll-behaviour - so if user adds more ctrl's the top position was not calculated right when clicking on it
    Attached Files Attached Files
    Last edited by ReneMiner; 20-05-2013 at 19:35.
    I think there are missing some Forum-sections as beta-testing and support

  3. #3
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,155
    Rep Power
    736
    Good examples on topic which is general purpose enough that it should be checked out by every ThinBASIC programmer!

    Rene introduces concept of nodes and demonstrates it on use with File and TBGL module - but that is not the only area where it could be used.


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  4. #4
    thinBasic MVPs
    Join Date
    Oct 2012
    Location
    Germany
    Age
    55
    Posts
    1,555
    Rep Power
    174

    Another-Node-Example

    very, very, very self-explaining...

    This time shows the use of Nodes in combination with Dictionary-Module as usual help-files would work and explains the use of Nodes-Unit which you'll need in addition to this on the same path.
    ("Nodes.tBasicU"-attachement is the same as above)
    Also Minversion 1.9.5.0 required.
    Attached Files Attached Files
    Last edited by ReneMiner; 21-05-2013 at 23:09.
    I think there are missing some Forum-sections as beta-testing and support

  5. #5
    thinBasic MVPs
    Join Date
    Oct 2012
    Location
    Germany
    Age
    55
    Posts
    1,555
    Rep Power
    174
    Just to inform:

    Since Dir_ListArray now works correctly since tB-version 1.9.7.0, the first example will work correct for you now if you don't save it to some folder which has any subfolders inside...

    I was not aware of this when I published it - since I had the script saved to some folder with some subfolder inside and I did not know that it did not work. So a few of you might have thought the script is buggy and never had a closer look.

    And since I already made a post, attached some sound-browser which allows to browse folders with sound-files inside. I made it since I did not like to start some different program or instance of some sound-editing/playing-software just to find a fitting sound for whatever. So on the left side there's the usual treeview, on the right you have the file-list - and if there's a soundfile (whichever TBASS-module accepts "MP3", "MP2", "MP1", "OGG", "WAV", "AIFF") you can click it and listen.

    When I made this I found out that Dir_ListArray did not work correctly - but it was a hard, long, enervating way to find the reason why my "C:"-drive did not show up in the tree

    MINVERSION 1.9.7.0
    Attached Files Attached Files
    Last edited by ReneMiner; 23-06-2013 at 06:25.
    I think there are missing some Forum-sections as beta-testing and support

Members who have read this thread: 0

There are no members to list at the moment.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •