mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
#146554 06/04/06 12:18 AM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
i have a lil problem in how mdx shows dialog:




this is the code, code in RED should be vital, can anyone tell me how to fix it ?
i have last mdx made

Code:
 
on *:dialog:Themes:init:0:{
  dll $mircdirsystem\dlls\mdx.dll MarkDialog $dname 
  dll $mircdirsystem\dlls\mdx.dll SetMircVersion $version
  dll $mircdirsystem\dlls\mdx.dll SetControlMDX $dname 2 ListView headerdrag report rowselect flatsb showsel nosortheader single > $views 
 [color:red] 
  did -i $dname 2 1 headerdims 130:1 110:2 90:3 200:4 
  did -i $dname 2 1 headertext +l 0 Theme $chr(9) +l 0 Author $chr(9) +l 0 Background $chr(9) +l 0 Description
 [/color] 
  dll $mircdirsystem\dlls\mdx.dll SetFont $dname 2 12 1 verdana 
  dll $mircdirsystem\dlls\mdx.dll SetFont $dname 1 12 1 verdana 
  dll $mircdirsystem\dlls\mdx.dll SetFont $dname 3 12 1 verdana  
...
...
}
 


and should be look like:



this is on mirc 6.16 (no longer using 6.03 laugh)

Last edited by raZOR; 06/04/06 12:36 AM.

IceCapped
#146555 06/04/06 04:04 AM
Joined: Dec 2002
Posts: 580
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 580
Your problem might actually be that you are missing a $views aliases?


NaquadaBomb
www.mirc-dll.com
#146556 06/04/06 09:21 AM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
yes, you were right, i did missed it.
thank you, very much apreciated.


IceCapped
#146557 06/04/06 12:17 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
not to spam new thread, why not continue here ?
i shortened problem as much as i could :P

anyways, picture of dialog (the last one) is seen above
so it is MDX list box, i have 5 objects to select on list
while 6th object are those tabs(with names)

problem i got is this:

this alias:
Code:
 
alias _loadthmfile { 
  tokenize 32 $1- 
  .load -a themes\ $+ $1 $+ .dom 
}
 



should READ from that listbox and according to 1st field (theme name), should load file with exact name
so if it is clicked on BLACK theme, it should read from 1st field the name Black, and thru this alias load Black.dom




now this code below should (i guess) mark the line
on list box what is selected....


Code:
  
 _loadthmfile $did(themes,2,$did(themes,2).sel)
  


so i ask anyone who knows MDX, is this last code (above)
correct for last MDX version ?

coz when i click on the selected line in dialog and try to load a file, instead names (Black, White, Asure etc... whatever name is) it wont load file of same name (Black.dom, White.dom) etc... but it tries to load based on OBJECT number, so in this case
if Black is last on list, it would be object 6 and it tries to load 6.dom and not Black.dom (by name)

....
long and confusing thread no? :P
but i myself can't figure out this coz i dont know mdx well
so i ask any hint possible.

Last edited by raZOR; 06/04/06 12:24 PM.

IceCapped
#146558 06/04/06 03:53 PM
Joined: Dec 2002
Posts: 580
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 580
Quote:
anyways, picture of dialog (the last one) is seen above
so it is MDX list box, i have 5 objects to select on list
while 6th object are those tabs(with names)

problem i got is this:

Code:
 
alias _loadthmfile { 
  tokenize 32 $1- 
  .load -a themes\ $+ $1 $+ .dom 
}

 _loadthmfile $did(themes,2,$did(themes,2).sel)


coz when i click on the selected line in dialog and try to load a file, instead names (Black, White, Asure etc... whatever name is) it wont load file of same name (Black.dom, White.dom) etc... but it tries to load based on OBJECT number, so in this case if Black is last on list, it would be object 6 and it tries to load 6.dom and not Black.dom (by name)


First change "$did(themes,2,$did(themes,2,1).sel)" to "$did(themes,2,$did(themes,2,1).sel).text". The "1" I added is probably not needed but it is saying that you want the first selected item.

