mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
help with text in dialog #94830 20/08/04 06:23 AM
Joined: Aug 2004
Posts: 423
C
clutz1572 Offline OP
Fjord artisan
OP Offline
Fjord artisan
C
Joined: Aug 2004
Posts: 423
i was wondering if there is a way to have a text box with scroll feature. in my dialog i want to have it so if i have tabs for info on diff things(sorta like a help system), i want to be able to enter the text and have a scroll bar for when it exceeds the veiwing area so ppl can scroll up or down..

is this possible?

Re: help with text in dialog #94831 20/08/04 09:09 AM
Joined: Dec 2002
Posts: 788
C
Coolkill Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788
You would use something like:

edit "",14, 11 25 90 60, multi vsbar return

Which creates an editbox with multiple lines and a vertical scroll bar where 'return' will goto the nextline.

i.e. The following uses mIRC's helpfile example to include tabs.

dialog test {
title "mIRC"
size -1 -1 110 100
option dbu

tab "m", 1, 5 5 100 90
tab "I", 2
tab "R", 3
tab "C", 4

button "m is for ... wink", 11, 30 50 50 24, ok tab 1
button "I is for Internet", 12, 30 50 50 24, tab 2
button "R is for Relay", 13, 30 50 50 24, tab 3
edit "",14, 11 25 90 60, multi vsbar return tab 4
}

Places the editbox on the 4th tab. To add contents to the editbox, when the dialog opens you can use something like;

On *:dialog:test:Init:*:{
did -a $dname 14 A $+ $crlf $+ B $+ $crlf $+ C $+ $crlf $+ D $+ $crlf $+ E $+ $crlf $+ F $+ $crlf $+ G $+ $crlf $+ H $+ $crlf $+ I $+ $crlf $+ J
}

Where, the $crlf is basically a new line, the above makes A-J appear in the box all on differnet lines.

Eamonn.

Re: help with text in dialog #94832 20/08/04 11:25 AM
Joined: Feb 2004
Posts: 2,019
FiberOPtics Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Hi,

wouldn't something like didtok $dname 14 32 A B C D E F G H I J be simpler, and give better overview than using crlf's?

Or maybe did -a $dname 14 $replace(A B C D E F G H I J,$chr(32),$crlf)


Anyway, you probably didn't want to make it too complex for the requester, which is why you did it the "manual" way, I suppose.

Greets



Gone.
Re: help with text in dialog #94833 20/08/04 12:32 PM
Joined: Dec 2002
Posts: 788
C
Coolkill Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788
Yup they would both work perfectly fine for my example, although you would need to use something other than $chr(32) since that would mean they wouldnt be able to have spaces in their text smile

Eamonn.

Re: help with text in dialog #94834 20/08/04 12:46 PM
Joined: Feb 2004
Posts: 2,019
FiberOPtics Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Yeah I know :tongue:

I'll usually use ctrl+o or some other char that can't be in a string anyway. Makes it less messy cuz you don't need $+ ' s, unless your dealing with variables/identifiers of course, hehe.

didtok $dname 14 15 A BC D E FG H IJ

Anyway, we're on the same page here, cya around!


Gone.
Re: help with text in dialog #94835 20/08/04 05:40 PM
Joined: Aug 2004
Posts: 423
C
clutz1572 Offline OP
Fjord artisan
OP Offline
Fjord artisan
C
Joined: Aug 2004
Posts: 423
thank you guys very much! both strings work good but i'm gonna go with the didtok string. it's cleaner smile

no in the mirc help file where can i find info on the hot keys so i can lookup what ctrl +o is and what it does.. i've search but couldn't find it.. or a alternative source maybe??.,.... anyways thanks a bunch!!!

and i know this is repeated a billion times(but never sunk in till now) the mirc help file is your friend... lol, it's true- till next question bye

Re: help with text in dialog #94836 20/08/04 05:47 PM
Joined: Feb 2004
Posts: 2,019
FiberOPtics Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Hi,

you're welcome.

The ctrl+o thing: hold ctrl, and press o (thats an o not a zero)

It's called a "shift in" and is represented by ascii number 15. You can see it also by doing //echo -a $chr(15). In mIRC, ctrl+o inserts a control code for plain text, but since you're tokenizing on that string, it has no meaning then, and is only used as a means to achieve something.

/help control codes

The reason ctrl+o is good, is because the odds that you will use them in a string, or in any incoming string is almost nihil, unlike a space $chr(32), so that you'll be sure that the tokenized params are filled with the right contents. I'd even prefer using $lf or $cr, but then you need the $+ identifiers to paste text together, which you don't with the shift in. Note that there are more chars that can be used, I just happen to use this one often, hehe. This probably doesn't make much sense to you, so just consider it as a handy trick smile

