Multicolor listbox item

Разработка Far.
Post Reply
pepak
Posts: 604
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 17 times
Been thanked: 54 times

Multicolor listbox item

Post by pepak »

Within FAR itself (not in a plugin), is it possible to create a listbox with multicolor items? E.g. assume a listbox with three items:

Code: Select all

item 1
item 2
item 3
I would like the number (1, 2 or 3) to use a different textcolor than the "item" prefix. The coloring should not have any side-effects, so using an & to "highlight" the number is out. But I am OK with just two colors, I don't need a fully generic solution. It seems to me that if I were writing a plugin, I could make use of DN_DRAWDLGITEM (and in FAR, presumably I could use the functions that get called when DN_DRAWDLGITEM is used - I didn't research which ones are these, yet), but I am not really at all certain. Can anyone confirm whether I am on the right track, please? Thanks.
User avatar
zg
zero-gravity
Posts: 6016
Joined: Tue 15 Mar, 2005 17:36
Location: riga
Been thanked: 185 times
Contact:

Multicolor listbox item

Post by zg »

pepak
Posts: 604
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 17 times
Been thanked: 54 times

Multicolor listbox item

Post by pepak »

Hmm. Are you sure? LuaFarHistory achieves these multicolor items somehow, so it should be possible. Particularly since I am not limited by LuaMacro or the plugin interface, I can modify FAR's source code directly.
Last edited by pepak on Tue 19 Nov, 2019 17:17, edited 1 time in total.
User avatar
buniak_a_h
Posts: 4236
Joined: Sat 20 Apr, 2013 00:17
Location: Санкт-Петробад
Has thanked: 222 times
Been thanked: 643 times
Contact:

Multicolor listbox item

Post by buniak_a_h »

pepak wrote: Tue 19 Nov, 2019 17:17 LuaFarHistory achieves these multicolor items somehow
Where??? I didn't see…
pepak
Posts: 604
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 17 times
Been thanked: 54 times

Multicolor listbox item

Post by pepak »

Activate the history and start searching (by pressing the regular keys).
User avatar
zg
zero-gravity
Posts: 6016
Joined: Tue 15 Mar, 2005 17:36
Location: riga
Been thanked: 185 times
Contact:

Multicolor listbox item

Post by zg »

this is custom implementation based on DI_USERCONTROL.
pepak
Posts: 604
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 17 times
Been thanked: 54 times

Multicolor listbox item

Post by pepak »

That's not good news at all. I still hope you are mistaken, but I am afraid you aren't. :-(
Post Reply

Return to “Development”