When you use "$did(themes,2,$did(themes,2).sel).text" you are getting a text line that looks like a line from your first image. That's because when you create an MDX control it doesn't change the listbox (or host control), it simply use this control to determine how the MDX control should look. $did() can not directly access the MDX control.

In the alias "_loadthmfile" try "tokenize 9 $1-" or "tokenize 9 $remove($1-, $chr(32))" instead of "tokenize 32 $1-". Then use $3 to get your color.

Last edited by NaquadaServ; 06/04/06 03:59 PM.
#146559 06/04/06 04:45 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
firstly, thank you for replying

secondly:

if i use old "tokenize 32 $1-"
i get * /load: no such file 'C:\mirc\themes\.dom
(obviously it cant find any name)

when i use:
tokenize 9 $1
i get error * /load: no such file 'C:\mirc\themes\.dom

when i use
tokenize 9 $remove($1-, $chr(32))
* /load: no such file 'C:\mirc\themes\+fs000White.dom
* /load: no such file 'C:\mirc\themes\+fs000LightBlue.dom

where white or LightBlue behind +fs000 are just named backgrounds(of theme, so not theme name but just background for some alias that uses it) on listbox

where this +fs000 i have NO idea what is nor do i find it in
script at all...

any random ideas ?

Last edited by raZOR; 06/04/06 04:46 PM.

IceCapped
#146560 06/04/06 05:47 PM
Joined: Dec 2002
Posts: 580
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 580
Quote:
if i use old "tokenize 32 $1-"
i get * /load: no such file 'C:\mirc\themes\.dom
(obviously it cant find any name)

when i use:
tokenize 9 $1
i get error * /load: no such file 'C:\mirc\themes\.dom

when i use
tokenize 9 $remove($1-, $chr(32))
* /load: no such file 'C:\mirc\themes\+fs000White.dom
* /load: no such file 'C:\mirc\themes\+fs000LightBlue.dom

where white or LightBlue behind +fs000 are just named backgrounds(of theme, so not theme name but just background for some alias that uses it) on listbox

where this +fs000 i have NO idea what is nor do i find it in
script at all...


No problem, glad to help. smile

+fs000 is extra options that MDX adds.

Try this using "tokenize 9 $1-", after the tokenize write an echo command like "echo -a $1 : $2 : $3 : $4 : $5 : $6 : $7", to see which argument is equal to the one you want. Then use that argument instead of $1. It's probably going to be $4 or higher.


NaquadaBomb
www.mirc-dll.com
#146561 06/04/06 06:11 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
thanks again for reply =)

now i gots this

echo:
1 +fs 0 0 0 Black : +fs 0 0 0 pRonEtIvAgO : +fs 0 0 0 Black : +fs 0 0 0 Default theme of Domination : : :


error:
* /load: no such file 'C:\mirc\themes\+fs'

--------------

now 2 things puzzles me:

1. i have set it to read $3, in error it says that it reads "+fs"
but according to echo, +fs is $2

2. everything between $1and $5 (so 2-4) shows:
* /load: no such file 'C:\mirc\themes\+fs

everything above $4 shows:
* /load: no such file 'C:\mirc\themes\.dom

so again it cannot actually find anything (weird)

any ideas ?


IceCapped
#146562 06/04/06 08:18 PM
Joined: Dec 2002
Posts: 580
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 580
Quote:
echo: 1 +fs 0 0 0 Black : +fs 0 0 0 pRonEtIvAgO : +fs 0 0 0 Black : +fs 0 0 0 Default theme of Domination : : :


Try this... I use tokenize twice to get at the specific word you want...
Code:
alias _loadthmfile { 
  tokenize 9 $1-
  tokenize 32 $3
  .load -a themes\ $+ $5 $+ .dom 
}


NaquadaBomb
www.mirc-dll.com
#146563 06/04/06 08:49 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
thanks for replying again ^^

very close Naquada laugh
but a bit far hehehe

echo: 1 +fs 0 0 0 Black : +fs 0 0 0 pRonEtIvAgO : +fs 0 0 0 Black : +fs 0 0 0 Default theme of Domination : : :

you took second black (which i colored here in red)