Btw if you're interested to see the ASCII chars with their according decimal values: ascii table

Greets

Last edited by FiberOPtics; 20/08/04 06:10 PM.

Gone.
Re: help with text in dialog #94837 20/08/04 06:25 PM
Joined: Aug 2004
Posts: 423
C
clutz1572 Offline OP
Fjord artisan
OP Offline
Fjord artisan
C
Joined: Aug 2004
Posts: 423
ok now i have another question..... i've looked up in the mirc help the control code(s).... but, now when i try to use the ctrl+b code it doesn't appear as bold in the dialog..??? any thoughts why this is.. all i see is two control marks (i'm guessing thats what they are) but i want to make like one word out of the text bold.. is there a trick to it?

Re: help with text in dialog #94838 20/08/04 06:36 PM
Joined: Dec 2002
Posts: 788
C
Coolkill Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788
There is no trick, mIRC dialogs do not support colour codes.

Eamonn.

Re: help with text in dialog #94839 20/08/04 06:40 PM
Joined: Feb 2004
Posts: 2,019
FiberOPtics Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
That's normal behaviour.

mIRC won't translate the color codes in the edit box. I'm afraid there's no way to do with the built-in commands. You're probably going to have to look for a .dll to do this for you. Perhaps mdx.dll can do it, haven't checked.

Greets


Gone.
Re: help with text in dialog #94840 21/08/04 03:57 AM
Joined: Aug 2004
Posts: 423
C
clutz1572 Offline OP
Fjord artisan
OP Offline
Fjord artisan
C
Joined: Aug 2004
Posts: 423
okay, i see ...
i have read something about the color codes and not able to use'em in dialog.. i just didn't realize bold was one of'em..

Re: help with text in dialog #94841 21/08/04 08:20 PM
Joined: Aug 2004
Posts: 423
C
clutz1572 Offline OP
Fjord artisan
OP Offline
Fjord artisan
C
Joined: Aug 2004
Posts: 423
is there a way to have the text from a .txt file load in the edit box, instead of having fifty billion lines of text code???

i'm trying to ref the mirc help and this is what i've got so far
...
Code:
if ($scriptdir) && (isfile(help.txt) {
  $read(help.txt,w) $dname 7 }
else echo -s FILE DOES NOT EXIST $dname
  


i know i'm not close to it at all(but just to show i'm trying wink )

if anyone would be nice as to lend a word of help or advice.
thanks

Re: help with text in dialog #94842 21/08/04 08:24 PM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
loadbuf $lines($mircdir\texst.txt) -o $dname ID $mircdir\texst.txt

and load it to a list .. that would help you "i hope" wink


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Re: help with text in dialog #94843 21/08/04 08:31 PM
Joined: Aug 2004
Posts: 423
C
clutz1572 Offline OP
Fjord artisan
OP Offline
Fjord artisan
C
Joined: Aug 2004
Posts: 423
wholy cow that was a fast response!....

i'll give it a try.....

thanks

Re: help with text in dialog #94844 21/08/04 08:34 PM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
just remember to set the "list" as the ID u send the loadbuf to.. then it would work just fine.. smile


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Re: help with text in dialog #94845 21/08/04 08:36 PM
Joined: Aug 2004
Posts: 423
C
clutz1572 Offline OP
Fjord artisan
OP Offline
Fjord artisan
C
Joined: Aug 2004
Posts: 423
okay now what does this mean??

/loadbuf: unable to open 'C:\PROGRAM'

this is what came up when i used that code
any thoughts?

Re: help with text in dialog #94846 21/08/04 08:38 PM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
u have the file in "program files/mirc" ?


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Re: help with text in dialog #94847 21/08/04 08:59 PM
Joined: Aug 2004
Posts: 423
C
clutz1572 Offline OP
Fjord artisan
OP Offline
Fjord artisan
C
Joined: Aug 2004
Posts: 423
yes it's in c:\program files\mirc

does that make if big difference?


Re: help with text in dialog #94848 21/08/04 09:09 PM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
try use:
Code:
$lines(" $+ $mircdir\texst.txt $+ ") -o $dname ID " $+ $mircdir\texst.txt $+ "


and see if that helps


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Re: help with text in dialog #94849 21/08/04 09:23 PM
Joined: Aug 2004
Posts: 423
C
clutz1572 Offline OP
Fjord artisan
OP Offline
Fjord artisan
C
Joined: Aug 2004
Posts: 423
now it's saying this:
/loadbuf: invalid parameters (line 73, script2.ini)

Page 1 of 2 1 2