mIRC Home    About    Download    Register    News    Help

Print Thread
#155522 07/08/06 10:56 AM
Joined: Aug 2006
Posts: 12
G
glue Offline OP
Pikka bird
OP Offline
Pikka bird
G
Joined: Aug 2006
Posts: 12
I'm trying to make a tree view with mdx dlls,
i want the tree view to be of a dir on my computer, eg c:\mirc\
so i was using $finddir(c:\mirc\,*,0) as the view file
but as u know that finds all dirs and subdirs,
is there a way just for the first level dirs?

#155523 07/08/06 11:15 AM
Joined: Feb 2005
Posts: 342
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Feb 2005
Posts: 342
$finddir($mircdir,*,%i,1)

%i being the number of the dir (obviously), 1 being the depth.

#155524 07/08/06 11:21 AM
Joined: Aug 2006
Posts: 12
G
glue Offline OP
Pikka bird
OP Offline
Pikka bird
G
Joined: Aug 2006
Posts: 12
sweet cheers.

#155525 07/08/06 12:10 PM
Joined: Aug 2006
Posts: 12
G
glue Offline OP
Pikka bird
OP Offline
Pikka bird
G
Joined: Aug 2006
Posts: 12
Okay,

this is and isnt work
the first question i had was answered perfectly
but the code isnt working

what im trying to do is make a tree view of my dirs in c drive
using mdx and views dlls etc
but it seems its order orinated is this true or am i missing something?

has anyone else tryed to make a tree view or a c drive like exporer left hand side?

#155526 07/08/06 12:27 PM
Joined: Feb 2005
Posts: 342
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Feb 2005
Posts: 342
Sorry, I tend to stay away from dll's.

#155527 07/08/06 10:44 PM
Joined: Aug 2006
Posts: 12
G
glue Offline OP
Pikka bird
OP Offline
Pikka bird
G
Joined: Aug 2006
Posts: 12
so do I
but i want a tree view of a drive we'll say c:\
ie.
+-c:\
-c:\dir1
+c:\dir2
-c:\dir2-1
-c:\dir1

so thought of using mdx files as its able to do tree view, but it seems to order them as they are inputted.
using findfile() and .fwrite to put the whole drive to a text pad,
but it wont order them correctly for some reason

has anyone else tryed this or know of a dll that would help?

#155528 08/08/06 12:56 AM
Joined: Feb 2005
Posts: 342
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Feb 2005
Posts: 342
This may help you.

Code:
alias dirview {
  var %i = 1 , %path = $qt($iif($1-,$1-,$$sdir($mircdir)))
  window -hels @dirview | clear @dirview
  noop $finddir(%path,*,0,5,@dirview)
  window -aw3 @dirview
}


/dirview

Note, the default for this is using a depth of "5" change it to whatever.

Last edited by Rand; 08/08/06 01:05 AM.
#155529 08/08/06 09:44 AM
Joined: Aug 2006
Posts: 12
G
glue Offline OP
Pikka bird
OP Offline
Pikka bird
G
Joined: Aug 2006
Posts: 12
cheers
sorts same code i had, but smaller, same times to load tho since using finddir
here is my code
Code:
alias -l tree {
  var %dir = e:\
  write -c temp.txt
  if ($fopen(mp3list)) { .fclose mp3list }
  .fopen mp3list temp.txt
  var %x = $finddir($+(",%dir,"),*,0,2,.fwrite -n mp3list $1-)
  .fclose mp3list
  var %n = 1
  did -a $dname 401 \Mp3s\
  did -i $dname 401 1 cb root last 1
  while (%n < $lines(temp.txt)) {
    var %line = $read(temp.txt,%n)

    if ($numtok(%line,92) <= 2) {
      did -a $dname 401 $gettok(%line,2,58)
      did -i $dname 401 1 cb root last 1
      inc %n
    }
    if ($numtok(%line,92) >= 3) {
      did -a $dname 401 $gettok(%line,2,58)
      did -i $dname 401 1 cb root last last 1
      inc %n
    }
  }
}

on *:dialog:mmp2:*:*:{
  if ($devent == init) {
    dll $mdx SetMircVersion $version
    dll $mdx MarkDialog $dname
    dll $mdx SetControlMDX $dname 401 TreeView haslines linesatroot hasbuttons autosort > $views
    tree
  }
}


that creates a txt file with all the dirs on e:\ drive
and then im trying to but them in to treeview like the left side of explorer
but i cant get it work correctly

#155530 08/08/06 12:46 PM
Joined: Feb 2005
Posts: 342
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Feb 2005
Posts: 342
I'm not sure if you noticed, but there is a reason I used an @window.

It will print it like this in the @window:

c:\computer
c:\computer\parts
c:\computer\parts\audio
c:\computer\parts\video
c:\computer\programs
c:\computer\programs\mIRC
c:\something1
c:\something1\other1
c:\something1\other2
c:\something2
c:\something2\other1
c:\something2\other2
c:\something2\other3

window -s @win, will make it a "sorted" window.

Hope that helps.

#155531 08/08/06 10:43 PM
Joined: Aug 2006
Posts: 12
G
glue Offline OP
Pikka bird
OP Offline
Pikka bird
G
Joined: Aug 2006
Posts: 12
ofcouse, cheers mate
didnt even register it when u said it


Link Copied to Clipboard