and i need 1st one (colored in green here)
if you ask how do i know, here is list of themes (notice greened words)

echo: 1 +fs 0 0 0 Black : +fs 0 0 0 pRonEtIvAgO : +fs 0 0 0 Black : +fs 0 0 0 Default theme of Domination : : :

echo: 1 +fs 0 0 0 Asure : +fs 0 0 0 Raptor : +fs 0 0 0 Light Blue : +fs 0 0 0 Asure theme of Domination : : :

echo: 1 +fs 0 0 0 IceCap : +fs 0 0 0 Raptor : +fs 0 0 0 Teal : +fs 0 0 0 IceCap theme of Domination : : :

so i get then this errors

* /load: no such file 'C:\mirc\themes\Light.dom'
-
* /load: no such file 'C:\mirc\themes\Teal.dom'

which script tries to load :P
btw i tired with $1-5 still nothing
and logically $5 SHOULD be correct one... but it doesnt do it confused

~edit~
on the other hand

with just 1 echo (i used 2 echos previous)
i get this

+fs : 0 : 0 : 0 : Teal : :
+fs : 0 : 0 : 0 : Light : Blue :

which means he cant grab firs field with true names ?

Last edited by raZOR; 06/04/06 09:13 PM.

IceCapped
#146564 07/04/06 02:23 AM
Joined: Dec 2002
Posts: 580
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 580
Try this...

Code:
alias _loadthmfile {
   tokenize 9 $1-
   tokenize 32 $1 
  .load -a themes\ $+ $5 $+ .dom
}


NaquadaBomb
www.mirc-dll.com
#146565 07/04/06 11:27 AM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
Hi ! it works (just with $6) hehe

omg, i dont know how to thank you, you really helped me much !

thank you Naquada i really really apreciate it !

~also this is a bit too much to ask now. but umm
are you willing to help me with another problem regarding same dialog ?

if no its ok.. just asking =)

thanks again.

Last edited by raZOR; 07/04/06 11:28 AM.

IceCapped
#146566 07/04/06 03:29 PM
Joined: Dec 2002
Posts: 580
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 580
You're welcome. smile

I might be able to help, what's the other problem???


NaquadaBomb
www.mirc-dll.com
#146567 07/04/06 03:57 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
reimaging



if you look on right side, you see preview window, on some bizzarre irony it wont show any theme preview at all...

now this code might be longish :P
and clumzy (i didnt made it :tongue: just trying to make it work on new mirc)

Code:
 
dialog Themes {
  title "Themes"
  size -1 -1 263 120
  icon $mircdirsystem\domin.icl, 10
  option dbu
  box "", 4, 4 12 256 91
  box "", 9, 4 12 137 91
  text "Current theme: ", 1, 4 4 40 6
  text $theme(name), 3, 44 4 100 6
  list 2, 5 16 134 86, size
  button "&Load", 5, 205 107 27 10
  button "&Close", 8, 232 107 27 10, cancel
  button "&Hide", 99, 0 0 0 0, hide Ok
  ;text "- Preview Window -", 17, 175 8 54 6
  icon 50, 142 17 116 84
}

on *:dialog:Themes:init:0:{
  dll $mircdirsystem\dlls\mdx.dll MarkDialog $dname 
  dll $mircdirsystem\dlls\mdx.dll SetMircVersion $version
  dll $mircdirsystem\dlls\mdx.dll SetControlMDX $dname 2 ListView headerdrag report rowselect flatsb showsel nosortheader single > $views 
  did -i $dname 2 1 headerdims 130 110 90 200 
  did -i $dname 2 1 headertext Theme $chr(9) Author $chr(9) Background $chr(9) Description
  dll $mircdirsystem\dlls\mdx.dll SetFont $dname 2 12 1 verdana 
  dll $mircdirsystem\dlls\mdx.dll SetFont $dname 1 12 1 verdana 
  dll $mircdirsystem\dlls\mdx.dll SetFont $dname 3 12 1 verdana  
  var %n = 0 
  While (%n < $findfile(themes,*.dom,0)) { 
    did -a $dname 2 $calc(%x +1) $readini($findfile(themes,*.dom,$calc(%n +1)),info,name) $chr(9) $readini($findfile(themes,*.dom,$calc(%n +1)),info,author) $chr(9) $readini($findfile(themes,*.dom,$calc(%n +1)),info,background) $chr(9) $readini($findfile(themes,*.dom,$calc(%n +1)),info,description) 
    inc %n
  }
}

