The DialogListItem documentation tells us that we can include icons in a listview, but it seems like this is limited to adding icons by offering their system type ("dir", "file", "ftp", etc) or by offering a “path” into a dll or exe file. I know this works (I can see it, for instance, in @errante’s excellent TabResque script which has already resqued many tabs for me). But his script doesn’t load icons from disk. Yet when I see “path” in the documentation, it seems logical to assume a path straight to a file on disk would work too - yet I failed to find out how.
Below is the extract of code that I tried. The icon is located under /dopusdata/icons and the path is absolutely pointing to a valid *.ico file:
var FSU = DOpus.FSUtil();
var iconpath = FSU.Resolve('/dopusdata/icons');
var iconname = 'important.ico';
var Listview = dlg.Control("SearchResult"); //The listview control I'm using
var row = Listview.AddItem('something');
var rowObj= Listview.GetItemAt(row);
var icon = iconpath + '\\' + iconname; //Absolutely correct path/name
rowObj.icon = icon;
This shows no icon in the listview - only the word ‘something’ is there. The lisview is in “Details” mode and uses multiple columns, it works perfectly well since a long time, but its essence is in showing filenames in the first column (and from there I can open files, etc.), That’s where I try to add the icons.
Those icons, by the way, correspond to the Status icons (Opus statuses, from the labels configuration, category “Status”) - those are the ones I try to make visible in the listview after a search through a large number of files. I have no problem getting the name of the label (using arrstatus = item.Labels("Status"), then taking the first item in the array, if there is one). Mapping the name to the physical locations of the icons associated with it is a no-brainer. I just can’t make it show up in the view.
In addition, or perhaps alternatively, I should also ask if it is possible to load icons directly from their label definitions (category “Status” in particular). This is not absolutely necessary because, as I said, I can do the mapping myself, but maybe there is already some method to pick them by referring to those labels?