Powerbasic Museum 2020-B

General Category => General Discussion => Topic started by: Eros Olmi on January 23, 2008, 07:02:59 AM

Title: Directory tree and file list controls
Post by: Eros Olmi 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
Title: Re: Directory tree and file list controls
Post by: Patrice Terrier 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 (http://www.zapsolution.com/winlift/ccorner.htm)
then search for zExplorer.

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

(http://www.csharpfr.com/gdi/c/40563.cs.jpg)


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

(http://www.zapsolution.com/preview/zbff_fr1_3.jpg)

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 (http://www.zapsolution.com/zmsidxus.htm)


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

(http://www.zapsolution.com/preview/wt100b.png)


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).

...
Title: Re: Directory tree and file list controls
Post by: Eros Olmi 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
Title: Re: Directory tree and file list controls
Post by: Patrice Terrier 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.
Title: Re: Directory tree and file list controls
Post by: Eros Olmi 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
Title: Re: Directory tree and file list controls
Post by: Patrice Terrier 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.

...
Title: Re: Directory tree and file list controls
Post by: Patrice Terrier 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.

...
Title: Re: Directory tree and file list controls
Post by: Patrice Terrier on January 23, 2008, 10:24:58 PM
Eros,

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

...
Title: Re: Directory tree and file list controls
Post by: Eros Olmi 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:
Title: Re: Directory tree and file list controls
Post by: Patrice Terrier 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.

...
Title: Re: Directory tree and file list controls
Post by: Eros Olmi on January 23, 2008, 11:44:14 PM
Attached file updated.
Added interaction with zBff detecting selection change and right click
Title: Re: Directory tree and file list controls
Post by: Eros Olmi 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
Title: Re: Directory tree and file list controls
Post by: Patrice Terrier 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.
Title: Re: Directory tree and file list controls
Post by: Eros Olmi 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
Title: Re: Directory tree and file list controls
Post by: Patrice Terrier 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.codeproject.com/KB/tree/treeviewexplorer.aspx)
http://www.c-sharpcorner.com/UploadFile/nkumar/WindowsExplorerinCSharp11292005230454PM/WindowsExplorerinCSharp.aspx (http://www.c-sharpcorner.com/UploadFile/nkumar/WindowsExplorerinCSharp11292005230454PM/WindowsExplorerinCSharp.aspx)
http://support.microsoft.com/kb/306285 (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?)
Title: Re: Directory tree and file list controls
Post by: Eros Olmi on January 27, 2008, 10:04:15 PM
Quote from: Patrice Terrier on January 27, 2008, 03:29:11 PM
I think you should write your own BrowseForFolder control starting from existing source code:
I need it, so I will do it.
Title: Re: Directory tree and file list controls
Post by: Eros Olmi on May 13, 2018, 10:46:50 AM
Hi Patrice,

sorry to open again this old thread, only to have a confirm.

It seems it is not possible to change foreground color of zBFF. Whatever color you put in
zBFF_SetProperty(hTree, %Bff_ColorTextTreeView, RGB(....) )
has no effect.

Instead it is possible to change background color of tree and fore/back color of selected line.

Thanks a lot
Eros
Title: Re: Directory tree and file list controls
Post by: Eros Olmi on May 13, 2018, 11:36:23 AM
Ops, sorry: I've the sources.
I can check by myself.

Ciao
Eros