mIRC Home    About    Download    Register    News    Help

Print Thread
Scrolls in dialogs #144548 11/03/06 04:52 PM
Joined: Dec 2003
Posts: 261
M
milosh Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Dec 2003
Posts: 261
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!


velicha dusha moja Gospoda
Re: Scrolls in dialogs #144549 11/03/06 05:04 PM
Joined: Dec 2002
Posts: 1,245
M
MikeChat Offline
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
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
} 

Re: Scrolls in dialogs #144550 11/03/06 05:08 PM
Joined: Mar 2006
Posts: 12
Z
Zarkov Offline
Pikka bird
Offline
Pikka bird
Z
Joined: Mar 2006
Posts: 12
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

Last edited by Zarkov; 11/03/06 05:09 PM.
Re: Scrolls in dialogs #144551 12/03/06 04:59 PM
Joined: Dec 2003
Posts: 261
M
milosh Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Dec 2003
Posts: 261
Thank you very much!
And how do I read scrollbar state?


velicha dusha moja Gospoda
Re: Scrolls in dialogs #144552 13/03/06 05:12 PM
Joined: Dec 2002
Posts: 1,245
M
MikeChat Offline
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
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