mIRC Home    About    Download    Register    News    Help

Print Thread
#145535 24/03/06 06:05 PM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
Someone that know a good tutorial about dialogs and tree view? i hope you understand what i mean:

____________________________________________

Menu
|_Option 1 What that will show on this "menu"
|_Option 2 What that will show on this "menu"
|_Option 3 What that will show on this "menu"
_____________________________________________

Option can also be a icon.


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
#145536 24/03/06 06:15 PM
Joined: Mar 2005
Posts: 420
X
Fjord artisan
Offline
Fjord artisan
X
Joined: Mar 2005
Posts: 420
One thing I can tell you is it would need a dll. I suggest using DCX.

Last edited by xDaeMoN; 24/03/06 06:16 PM.

If you have a plastic floor runner over your tiles, then you're one Hella Pinoy!
#145537 24/03/06 06:21 PM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
I know i need a DLL, but the dll dosent have any good explanation "often anyway", so thats why i asked about a www page or anything else where i can reda about them smile


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
#145538 24/03/06 07:10 PM
Joined: Mar 2005
Posts: 420
X
Fjord artisan
Offline
Fjord artisan
X
Joined: Mar 2005
Posts: 420
The link I gave you is from the DCX website which explains all the commands to be used for making a treeview. If that does not help, maybe others can give you a better link.


If you have a plastic floor runner over your tiles, then you're one Hella Pinoy!
#145539 25/03/06 12:01 PM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
Didnt reply to anyone, just so i could post here again wink
Code:
alias setup { $iif(!$dialog(setup),dialog -m setup setup) }

dialog setup {
  title "title"
  size -1 -1 231 148
  option dbu

  list 2, 2 8 70 135
}

that will create a dialog with a "list", how can i add text in to that list that are clickable ? it can be done without any DLL ?


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
#145540 25/03/06 04:07 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
If you only want to be able to click one item in that list, that code you currently have should work fine. If you want to be able to click more than one change
Code:
 list 2, 2 8 70 135 
to
Code:
 list 2, 2 8 70 135, extsel 


Of course you're going to have to add items to the list before you can click on them.

There are several ways of adding text to a list.

You should read up on the /did command in the help file.

#145541 25/03/06 07:30 PM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
I added as u said with extsel in the end, and i added a "text" in the listbox, and then i added:

on *:dialog:setup:*:*: {
if ($devent == sclick) {
if ($did == 3) { echo -a click }
}
}

the text in the listbox have the ID 3, how ever if i click on it nothing happen, anything i missing here ?


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
#145542 25/03/06 08:03 PM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
Quote:
alias setup { $iif(!$dialog(setup),dialog -m setup setup) }

dialog setup {
title "title"
size -1 -1 231 148
option dbu

list 2, 2 8 70 135
}

I added as u said with extsel in the end, and i added a "text" in the listbox, and then i added:

on *:dialog:setup:*:*: {
if ($devent == sclick) {
if ($did == 3) { echo -a click }
}
}
the text in the listbox have the ID 3, how ever if i click on it nothing happen, anything i missing here ?

Code:
alias setup { $iif(!$dialog(setup),dialog -dm setup setup,dialog -v setup) }

dialog setup {
  title "title"
  size -1 -1 231 148
  option dbu
  list 2, 2 8 70 135
text "This is just a label", 3, 2 0 70 8, center
}
on *:dialog:setup:init:0:{
  loadbuf -o setup 2 versions.txt 
}
on *:dialog:setup:sclick:2:{
  echo -a $did(setup,2).seltext
}
on *:dialog:setup:sclick:3:{
  echo -a Click!
}


see that dialog ID 3 wont echo click its not used that way.

look at the dialog "link" for clicking

code]
dialog setup {
title "title"
size -1 -1 231 148
option dbu
list 2, 2 8 70 135
text "This is just a label", 3, 2 0 70 8, center
link "This is clicker", 4, 72 0 70 8, center

}
on *:dialog:setup:init:0:{
loadbuf -o setup 2 versions.txt
}
on *:dialog:setup:sclick:2:{
echo -a $did(setup,2).seltext
}
on *:dialog:setup:sclick:3:{
echo -s Click!
}
on *:dialog:setup:sclick:4:{
echo -a Click!
}[/code]

Last edited by MikeChat; 25/03/06 08:28 PM.
#145543 25/03/06 10:32 PM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
Ok, i got your point, the problem i have is now that i dont load anything from a *.txt file, i want to load images from a folder. "the names", and i dont know, but loadbuf -o wont do the trick ? do i have to first scan the folder, then add the names from the images in that folder in a *.txt file, then load them to listbox? or any simpler way ?


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
#145544 25/03/06 10:43 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Code:
on *:dialog:DNAME:init:*:{
var %a = 1, %b = $findfile($mircdir,*.*,0)
while %a <= %b {
did -a $dname ID $nopath($findfile($mircdir,*.*,0))
inc %a
}
}
  

That will load the names of the files from your mIRC directory (but not any of the sub-directories) into the dialog item ID, upon iniatialization of the dialog. Replace DNAME with the name of the dialog and ID with the appropriate ID number.

#145545 25/03/06 10:58 PM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
to list files into a dialog list you can use
$findfile(<path>,*.filetype,0,did -a dialogname ID $1-)

or if you set the path somewhere and dont want the path with the file name
$findfile(<path>,*.filetype,0,did -a dialogname ID $nopath($1-))

sample
Code:

dialog setup {
  title ""
  size -1 -1 150 150
  option dbu
  list 2, 5 14 70 140, sort
  text "File List", 800, 5 0 35 8, center 
  link "Info", 700, 40 0 35 8, center
  button "View", 901, 75 35 60 25
}
on *:dialog:setup:init:0:{
  var %null = $findfile(bmp\,*.jpg,0,did -a setup 2 $nopath($1-))
  var %null = $findfile(bmp\,*.gif,0,did -a setup 2 $nopath($1-))
}
on *:dialog:setup:dclick:2:{
  ;;do something with the picture
  run bmp\ $+ $did(setup,2).seltext
}
on *:dialog:setup:sclick:901:{
  ;;do something with the picture
  run bmp\ $+ $did(setup,2).seltext
}

on *:dialog:setup:sclick:700:{
  ;; do something else
  var %filestuff = bmp\ $+ $did(setup,2).seltext
  echo -a $did(setup,2).seltext $bytes($pic(%filestuff).size,k).suf $pic(%filestuff).width $pic(%filestuff).height
}


Link Copied to Clipboard