mIRC Homepage

Dialog Scrolling

Posted By: SnakeBite34

Dialog Scrolling - 05/12/05 02:02 AM

I've been fiddling around with the dialogs for practice but with large texts and filling them in using /did -a, I can't seem to scroll or select it like in the /uwho window. How exactly does someone do this?
Posted By: RusselB

Re: Dialog Scrolling - 05/12/05 02:51 AM

Not all dialog boxes are selectable. As for scrolling, vertical scrolling should come into play automatically as soon as the list of items exceeds the display area. Horizontal scrolling, I'm sorry to say, I've never been able to manage to get to work, although, in theory, if the text is longer than the width of the dialog box, then the horizontal scroll should come into effect automatically, like vertical scrolling does.

If you'd like me to be of more assistance, please provide the appropriate section of your code.
Posted By: genius_at_work

Re: Dialog Scrolling - 05/12/05 03:04 AM

You need to specify the hsbar/vsbar or autohs/autovs style in the objects you want to have scroll bars (hs = horizonal scroll, vs = vertical scroll). Example:

edit "",10,20 15 40 40,multi autohs vsbar

Posted By: SnakeBite34

Re: Dialog Scrolling - 05/12/05 03:19 AM

dialog test {
title "Test"
size -1 -1 800 300
tab "1", 1, 1 1 800 300
tab "2", 2
list 11 , 1 50 350 150, vsbar tab 1
Text "", 14, 355 82 400 68, tab 1
14 is the important part. To shorten the amount of things I have to provide, I will provide the pseudocode:

Clicking something in list 11 will trigger added lines to Text ID #14 which is read from an ini file. Each different item in the ini file, when read in the /did -a, is followed by a $crlf, so you could say it's somewhat like, /did -a (current text in id 14) $+ $crlf $+ (ini stuff here)

Note that the reading is not the problem. I could also do a different placing for each item, but that doesn't work either, and it's not very flexible.
Anyway, If I try to put in things that're very long into it, such as a link, it'll be cut off and things won't be viewable.

P.S. On another note, would someone care to explain how that dang scroll function works? (scroll "text", id, x y w h, style (top left bottom right horizontal range N N) ) I haven't been able to find any dialog tutorials with SCROLL function in it.
Posted By: genius_at_work

Re: Dialog Scrolling - 05/12/05 04:27 AM

Here is a possible solution for your problem. Use the following line in place of your existing id-14 line:

edit "", 14, 355 82 400 68,multi read autovs autohs tab 1

That line will cause extra long lines to extend out past the end of the box. It probably has some disadvantages, but it seems to do what you are requesting. To add text to that object, use this command:

/did -a test 14 <new text goes here> $+ $crlf

Note that you don't need to add the existing text as the -a switch appends the new text to the end.

As for the SCROLL object, I don't think that I've ever used it, so I can't be much help there.

Posted By: RusselB

Re: Dialog Scrolling - 05/12/05 06:12 AM

All that I can say, at this point, has already been said, by genius_at_work.
Posted By: ClickHeRe

Re: Dialog Scrolling - 05/12/05 11:59 AM

I'll add my share: text controls don't have scrollbars.

You will need to use an edit control which could be stripped from it's borders to look like a text control and readonly so it's non-writable.
Posted By: MikeChat

Re: Dialog Scrolling - 05/12/05 05:25 PM

well, two things, I dont think the text function in the dialog was ment for use as a list (if thats what you are doing, adding items) plus it has a width limit that you specify, wider than that and it will be cut off

as for a listbox, did -z after you have filled it, or added to it

from the help: -z resets the width of horizontal scrollbar in listbox

on *:dialog:yourdialog:init:0:{
add stuff to list
did -z yourdialog listid

on *:dialog:yourdialog:sclick:listid:{
did -whatever
did -z (if the list has changed)

remember the text in the text "", n, 1 2 3 4

is only going to be as wide as the value of "3"
© 2019 mIRC Discussion Forums