mIRC Home    About    Download    Register    News    Help

Print Thread
#77054 28/03/04 08:44 PM
Joined: Mar 2004
Posts: 26
U
Ameglian cow
OP Offline
Ameglian cow
U
Joined: Mar 2004
Posts: 26
I am trying to use an icon within the dialog window itself, not in the title bar.

I have set the path to the icon to a variable using $findfile.

Code:
on *:load: { set -n %renepic $findfile(C:\,renemp3ic0n.bmp,1)


The variable stores the path correctly.

Code:
dialog lilmp3 {
  title "reneMPĀ³"
  size -1 -1 370 340
  option pixels
  icon 1, 312 13 41 48,%renepic
  ......


//echo %renepic yeilds: C:\3515\renemp3ic0n.bmp (which is the correct location of the .bmp)

Upon first execution of the dialog, it displays everything properly.

The problem comes when the dialog is closed , and on next start.

* /dialog: 'lilmp3' error loading icon '0 C:\3515\renemp3ic0n.bmp'

I am not sure what/where/why the area in red from the error message is there, but it seems to be what is causing my problem:

* /dialog: 'lilmp3' error loading icon '0 C:\3515\renemp3ic0n.bmp'

If I merely use the path itself in the dialog table it works perfectly, only when I introduced the variable did I encounter any problems. I want to search for the icon itself as I dont know the filepath where anyone whom I may give this to will put it.

My short term remedy is to now just search for the icon eveytime the dialog is executed, but dont really think that should be necessary once it has been set.

Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
it needs a space:
icon 1, 312 13 41 48,%renepic
should be
icon 1, 312 13 41 48, %renepic


New username: hixxy
Joined: Mar 2004
Posts: 26
U
Ameglian cow
OP Offline
Ameglian cow
U
Joined: Mar 2004
Posts: 26
hrmmm,

same problem with a space.

* /dialog: 'lilmp3' error loading icon '0 C:\3515\renemp3ic0n.bmp'


And, as I edited the script, I had it without the space, yet it works fine as long as:

1. you set the variable on each execution of the dialog

2. you hard code the path.

icon 1, 312 13 41 48,C:\3515\renemp3ic0n.bmp

and

icon 1, 312 13 41 48, C:\3515\renemp3ic0n.bmp

both work exactly the same.

Using the variable also is the same with or w/o space. Will only work if the variable is set on each execution.

Joined: Dec 2002
Posts: 102
M
Vogon poet
Offline
Vogon poet
M
Joined: Dec 2002
Posts: 102
Icons can be embedded into files, (like the many mIRC icons in the mIRC.exe.) So you have to reference which one to retreieve. I'm pretty sure after the filename in the icon line you should be referencing an index number:

icon 1, 312 13 41 48, %renepic 1

The error you're getting is that it cannot find an icon with the index of 0.


-
MIMP
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
The actual problem is that mirc is inconsistent regarding the order of index and filename in different scripting elements that have to do with dialog icons. The details are described here.

Btw, icon indexing is zero-based, so if the icon #1 exists, #0 would definitely exist too wink


uicn_renegade: I would advise against using variables in icon definitions, for now. The workaround is pretty simple too: just use the on dialog init and close events to load/save the icon yourself.

Last edited by qwerty; 29/03/04 08:01 PM.

/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Joined: Mar 2004
Posts: 26
U
Ameglian cow
OP Offline
Ameglian cow
U
Joined: Mar 2004
Posts: 26
Excellent info, thanks to both of you.

I did not realize that the icons were indexed.

I will leave it as I currently have it, which is just to search for the icon each time on init. It is quite effective.


Link Copied to Clipboard