Incorrect .inc when use custom icon library for toolbar.

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: white, Hacker, petermad, Stefan2

Post Reply
mantis4d
Junior Member
Junior Member
Posts: 9
Joined: 2014-05-14, 01:45 UTC

Incorrect .inc when use custom icon library for toolbar.

Post by *mantis4d »

If I use "set default icon library" set the default icon library to a custom dll(and inc) file, the button in toolbar may load incorrect .inc file.

For example, there are three dll icon library files.
wcmicons.dll old style icon.
wcmicon1.dll tc 9 new icon.
wcmicon2.dll my custom icon.
with each inc files.

Now I use "set default icon library" set the default icon library to wcmicon2.dll .
Then add a button in toolbar, set command to "cm_RereadSource", and set icon file to "wcmicons.dll".
The command "cm_RereadSource" use icon 0 in both wcmicons.dll and wcmicon1.dll , but use icon 55 in wcmicon2.dll (wcmicon2.inc).
the problem is, when I set icon file to "wcmicons.dll", tc9 use wcmicon2.dll instead of wcmicons.dll but still use wcmicons.inc, so the button icon set to the incorrect icon 0 in wcmicon2.dll.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48074
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Sorry, you cannot avoid that. TC will always look for the index in the default icon dll inc file.
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 14791
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

2mantis4d
Just use another name than wcmicon2.dll - that name is handled speciallly in TC, because TC is shipped with a wcmicon2.dll (that's wy Ghisler answers as he does).

But, you can use any other name that starts with wcmicon - like wcmicon3.dll and wcmicon3.inc - that should work.

Notice that the dll file must have a correct and unique filinfo description inside the file to be recognized by TC.

But anyway you CAN use wcmicon2.dll together with wcmicon2.inc - see: http://ghisler.ch/board/viewtopic.php?p=321185#321185 - but I recommend not to use wcmicon2.dll as the name for your own icons - since TC handles this name a little special - for example will wcmicon2.dll always show up as alternative icon library ALSO if there is NO fileinfo description inside the dll file.

Sometimes when changing the .inc file, you have to restart TC to see the effect.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
mantis4d
Junior Member
Junior Member
Posts: 9
Joined: 2014-05-14, 01:45 UTC

Post by *mantis4d »

ghisler(Author) wrote:Sorry, you cannot avoid that. TC will always look for the index in the default icon dll inc file.
Isn't that a bug?

After set default icon library, TC look for new default icon dll, but look for old default icon inc?

So that I can't Set a default icon library with more than icons wcmicons?
because those icons are not indexed in wcmicons.inc?
mantis4d
Junior Member
Junior Member
Posts: 9
Joined: 2014-05-14, 01:45 UTC

Post by *mantis4d »

petermad wrote:2mantis4d
Just use another name than wcmicon2.dll - that name is handled speciallly in TC, because TC is shipped with a wcmicon2.dll (that's wy Ghisler answers as he does).

..............
Sometimes when changing the .inc file, you have to restart TC to see the effect.
Well, I tried rename it to wcmicon3.dll, or wcmicon4.dll, it still has the same problem.

And that lead to another problem, if the dll file is not wcmicons.dll or wcmicon2.dll, it will not show in "set default icon library" . the new icon dll file is downloaded from net, I don't know it missed something or what.
mantis4d
Junior Member
Junior Member
Posts: 9
Joined: 2014-05-14, 01:45 UTC

Post by *mantis4d »

Well I rename it to wcmicon3.dll, rename TC9 new icon back to wcmicon2.dll, It's still has the same problem.

Here is a example.

I make 4 buttons with command "cm_RereadSource", use different icons.
button 1 use %COMMANDER_PATH%\wcmicons.dll , the oldstyle icon.
button 2 use wcmicon2.dll, the newstyle icon.
button 3 use wcmicon3.dll, my custom icon.
button 4 use wcmicons.dll, which will change when I set default icon library.

here is the image.
Image: https://s6.postimg.org/mnme1d61d/iconb1.png


Now I set default icon library to different dll file, the button 4 change it's icon .
set default icon library to wcmicons.dll, button 4 icon same as button 1.
set default icon library to wcmicon2.dll, button 4 icon same as button 2.
set default icon library to wcmicon3.dll, button 4 icon should be same as button 3, but it change to another icon, wrong icon id in wcmicon3.dll.
here is the image.
Image: https://s6.postimg.org/3wp24y0up/iconb2.png

that is what I mean.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48074
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

But you can choose the icon yourself from the list? The inc is only for picking an icon when you choose a command.
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 14791
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

And that lead to another problem, if the dll file is not wcmicons.dll or wcmicon2.dll, it will not show in "set default icon library"
Then the dll. file does NOT have a fileinfo description inside.

Could you give a link to the file, so we can check whether it is made correctly?
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
mantis4d
Junior Member
Junior Member
Posts: 9
Joined: 2014-05-14, 01:45 UTC

Post by *mantis4d »

ghisler(Author) wrote:But you can choose the icon yourself from the list? The inc is only for picking an icon when you choose a command.
That is the problem, if I set default icon library to wcmicon3.dll, when I choose a command, the icon picked by inc is incorrect!
because the inc is not the one matched the dll file!

So after I choose a command, I had to find the correct icon manually!? :shock:

You had not notice that because the wcmicons.inc is as same as wcmicon2.inc , so if you set default icon library to wcmicon2.dll, it looks like TC load the correct inc(but it's not).
mantis4d
Junior Member
Junior Member
Posts: 9
Joined: 2014-05-14, 01:45 UTC

Post by *mantis4d »

petermad wrote: Then the dll. file does NOT have a fileinfo description inside.

Could you give a link to the file, so we can check whether it is made correctly?
here is the dll and inc

http://ul.to/0i1ljcps

by the way, why don't use icl instead of dll?
User avatar
petermad
Power Member
Power Member
Posts: 14791
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

2mantis4d

The wcmicon3.dll file did not have the required fileinfo. I have now added it (naming it "Iconset 3") - you can download it here http://madsenworld.dk/tcmd/wcmicon3a.zip

Using this set it will now turn up in: "Set default icon library".
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Post Reply