mIRC Homepage
Posted By: sparta dialog question - 19/02/09 08:28 PM
I want to change the default icon in the dialog's left corner, but i can't get it to work, this is the test dialog i using.
Code:
alias test { if (!$dialog(test)) { dialog -m test test } }
dialog test { 
  title "A simple test"
  icon $mircdir\icons\ico.icl, $+ %icon <- don't work
  size 550 250 142 52
  option dbu
  button "&Ok", 1, 55 39 35 10, ok
  icon 2, 118 20 19 19, $mircdir\icons\ico.icl, $+ %icon , small <- working
}

as you see it working if i place the icon in the dialog (ID 2), but not if i try place it in the left corner, ideas please.
Posted By: LittleJohn Re: dialog question - 19/02/09 09:00 PM
Sparta try this

dialog control {
title "Control Panel (/cp)"
size -1 -1 215 155
option dbu
icon $mircdir\icons\ico.icl, $+ %icon, 0

Try placing the icon call after the Size and option. I dont have the ico.icl library For me it workes with my ICON library

Just a thaught I also gave it an ID of 0

Anyway good luck
Posted By: sparta Re: dialog question - 19/02/09 10:16 PM
Didn't work, any other ideas? smirk im stuck here and want do fix this dialog before bed time.. smirk

;---- Edit

it's like the %var isn't there, or the number i add isn't there..
Posted By: Wims Re: dialog question - 19/02/09 10:51 PM
I cant understand why you can't figure this out by yourself, I'm sure you don't even tried with another icon file...
A simple test using $mircexe and a number show that you can't use a %var as an index number here (bug?).
Posted By: argv0 Re: dialog question - 19/02/09 11:10 PM
Not a bug, just unimplemented behaviour-- %vars don't work in dialogs unless in places specified explicitly in the help or versions.txt. A feature suggestion would be the way to go.
Posted By: Horstl Re: dialog question - 19/02/09 11:14 PM
But custom identifiers don't work either, be it to return the filepath and indexNr, or the indexNr only (At least I don't get it work). Custom identifiers work well to return an iconpath - it's all about the index number parsing.

Assume you have:
Code:
alias myicon { return $mircexe  }
alias myicon2 { return $mircexe , 10 }
alias iconnr { return 10 }

work:
Code:
icon $mircexe , 10
icon $myicon
icon $myicon , 10

don't work:
Code:
icon $myicon2
icon $myicon , $iconnr
icon $mircexe , $iconnr

Posted By: sparta Re: dialog question - 19/02/09 11:23 PM
Originally Posted By: Wims
I cant understand why you can't figure this out by yourself, I'm sure you don't even tried with another icon file...


I tested with the 19 icons i have stored in my *.icl file (in different formats, depending on where they are used), i also tested to call a alias that return the full path to the *.icl file and the icon i wanted to use, and been testing it a couple of hours now, and since i can use it in the dialog as a id i believed it could be used in the left corner too (with a %var), if it working on one place, why not on the other.. that's why i asked here. so don't say i didn't try if before i asked. and i guess i need to make two dialogs, only two that need the icons to be set true %var, it's my error and info dialog, tested to make them both of one, just change the text before i opened the dialog, using a %var for the text too.
Posted By: sparta Re: dialog question - 19/02/09 11:24 PM
Thnx, i think i need to remake the dialog. and make two instead of one smile
Posted By: Horstl Re: dialog question - 19/02/09 11:30 PM
Maybe I missed some simple workaround.
For the moment I'd separate the *.icl file to individual icons and use a custom identifier that returns path and filename, where the individual filenames may be your %variable or get passed as parameter.
Posted By: Wims Re: dialog question - 19/02/09 11:51 PM
Lol ok, sorry, but this mean that you're asking wrong question to yourself, use the Horstl's suggestion and make a feature request, a /dialog switch could be added to change this too
Posted By: sparta Re: dialog question - 19/02/09 11:52 PM
I was hoping it could be solved with a switch, like you can change a existing icon in a dialog with the -g switch (even if the icon is called from a %var), and i can't figure out what the %var should do, if you do //echo -a %var it echo 2, and if i place a 2 instead of the %var it working, well i just try a bit more before i giving it up and make 2 dialogs instead. smile thnx for the help.. smile
Posted By: DJ_Sol Re: dialog question - 20/02/09 12:37 AM
This is what I do.

dialog invite {
title "Invite"
size -1 -1 160 80
option dbu
icon %tbar

On my start event if (!%tbar) I set it to the default:

set %tbar imgs\1x.ico


Granted this isnt an icon library so I dont need to use the index. Hope this helps. smile
Posted By: sparta Re: dialog question - 20/02/09 01:21 AM
I need to change the icon depending on what it is, if it's a error i need one icon, if it's a information i need another one, and that's the problem. smirk i made two dialogs and calling them depending on what i need. thnx for the example tho smile maybe it's the icon library that creating the problem, but since i don't want like 30+ icons in one folder i stick with the icon library smile
Posted By: DJ_Sol Re: dialog question - 20/02/09 02:46 AM
Icon libraries are best for sure. What abotu changing the variable, closing the dialog and re-opening it?
Posted By: sparta Re: dialog question - 20/02/09 10:45 AM
it didn't show up at all.. that's why i end up with 2 dialogs instead of one, then i can use a number instead of the %var.. smirk
Posted By: vexed2 Re: dialog question - 21/02/09 05:29 PM
I don't see how this is a problem.
I have the same kind of thing, a certain icon for a different situation on the same dialog.


icon system/icon/panel.icl,12

Then change the number for the corresponding icon in the .icl
etc..
Posted By: Horstl Re: dialog question - 21/02/09 06:01 PM
How do you call this 12 dynamically (variable / identifier) ?
Posted By: vexed2 Re: dialog question - 21/02/09 06:10 PM
I'm not using one, 12 represents the 12th icon in the library.
The dialog closes and re-opens giving the effect of icon change.
Works perfectly.
The only other alternative is to use DCX. I use this method as well for an Sbar.
Posted By: argv0 Re: dialog question - 21/02/09 06:21 PM
how exactly does the dialog close and reopen to give the "effect of" an icon change? Isn't this "12" in there the whole time? Or are you adding it to the remote file dynamically?
Posted By: sparta Re: dialog question - 21/02/09 07:11 PM
closing the dialog and change the icon that way, it would look like it open a new dialog every time it change the icon. since the icon's aren't the same but the dialog is, and i couldn't get it to show any icon when using a %var.

first: /set %var 12
then open your dialog: icon system/icon/panel.icl, %var

it wont work, not on the one in the left corner of the dialog..
Posted By: RusselB Re: dialog question - 21/02/09 08:17 PM
While I don't have a solution for this problem (I'm still trying different options as I think of them), the icon that you are referring to, while it is at the top left hand corner of the dialog, it's also in the titlebar of the dialog.

Hmm.. that just gave me one more idea to try.

Sorry to say that I'm still having no luck in managing to do what you are trying to do.
Posted By: sparta Re: dialog question - 21/02/09 08:41 PM
I know, it's impossible but i guess it can be done with a dll or something, how ever i don't like to use to many dll files.. smirk
Posted By: RusselB Re: dialog question - 21/02/09 08:47 PM
Likewise, and while I haven't tried this option yet, I have found the dll that works the best regarding dialogs to be DCX

Posted By: sparta Re: dialog question - 21/02/09 08:48 PM
ok, using mdx for my other dialogs.. smile
© mIRC Discussion Forums