Multicolor listbox item

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

Multicolor listbox item

Post by pepak » Tue 19 Nov, 2019 14:53

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: 5651
Joined: Tue 15 Mar, 2005 17:36
Location: riga
Been thanked: 114 times
Contact:

Multicolor listbox item

Post by zg » Tue 19 Nov, 2019 15:18


pepak
Posts: 444
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 9 times
Been thanked: 25 times

Multicolor listbox item

Post by pepak » Tue 19 Nov, 2019 17:17

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.

buniak_a_h
Posts: 1233
Joined: Sat 20 Apr, 2013 00:17
Location: Питер
Has thanked: 88 times
Been thanked: 73 times
Contact:

Multicolor listbox item

Post by buniak_a_h » Tue 19 Nov, 2019 17:30

pepak wrote:
Tue 19 Nov, 2019 17:17
LuaFarHistory achieves these multicolor items somehow
Where??? I didn't see…

pepak
Posts: 444
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 9 times
Been thanked: 25 times

Multicolor listbox item

Post by pepak » Tue 19 Nov, 2019 18:53

Activate the history and start searching (by pressing the regular keys).

User avatar
zg
zero-gravity
Posts: 5651
Joined: Tue 15 Mar, 2005 17:36
Location: riga
Been thanked: 114 times
Contact:

Multicolor listbox item

Post by zg » Tue 19 Nov, 2019 19:12

this is custom implementation based on DI_USERCONTROL.

pepak
Posts: 444
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 9 times
Been thanked: 25 times

Multicolor listbox item

Post by pepak » Tue 19 Nov, 2019 19:36

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”