mIRC Home    About    Download    Register    News    Help

Print Thread
Page 3 of 3 1 2 3
#148796 12/05/06 05:40 PM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
Qwerty said:
Quote:

You need to do it at runtime: use the sclick event to watch for tab clicks and the /did -t command to dynamically set the default button.


so test with this
Code:

alias list dialog -m list list

dialog list {
  title "List Box"
  size -1 -1 200 100
  option dbu
  tab "One", 1, 0 0 200 100
  tab "Two", 2
  list 100, 20 20 160 60, tab 1
  button "Add", 900, 30 75 60 10, tab 1
  button "Remove", 901, 110 75 60 10, tab 1
  list 101, 20 20 160 60, tab 2
  button "Add", 902, 30 75 60 10, tab 2
  button "Remove", 903, 110 75 60 10, tab 2
}
on *:dialog:list:init:0:{
  did -b list 901,903
}
on *:dialog:list:sclick:1:{
  did -t list 100 1
}
on *:dialog:list:sclick:2:{
  did -t list 101 1
}
on *:dialog:list:sclick:900:{
  if ($cb(0)) { 
    did -a list 100 $cb 
    did -e list 901 
  }
}  
on *:dialog:list:sclick:901:{
  did -d list 100 $did(list,100).sel
  if (!$did(list,100).lines) { did -b list 901 }
}

on *:dialog:list:sclick:902:{
  if ($cb(0)) { 
    did -a list 101 $cb 
    did -e list 903 
  }
}  
on *:dialog:list:sclick:903:{
  did -d list 101 $did(list,101).sel
  if (!$did(list,101).lines) { did -b list 903 }
}

#148797 12/05/06 05:46 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
it does same errors :P


IceCapped
#148798 12/05/06 06:02 PM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
I have tested it here again, and i get no errors
what are the errors you get??
did you paste my code or are you adapting yours and still getting errors there?

#148799 12/05/06 06:19 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
i copy/pasted YOUR code (last) and only changed dialog name coz it fux up when i call /list

i get errors on this lines:

for tab 1
did -d listme 100 $did(listme,100).sel

for tab 2
did -d listme 101 $did(listme,101).sel

to repeat i get in passive click this errors, not in active

Last edited by raZOR; 12/05/06 06:20 PM.

IceCapped
#148800 12/05/06 06:44 PM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
whether passive or active (and the sclick for the tab ID should stop passive)
I get no errors
Code:
alias listme dialog -m listme listme

dialog listme {
  title "listme Box"
  size -1 -1 200 100
  option dbu
  tab "One", 1, 0 0 200 100
  tab "Two", 2
  list 100, 20 20 160 60, tab 1
  button "Add", 900, 30 75 60 10, tab 1
  button "Remove", 901, 110 75 60 10, tab 1
  list 101, 20 20 160 60, tab 2
  button "Add", 902, 30 75 60 10, tab 2
  button "Remove", 903, 110 75 60 10, tab 2
}
on *:dialog:listme:init:0:{
  did -b listme 901,903
}
on *:dialog:listme:sclick:1:{
  did -t listme 100 1
}
on *:dialog:listme:sclick:2:{
  did -t listme 101 1
}
on *:dialog:listme:sclick:900:{
  if ($cb(0)) { 
    did -a listme 100 $cb 
    did -e listme 901 
  }
}  
on *:dialog:listme:sclick:901:{
  did -d listme 100 $did(listme,100).sel
  if (!$did(listme,100).lines) { did -b listme 901 }
}

on *:dialog:listme:sclick:902:{
  if ($cb(0)) { 
    did -a listme 101 $cb 
    did -e listme 903 
  }
}  
on *:dialog:listme:sclick:903:{
  did -d listme 101 $did(listme,101).sel
  if (!$did(listme,101).lines) { did -b listme 903 }
}


renamed it all

#148801 12/05/06 06:49 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
now tried on clean mirc 6.17
i get same errors for same lines.

ehm... weird case ?


IceCapped
#148802 12/05/06 06:58 PM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
Since I don't get the error, maybe someone else can tell you what is causing the error and how to get rid of it.

#148803 12/05/06 07:07 PM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
you could try changing these lines
on *:dialog:listme:sclick:1:{
did -t listme 100 1
}
on *:dialog:listme:sclick:2:{
did -t listme 101 1
}

to
on *:dialog:listme:sclick:1:{
did -t listme 900
}
on *:dialog:listme:sclick:2:{
did -t listme 902
}

#148804 12/05/06 07:19 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
same errors


IceCapped
#148805 13/05/06 07:36 AM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
If you're using the same definition of 'passive' as the screenshot earlier, I told you, nothing is actually selected there, so .sel will always be 0.

#148806 13/05/06 10:54 AM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
well if .sel is always 0
then why doesnt this code prevent it ?

if ($did(listme,100).sel == 0) { did -b listme 901 }

or it is impossible to have this kind of "detection" :P ?

sorry for being dumb smile


IceCapped
#148807 13/05/06 03:14 PM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Where abouts is that if statement?

#148808 13/05/06 03:55 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
on *:dialog:listme:sclick:901:{
did -d listme 100 $did(listme,100).sel
if ($did(listme,100).sel == 0) { did -b listme 901 }
if (!$did(listme,100).lines) { did -b listme 901 }
}

i put it before line detection


IceCapped
#148809 13/05/06 04:24 PM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Try this:

Code:
on *:dialog:listme:sclick:901:{
  if (!$did(100).sel) || (!$did(100).lines) { 
    did -b listme 901 
    return
  }
  did -d listme 100 $did(100).sel
  did -b listme 901
}


It's not very logical to try and delete the selected item and THEN check if there's one selected :tongue:

#148810 13/05/06 04:53 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
now it dont give errors but it disables in passive remove
and when clicked on item (that IS there) it isnt enabled anymore :P

"It's not very logical to try and delete the selected item and THEN check if there's one selected"

sure is, if you want to see if there is anything left or not.


IceCapped
#148811 13/05/06 05:01 PM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Quote:
now it dont give errors but it disables in passive remove
and when clicked on item (that IS there) it isnt enabled anymore :P


Code:
on *:dialog:listme:sclick:100: did -e listme 901


Quote:
sure is, if you want to see if there is anything left or not.


Yeah, I was talking about error prevention though.

#148812 13/05/06 06:01 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
thank you so much, to all of you !
this work perfect now !!!

/me buys cookies to all


IceCapped
Page 3 of 3 1 2 3

Link Copied to Clipboard