Author Topic: Directory tree and file list controls  (Read 15078 times)

0 Members and 1 Guest are viewing this topic.

Offline Eros Olmi

  • Full Member
  • ***
  • Posts: 243
  • User-Rate: +18/-7
    • thinBasic
Directory tree and file list controls
« on: January 23, 2008, 07:02:59 AM »
I need to add a directory tree and a file list to the arsenal of thinBasic script language. The same treeviw and listview present into standard Explorer window.
I was wondering if there are controls already done for this job or I need to build by myself.

Thanks a lot
Eros
« Last Edit: January 23, 2008, 02:59:57 PM by Eros Olmi »
thinBasic Script Interpreter - www.thinbasic.com | www.thinbasic.com/community
Win7Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

Offline Patrice Terrier

  • ROMs
  • Hero Member
  • *****
  • Posts: 936
  • User-Rate: +62/-1
    • www.zapsolution.com
Re: Directory tree and file list controls
« Reply #1 on: January 23, 2008, 10:03:14 AM »
Eros,

I have one, see it there the C# version using zBff.dl:
http://www.zapsolution.com/winlift/ccorner.htm
then search for zExplorer.

Screen shot of the C# zExplorer using zBff.dll:




Screen shot of the WinDev zExplorer using also zBff.dll.



Note: zBff is written in PowerBASIC.

and you can see it in action, in PowerBASIC applications, if you download any of my ZAP Media product there:
http://www.zapsolution.com/zmsidxus.htm


and here is another screen shot for my WinDev wTune project:




Note: zBff represent a fairly amount of advanced SDK coding style that was written several years ago, with the contribution of Edwin, Semen, and myself (tooks me 6 monthes work to get the final version).

...
« Last Edit: January 23, 2008, 10:29:11 AM by Patrice Terrier »
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Offline Eros Olmi

  • Full Member
  • ***
  • Posts: 243
  • User-Rate: +18/-7
    • thinBasic
