--- In [email protected], "cubstore" <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I'm experimenting with PowerPro and trying to accomplish the
following:
>
> Let's say I have a directory structure like this:
>
> Menu
> |
> +--Submenu1
> | |
> | +--Entry1-1
>>
> I'd like to have this converted into a multi-line bar like this:
> +------------+------------+
> | Entry1-1 | Entry1-2 |
> +-----+------+-----+------+-----+------+
> | Entry2-1 | Entry2-2 | Entry2-3 |
> +------------+------------+------------+
>
Here is a script that will do this assuming the input folder has a
single level of subfolders underneath. It uses
- file.listfiles (file plugin) to get all files in that folder
- vectors (vec plugin) to store each file name as a vector element
- cl functions to create the bar and set the commands to the file
name (and the bar icon and label).
Note that bars created with cl functions disappear if you
reconfigure using pproconf -- see help.
local v=vec.createfromlines(file.listfiles(inputfolder,1))
if (vec.length(v)<=0)
quit
vec.sort(v)
local lastfolder=file.folder(v[0])
if (visiblewindow("bar1"))
bar.hide("bar1")
cl.create("bar1",1)
; following is one line
cl.SetProperties("bar1", "Format1=AutoShowBar barsize tooltips
baricons iconsize: 16")
for (local i=0; i<vec.length(v);i=i+1)
if (file.folder(v[i])!=lastfolder) do
lastfolder=file.folder(v[i])
cl.insert("bar1",cl.length("bar1"))
local last=cl.length("bar1")-1
cl.addleft("bar1",last , "*format","newbarrow")
endif
cl.insert("bar1",cl.length("bar1"))
local last=cl.length("bar1")-1
cl.addleft("bar1", last, v[i])
cl.seticon("bar1", last, "left")
cl.setlabel("bar1", last, file.name(v[i]))
endfor
bar.show("bar1")
Attention: PowerPro's Web site has moved: http://www.ppro.org
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/power-pro/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/