Closed luebbe closed 3 years ago
Until now I found out that this is also a very nasty side effect of the combination of gettext translation and SVGIconImageList. At some point it still translates the icon names. When I switch the application's language to English, everything is fine. Have you ever tried what happens, when an icon's name is changed?
This is what I see in the debugger when I put a breakpoint on the exception line:
The original item name hasn't changed, but due to some "magic" LItem: TVirtualImageListItem
was translated from "stop" to "beenden"
I put a breakpoint here:
procedure TVirtualImageListItem.SetName(const AValue: String);
begin
FName := AValue;
end;
but this method was never entered.
The solution is again to put a component on gettext's ignore list:
TP_GlobalIgnoreClass(TVirtualImageList);
Added information to the "Known issues" Wiki page
The solution is again to put a component on gettext's ignore list:
TP_GlobalIgnoreClass(TVirtualImageList);
I have been using:
TP_GlobalIgnoreClassProperty(TObject,'ImageName');
ImageName should not be translated in any component.
Should I add this to the Wiki https://github.com/EtheaDev/SVGIconImageList/wiki/Known-issues? I thought it would be better to ignore any property of the List instead of a specific property of any object.
I tried to "kill many birds with one stone". ImageName is present in many components (for example CustomButton, MenuItem, Action), and should never be be translated.
ok, I'll add yours as an alternative solution to the Wiki entry
I have a strange error which I don't understand.
on a form I have a TSVGIconImage. In FormCreate I assign the imagelist and -index as follows:
When this image should be painted I receive an "Out of range exception" in
because LItem.CollectionIndex = -1
When I initialize the icon with
the icon is painted.
How can it happen that the collectionindex is -1? Is there perhaps a problem with the icon name, because it is similar to a standard property? There must be something to it, because the exception also happens with icons named "Top" or "Right". I only access icons by index, never by name.