on 1:dialog:themes:sclick:5: { _loadthm }
on 1:dialog:themes:sclick:2: { previewtheme }
on 1:dialog:themes:dclick:2: { _loadthm }

....
rest is not important coz its more for LOADING themes
which you fixed
 


in this case this should matter:

Code:
  

alias previewtheme { 
 [color:green] 
;you add here your new theme preview alias
;like i said above (just for background, black, teal, green atc...)
;from where window reads some values of font, background
;to display in this preview window
 [/color] 
  if ($gettok($did(themes,2,$did(themes,2).sel),7,32) == Black) { did -v themes 50 | preview-black } 
  elseif ($gettok($did(themes,2,$did(themes,2).sel),7,32) == White) { did -v themes 50 | preview-white } 
  elseif ($gettok($did(themes,2,$did(themes,2).sel),7,32) == Teal) { did -v themes 50 | preview-teal } 
  elseif ($gettok($did(themes,2,$did(themes,2).sel),7,32) == Blue) { did -v themes 50 | preview-light_blue } 
  else { did -v themes 50 | nopreview }
}

alias nopreview { 
 [color:green] 
;this should be section where he cant get preview so
;as on image (above) shows "no preview aveliable"
 [/color] 
  window -c @themes 
  if ($window(@themes) == $null) { 
    window -ph +d @themes 300 200 229 165 verdana 11 
    drawfill @themes 0 0 0 0 
  } 
  var %. = drawtext -p @themes 1 verdana 10 x  
  %. 76 01,00 $str($chr(160),7) Preview not available! 
  drawsave @themes themes\thmprvw.bmp 
  if $dialog(themes) { 
    did -g themes 50 themes\thmprvw.bmp
  } 
  .remove themes\thmprvw.bmp 
  window -c @themes 
}



here comes main part, the preview alias of each theme based on background as stated above.
Here is BLACK theme example:


Code:
 
alias preview-black {
  var %temp = $theme(name) | If (%temp == $null) { .nopreview | halt }
  did -v themes 50
  var %thm.file $mircdirthemes\ $+ $theme(name) $+ .dom
  .unload -a %thm.file
  _loadthmfile $did(themes,2,$did(themes,2).sel)
  var %rgb = 0 | while (%rgb < 16) { color -r %rgb | inc %rgb }
  var %temp = $readini themes\ $+ $theme(name) $+ .dom colours rgb | if (%temp != $null) {  _rgb $readini themes\ $+ $theme(name) $+ .dom colours rgb }
  window -c @themes
  if ($window(@themes) == $null) { window -ph +d @themes 300 200 229 165 verdana 11 | drawfill @themes 1 1 1 1 }
  var %. = drawtext -pb @themes 0 1 verdana 10 x 
  %. 4 $str($chr(160),1) $theme(joinme,#domination) $str($chr(160),7) 
  %. 16 $str($chr(160),1) $theme(me,$me,is choosing a theme!) $str($chr(160),7) 
  %. 28 $str($chr(160),1) $theme(nick,$me,Guest376705) $str($chr(160),7) 
  %. 40 $str($chr(160),1) $theme(notice,Nickserv,Password accepted now you can [censored] off!) $str($chr(160),7) 
  %. 52 $str($chr(160),1) $timestamps $+ $theme(logo)  $+ $gettok($readini(system\ $+  $theme(name) $+ .dom,colours,colours),12,44) $+ Can't change Nick while you're banned $str($chr(160),7)
  %. 64 $str($chr(160),1) $theme(attention,TCP Alert in port 80 (http) from $IP) $str($chr(160),7) 
  %. 76 $str($chr(160),1) $theme(quit,rOlling,Quit: Ping timeout) $str($chr(160),7)
  %. 88 $str($chr(160),1) $theme(echoaway,Off - away time: 17s) $str($chr(160),7)
  %. 100 $str($chr(160),1) $theme(joins,Raptor,domi@raptor.tech.nu) $str($chr(160),7)
  %. 112 $str($chr(160),1) $theme(part,$me,id@localhost) $str($chr(160),7)
  %. 124 $str($chr(160),1) $theme(metext,$me,Hi! How are you?)
  %. 136 $str($chr(160),1) $theme(wsl,pRonEtIvAgO)
  %. 148 $str($chr(160),1) $theme(raw311name,pRonEtIvAgO,www.domination.pt.vu)
  drawsave @themes themes\thmprvw.bmp
  if $dialog(themes) { did -g themes 50 themes\thmprvw.bmp }
  .remove themes\thmprvw.bmp
  .unload -a themes\ $+ $theme(name) $+ .dom
  .load -a %thm.file
  var %rgb = 0 | while (%rgb < 16) { color -r %rgb | inc %rgb }
  var %temp = $readini themes\ $+ $theme(name) $+ .dom colours rgb | if (%temp != $null) {  _rgb $readini themes\ $+ $theme(name) $+ .dom colours rgb }
  window -c @themes
}

 


any help would be greatly apreciated =)