Re: Directory tree and file list controls
« Reply #2 on: January 23, 2008, 03:27:11 PM »
What? 6 months of work? Said from a guru like you (I'm serious here) it must be quite complex task.

Images seems talking by themself about what a great job all you did. From the readme you stated it is free. Can I use for distributing inside thinBasic?

In any case I will test it this night when back home.

Thanks a lot.
Eros
« Last Edit: January 23, 2008, 04:39:54 PM by Eros Olmi »
thinBasic Script Interpreter - www.thinbasic.com | www.thinbasic.com/community
Win7Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

Offline Patrice Terrier

  • ROMs
  • Hero Member
  • *****
  • Posts: 936
  • User-Rate: +62/-1
    • www.zapsolution.com
Re: Directory tree and file list controls
« Reply #3 on: January 23, 2008, 05:24:53 PM »
Yes, it was a huge amount of work, believe me!

I am not speaking of the code size there, but the complexity of interaction with low level COM programming and the IShellFolder interface using $IShellFolderGUID = GUID$("{000214E6-0000-0000-C000-000000000046}"), with a tool (PB6-PB7) that was not towered to low level COM programming.

Note: zBff is not freeware, but it could be used for free with either WinDev or C#.

Indeed zBff and its extension ZAP Media Browser is able to do, all what could be done with Explorer!
ZAP Media browser uses several thread to monitor disk activity and USB port detection, as well as CD/DVD insertion etc.

The problem for thinBasic, is that I didn't wrote any example showing how to use it with PB.
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Offline Eros Olmi

  • Full Member
  • ***
  • Posts: 243
  • User-Rate: +18/-7
    • thinBasic
Re: Directory tree and file list controls
« Reply #4 on: January 23, 2008, 09:15:44 PM »
Any PowerBasic include file can be used with thinBasic almost natively except MACROs and other few things. Also COM interfaces are not handled. ThinBasic can inteface with any standard DLL (exactly like PB deos) but on the fly during script execution.

Anyhow, I will test by myself but if it is not freeware I cannot use.

Thanks in any case.
Ciao
Eros
« Last Edit: January 23, 2008, 09:24:16 PM by Eros Olmi »
thinBasic Script Interpreter - www.thinbasic.com | www.thinbasic.com/community
Win7Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

Offline Patrice Terrier

  • ROMs
  • Hero Member
  • *****
  • Posts: 936
  • User-Rate: +62/-1
    • www.zapsolution.com
Re: Directory tree and file list controls
« Reply #5 on: January 23, 2008, 10:06:27 PM »
Eros,

You can always try the C# version, you will find the EXE and the "free" zBff.dll inside of the project \BIN subfolder.

The main exe name is: zExplorer.exe.

...
« Last Edit: January 23, 2008, 10:12:28 PM by Patrice Terrier »
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Offline Patrice Terrier

  • ROMs
  • Hero Member
  • *****
  • Posts: 936
  • User-Rate: +62/-1
    • www.zapsolution.com
Re: Directory tree and file list controls
« Reply #6 on: January 23, 2008, 10:18:17 PM »
Eros,

While using zExplorer, double clic on any file to run it with the associated software.

While in the TreeView, right clic the mouse button to popup the contextual menu.

...
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Offline Patrice Terrier

  • ROMs
  • Hero Member
  • *****
  • Posts: 936
  • User-Rate: +62/-1
    • www.zapsolution.com
Re: Directory tree and file list controls
« Reply #7 on: January 23, 2008, 10:24:58 PM »
Eros,

One thing more: zExplorer (zBff) works not only with XP but also with VISTA.

...
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Offline Eros Olmi

  • Full Member
  • ***
  • Posts: 243
  • User-Rate: +18/-7
    • thinBasic
Re: Directory tree and file list controls
« Reply #8 on: January 23, 2008, 11:02:08 PM »
OK Patrice.

I think the only problem now is if I can use zBff for free or not :D

I was able to use zBff in thinBasic scripts. See attached file for testing.
To execute thinBasic script you need to install latest thinBasic preview version 1.6.0.1 downloadable from thinBasic web site at http://www.thinbasic.com/index.php?option=com_docman&task=cat_view&gid=19&Itemid=66
Otherwise I've also included a bundled executable created with thinBasic bundler. A bundled exe is something like a ZIP file that have inside all what is needed by the thinBasic script to be executed like a normal exe.

So far thinBasic and zBff seem working perfectly together. I've not done any interaction with it but seems quite easy.

Let me know about if I can use it or not as distributable dll inside thinBasic official distibution: if possible, and what are the rules.
If not possible, it has been a pleasure in any case. I will try to find another road.

Ciao
Eros

UPDATES:
  • attached file updated. Added interaction with zBff treeview detecting selction change and right click
« Last Edit: January 24, 2008, 07:43:08 AM by Eros Olmi »
thinBasic Script Interpreter - www.thinbasic.com | www.thinbasic.com/community
Win7Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

Offline Patrice Terrier

  • ROMs
  • Hero Member
  • *****
  • Posts: 936
  • User-Rate: +62/-1
    • www.zapsolution.com
Re: Directory tree and file list controls
« Reply #9 on: January 23, 2008, 11:09:05 PM »
Eros,

Yes, you can use the zBff.dll provided with the C# version, if it runs fine with thinBasic.

...
« Last Edit: January 23, 2008, 11:12:08 PM by Patrice Terrier »
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Offline Eros Olmi

  • Full Member
  • ***
  • Posts: 243
  • User-Rate: +18/-7
    • thinBasic
Re: Directory tree and file list controls
« Reply #10 on: January 23, 2008, 11:44:14 PM »
Attached file updated.
Added interaction with zBff detecting selection change and right click
thinBasic Script Interpreter - www.thinbasic.com | www.thinbasic.com/community
Win7Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

Offline Eros Olmi

  • Full Member
  • ***
  • Posts: 243
  • User-Rate: +18/-7
    • thinBasic
Re: Directory tree and file list controls
« Reply #11 on: January 24, 2008, 12:15:27 AM »
Patrice,

I've noticeded that in c# example right clicking on a tree item does not change the current selected item. Is this by design? Can it be changed?
For example if selected item is C:\temp and you right click on a different directory choosing, for example, Rename from menu, it renames C:\temp while right click was on another tree item. Explorer behave differently. RIght click change selected item.

Just to know in case there is a way to change this behave.
Thanks in advance.
Eros
« Last Edit: January 24, 2008, 07:42:36 AM by Eros Olmi »
thinBasic Script Interpreter - www.thinbasic.com | www.thinbasic.com/community
Win7Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

Offline Patrice Terrier

  • ROMs
  • Hero Member
  • *****
  • Posts: 936
  • User-Rate: +62/-1
    • www.zapsolution.com
Re: Directory tree and file list controls
« Reply #12 on: January 24, 2008, 10:15:01 AM »
Yes, this is by design, left mouse button to select, right mouse button to show the popup menu without changing the current selection.
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Offline Eros Olmi

  • Full Member
  • ***
  • Posts: 243
  • User-Rate: +18/-7
    • thinBasic
Re: Directory tree and file list controls
« Reply #13 on: January 27, 2008, 12:49:01 PM »
Patrice,

in my tests with zBff I've found a situation where zBff seems looping and showing always the same structure.
It happen when you enter, for example, special folder "Cronology" under user settings. See attached image.
Standard explorer behave when this special folder is selected is to unselect it and move selection to the parent folder.

Ciao
Eros
thinBasic Script Interpreter - www.thinbasic.com | www.thinbasic.com/community
Win7Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

Offline Patrice Terrier

  • ROMs
  • Hero Member
  • *****
  • Posts: 936
  • User-Rate: +62/-1
    • www.zapsolution.com
Re: Directory tree and file list controls
« Reply #14 on: January 27, 2008, 03:29:11 PM »
--Eros

On VISTA "Documents and settings" is a protected folder, you can't access it, see attached screen shot.

I think you should write your own BrowseForFolder control starting from existing source code:

http://www.codeproject.com/KB/tree/treeviewexplorer.aspx
http://www.c-sharpcorner.com/UploadFile/nkumar/WindowsExplorerinCSharp11292005230454PM/WindowsExplorerinCSharp.aspx
http://support.microsoft.com/kb/306285

From the top of my head i think that there was somewhere a Borje's example showing how to embed a BFF inside of another window (Poff?)
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com