mIRC Homepage
Posted By: _D3m0n_ Dialog help - 19/04/03 12:05 AM
ok im having a slight problem making the font color in my dialog changable thru the colors setup

this is what ive tried so far

did -i $dname 1 1 settxt color %ncl

on connect im taking and setting a variable called %ncl like

set %ncl $+($,rgb,( $+ $rgb($color(listboxtext)) $+ ),)

the variable is setting all fine and everything but still it will not set the font color accordingly ..... infact it changes to the default color of black ..... basically like its not even reading it ...... so im having a lil trouble understand how to get over this ...... whether i need to go and use hash tables to run it so it processes fast enough .... any help would be greatly appreciated

OK alil UPDATE

tried the hash tables and it still doesnt read the rbg correctly ..... it just wont set the font color thru that

any other suggestions would be greatly appreciated
Posted By: _D3m0n_ Re: Dialog help - 19/04/03 03:20 AM
ok to anyone else working on a nicklist and trying to colorize font and have it selectable ..... ive come up with a way to do it so that it works using mdx color settings

here is an alias i had to make to get the rgb value to set correctly
Code:
alias clr { return $rgb($gettok($hget(nicklist,$1),1,44),$gettok($hget(nicklist,$1),2,44),$gettok($hget(nicklist,$1),3,44)) }


which i used like this to retrieve the color variable in the hashtable like this

did -i $dname 1 1 settxt color $rg(fontcolor)


Posted By: qwerty Re: Dialog help - 19/04/03 07:47 AM
You could use evaluation brackets to 'pre-evaluate' $hget(), so that the commas in there are considered parameter separators for $rgb:
Code:
alias clr return $rgb( [ $hget(nicklist,$1) ] )
Posted By: Nimue Re: Dialog help - 19/04/03 08:56 AM
You don't need the hash table
Code:
alias clr return $color($color($1))
Posted By: Knappen Re: Dialog help - 19/04/03 09:44 AM
Is it possible to change colors in dialogs without dll`s?
Posted By: Nimue Re: Dialog help - 19/04/03 09:53 AM
If you mean text/background colors, Nope. frown
Posted By: _D3m0n_ Re: Dialog help - 19/04/03 02:23 PM
i tried that suggestion also before finding out that didnt work for me ..... ended up using the color.dll to set a color to hash table then hsaving and hloading on respective start and exit
then used the other alias ..... ty for the suggestion

and to everyone also ty for your input
Posted By: Nimue Re: Dialog help - 19/04/03 02:48 PM
"set %ncl $+($,rgb,( $+ $rgb($color(listboxtext)) $+ ),)"
Perhaps this is why it wouldn't work for you. That should be: $color(listbox text)

e.g. dll mdx/mdx.dll SetColor $dname 1 text $clr(editbox text)
Posted By: _D3m0n_ Re: Dialog help - 19/04/03 03:09 PM
actually that was a typo in my post to here ..... i did have it correctly in the script i was working on and still no go ... ive not done much with hashtables in the past and i do like the way it works now ........ altho i dont know why mirc wouldnt evaluate the rgb normaly as to set the color to a set color rather than a changable color the code is

did -i $dname 1 1 settxt color $rgb(#,#,#)

under the init dialog setting
thats why it was giving me so much trouble even trying to use it like

did -i $dname 1 1 settxt color $rgb($color(listbox text))

i cant understand why it wouldnt evalute it properly

ive actually tried several combinations and yes the couple u and the other poster had suggested probably would have worked ..... but i had already come up with a solution by using the other means and it also worked correctly for me so i left it at that ...... im slowly trying to learn more and more as the next task i wanna work on is a treeview for the channels and networks ....... i think that will be probably the hardest task ive got coming ..... again i thank you for your help ....

altho i do wish there was something inside of mirc to halt its processing of a script ...... ive tried that pause snippet thats been floating around and it just doesnt do the trick in some cases .......
Posted By: Nimue Re: Dialog help - 19/04/03 03:16 PM
Quote:
did -i $dname 1 1 settxt color $rgb($color(listbox text))

i cant understand why it wouldnt evalute it properly
The easiest way to explain that is...
//echo -a $rgb($color(action))
//echo -a $color($color(action))

See the difference? smile The second result is what mdx is expecting.
Posted By: _D3m0n_ Re: Dialog help - 19/04/03 04:47 PM
then why does

did -i $dname 1 1 settxt color $rgb(#,#,#)

work with no problem at all?
Posted By: Nimue Re: Dialog help - 19/04/03 05:05 PM
//echo -a $rgb(156,0,156)
10223772

//echo -a $rgb($color(action))
6,0,0
$color(action) returns 6, $rgb(6) returns 6,0,0 - which is not the RGB value for that color, and is not in the format mdx expects either.

//echo -a $color($color(action))
10223772
$color(action) returns 6, $color(6) returns 10223772
Posted By: _D3m0n_ Re: Dialog help - 19/04/03 08:11 PM
well damn wish i woulda knew this all before ... hahaha ty again nimue
© mIRC Discussion Forums