IceCapped
#146568 07/04/06 04:15 PM
Joined: Dec 2002
Posts: 580
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 580
Quote:
Code:
 
alias preview-black {

  ...

  _loadthmfile $did(themes,2,$did(themes,2).sel)

  ...

}
 



One thing I noticed is that you are using "$did(themes,2,$did(themes,2).sel)" here too... Remember the string $did returns is formated.


NaquadaBomb
www.mirc-dll.com
#146569 07/04/06 04:43 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
sorry for being stupid smirk
i dont understand what you meant ?


IceCapped
#146570 08/04/06 12:06 AM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
umm if you meant to replace it with
_loadthmfile $did(themes,2,$did(themes,2,1).sel).text
as in previous case, i have and still nothing


IceCapped
#146571 08/04/06 12:54 PM
Joined: Dec 2002
Posts: 580
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 580
Not really sure what the problem is, your scripting style is confusing a bit... wink

If you could be more specific as to the problem. Also totaly don't know what $theme is doing...

Sorry for the delay, the web site's connectivity was crappy yesterday.


NaquadaBomb
www.mirc-dll.com
#146572 08/04/06 01:20 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
dont apologyse smile
i apreciate any help given, since not many people want to bug with this (i already asked few hehe)

as for scripting style, it is not mine :P
author of script abandoned script support ages ago, and
i just want to make it compatible so it can run on mirc 6.16 and above using latest mdx... (which script didnt)
if it was mine style i would probably fix it myself laugh

as for problem. i try to explain again:

in image you see
left side(list box): description of themes, name, author, background type

on right side you see "preview window"
when user clicks (only once) on list box name(theme)
it should generate how theme should look (and it did worked on mirc 6.0x series with older mdx).

so problem is now (when i added last mdx so it can run on winxp) that on click it wont generate any preview at all

as for $theme, it is identifier that just reads some basic settings from theme.dom

like you see in alias (up) of black theme:
Code:
 
$theme(part,$me,id@localhost)

it would read from theme file this:

:part | return 10Part:0 $2 10(15 $+ $replace($3,@,10@15 $+ ) $+ 10)15 has left $4
 


and such.. just coloring and some raw return info
----
offcourse if you are willing, and if you have time
i can upload whole thing (just this theme things)
for analisys if you think that would make it easier for tracking down something. i try on this board to narrow it down
altho i might not be good at it :P

Last edited by raZOR; 08/04/06 01:21 PM.

IceCapped
#146573 11/04/06 02:54 PM
Joined: Dec 2002
Posts: 580
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 580
These parts in preview theme would need to change...

$gettok($did(themes,2,$did(themes,2).sel),7,32) same way that _loadthm changed.


NaquadaBomb
www.mirc-dll.com
Page 1 of 2 1 2

Link Copied to Clipboard