Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Mon Jun 01, 2020 5:49 pm

All times are UTC - 5 hours

Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Folder tree - quick start please
PostPosted: Fri Sep 30, 2005 9:47 am 

Joined: Fri Sep 30, 2005 8:46 am
Posts: 3
I am a reasonably efficient in VB and am just making the transition to RB at home - but I would like a nudge in the right direction to get me started(instead of going through the language reference!)

How would I make a two window/frame application that has a collapsable folder-tree on the left and the folder contents (file list) on the right (i.e. a very simplified windows exlorer). I've no doubt it will use the FolderItem class - but that is entirely new to me.

Oh - and none of those pop-up dialog boxes now!

Reply with quote  
 Post subject:
PostPosted: Fri Sep 30, 2005 9:56 am 
User avatar

Joined: Wed Sep 28, 2005 8:39 am
Posts: 9341
Location: St Augusta, MN
You're starting off on a difficult foot because you need to learn how to do hierarchical listboxes for your left-hand pane, which are a more advanced topic.

In terms of the FolderItem stuff, which I believe was your original question, you'd want to loop over all the files on a Volume, so something like this:

// Get the root volume
dim root as FolderItem = Volume( 0 )

// Append it to our stack of items to check
dim stack( -1 ) as FolderItem
stack.Append( root )

// Loop over all the items in the stack and add them
while UBound( stack ) >= 0
// Get an item
dim item as FolderItem = stack.Pop

if not item.Directory then
// If it's a file, add it
DoTheFileAdd( item )
// It's a directory, so we need to do something different
DoTheDirectoryAdd( item )

// Add the directory children to the stack, but do
// not resolve shortcuts
for i as Integer = 1 to item.Count
stack.Append( item.TrueItem( i ) )
next i
end if

Note, this code is totally off-the-cuff and untested. But I think you get the idea. Basically, you want to start at some root and loop over all the files. You could also do this with a recursive method if you'd like.

Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group