mIRC Homepage

Scrolls in dialogs

Posted By: milosh

Scrolls in dialogs - 11/03/06 04:52 PM

I have a strange problem. I want to use scrolls in my dialog, so I used this
Code:
dialog sample {
  title "Sample"
  size -1 -1 115 90
  option dbu
  ;some other stuff
  scroll "Scroll 1",10,63 32 40 11, horizontal
  button "Accept",100,48 75 30 11,ok
  button "Cancel",101,80 75 30 11,cancel
}
but I can not move scrollbar. I tried also this
Code:
On *:DIALOG:sample:scroll:10:{
  echo -s "It's working!!!"
  ;some other stuff
}
but still no luck. Can anybody help me and give me an example how to read scrollbar status and how to be able to move scrollbar right and left.
Thank you!
Posted By: MikeChat

Re: Scrolls in dialogs - 11/03/06 05:04 PM

you left out the "Range" setting
Code:
/dialog -m sample sample
dialog sample {
  title "Sample"
  size -1 -1 115 90
  option dbu
  ;some other stuff
  scroll "Scroll 1", 10, 5 32 105 10, horizontal range 0 100
  button "Accept", 100, 48 75 30 11,ok
  button "Cancel", 101, 80 75 30 11,cancel
}

on *:dialog:sample:init:0:{
  did -c sample 10 50
} 
Posted By: Zarkov

Re: Scrolls in dialogs - 11/03/06 05:08 PM

you dont have the scroll bars range set, thats why you cant move it
Code:
 
alias sample { dialog -m sample sample }

dialog sample {  
  title "Sample"  
  size -1 -1 115 90
  option dbu  
  ;some other stuff  
  scroll "Scroll 1",10,63 32 40 11, horizontal  range 0 100
  button "Accept",100,48 75 30 11,ok  
  button "Cancel",101,80 75 30 11,cancel
}

On *:DIALOG:sample:scroll:10:{  
  echo -s "It's working!!!"  
  ;some other stuff
}

 




Hmm bad timing with the reply smile
Posted By: milosh

Re: Scrolls in dialogs - 12/03/06 04:59 PM

Thank you very much!
And how do I read scrollbar state?
Posted By: MikeChat

Re: Scrolls in dialogs - 13/03/06 05:12 PM

by state I'm guessing you mean its location (and value)
added a little to your
Code:
alias sample dialog -m sample sample
dialog sample {
  title "Sample"
  size -1 -1 115 90
  option dbu
  text "", 8, 5 20 50 10, center
  text "", 9, 55 20 50 10, center
  scroll "Scroll 1", 10, 5 32 105 10, horizontal range 0 65535
  button "Accept", 100, 48 75 30 11,ok
  button "Cancel", 101, 80 75 30 11,cancel
}

on *:dialog:sample:init:0:{
  did -c sample 10 32500
  did -a sample 8 $int($did(sample,10).sel)
  did -a sample 9 $int($calc(($did(sample,10).sel / 65535) * 100)) $+ %
} 
on *:dialog:sample:scroll:10:{
  did -ra sample 8 $int($did(sample,10).sel)
  did -ra sample 9 $int($calc(($did(sample,10).sel / 65535) * 100)) $+ %
}


the short answer is $did(sample,10).sel
© 2021 mIRC Discussion Forums