Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
LCL
»
Which component for highlighting part of item/string
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
Forum Rules
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
actinon: C photorealistic...
by
Boleeman
[
Today
at 11:13:36 am]
Any way to "embed" Window...
by
d2010
[
Today
at 11:11:09 am]
Getting results from sql ...
by
Zvoni
[
Today
at 10:36:33 am]
How to remove consoleApp ...
by
d2010
[
Today
at 10:28:33 am]
Lightweight HTML/CSS rend...
by
domasz
[
Today
at 09:52:15 am]
Yet Another Snake Game
by
silvercoder70
[
Today
at 09:40:16 am]
Debian releases a Gtk3 La...
by
robert rozee
[
Today
at 05:10:45 am]
Initialization & finaliza...
by
runewalsh
[
Today
at 04:40:40 am]
[AGGPas] Difference betwe...
by
Graeme
[
Today
at 02:29:45 am]
[SOLVED] GTK3 : Icons hav...
by
theo
[March 16, 2026, 11:29:43 pm]
add thumb up or like butt...
by
Martin_fr
[March 16, 2026, 09:35:13 pm]
Problem with drawing orde...
by
wp
[March 16, 2026, 06:26:27 pm]
[CLARIFIED]TChart: Wrong ...
by
wp
[March 16, 2026, 06:22:26 pm]
Hello! Anything new?
by
simone
[March 16, 2026, 05:47:57 pm]
LAMW Foreground service -...
by
Mongkey
[March 16, 2026, 05:40:05 pm]
could Ardour's YTK be use...
by
Fred vS
[March 16, 2026, 04:59:52 pm]
mORMot again (HttpServer/...
by
ttomas
[March 16, 2026, 12:45:49 pm]
Is it me or is there some...
by
Martin_fr
[March 16, 2026, 11:48:04 am]
Exiting HeapTrace dump
by
jamie
[March 16, 2026, 11:34:49 am]
CONCAT formula
by
Zvoni
[March 16, 2026, 08:17:21 am]
emuloader: help to resurr...
by
arcadegamer
[March 15, 2026, 08:30:31 pm]
AutoSize TMemo.Height?
by
wp
[March 15, 2026, 05:55:05 pm]
Possible Enhancement to t...
by
jamie
[March 15, 2026, 04:10:38 pm]
lazarus 4.99 and missing ...
by
wp
[March 15, 2026, 03:11:43 pm]
Questions about TFuncSeri...
by
hedgehog
[March 15, 2026, 06:58:29 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Which component for highlighting part of item/string (Read 4618 times)
user2126296
Newbie
Posts: 6
Which component for highlighting part of item/string
«
on:
March 20, 2013, 01:12:27 pm »
Which component (TListView, TStringGrid, ...) do you recommend for this:
presentation of list items
items will be strings
specified substrings (e.g. words) will be highlighted - I need to highlight some words in a string/item.
Example:
http://www.codeproject.com/Articles/103259/Highlight-Searched-Text-in-WPF-ListView
I am not aware of a way to change background color for a part of string (using OnCustomDrawItem).
Logged
Blaazen
Hero Member
Posts: 3241
POKE 54296,15
Re: Which component for highlighting part of item/string
«
Reply #1 on:
March 20, 2013, 01:56:40 pm »
TSynEdit (or TSynMemo)
Logged
Lazarus 2.3.0 (rev main-2_3-2863...) FPC 3.3.1 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21
Try Eye-Candy Controls:
https://sourceforge.net/projects/eccontrols/files/
user2126296
Newbie
Posts: 6
Re: Which component for highlighting part of item/string
«
Reply #2 on:
March 20, 2013, 03:05:48 pm »
Quote from: Blaazen on March 20, 2013, 01:56:40 pm
TSynEdit (or TSynMemo)
It'd be non-standard usage of TSynMemo because of need to present tabular data:
read only row (can be easily implemented in TSynMemo)
when onclick on row, full row should be selected (not sure)
need to access data/strings in particular column
Logged
Martin_fr
Administrator
Hero Member
Posts: 12209
Debugger - SynEdit - and more
Re: Which component for highlighting part of item/string
«
Reply #3 on:
March 20, 2013, 04:04:25 pm »
The other option is to do painting yourself. Many components have on Paint, or even OnPaintItem (sorry no example)
Logged
Ide Tools, Code completion and more
/
IDE cool features
/
Debugger Status
theo
Global Moderator
Hero Member
Posts: 1939
Re: Which component for highlighting part of item/string
«
Reply #4 on:
March 20, 2013, 05:23:25 pm »
Yes, paint it yourself.
Canvas.TextExtent
Canvas.FillRect
Canvas.TextOut or TextRect
are your friends.
Logged
user2126296
Newbie
Posts: 6
Re: Which component for highlighting part of item/string
«
Reply #5 on:
March 20, 2013, 06:22:18 pm »
And which event should be the trigger to do the painting?
TListBox, TListView and TStringGrid have only OnDrawItem, no OnPaint(Item) event available. I do not know the difference between OnPaint(Item) and OnDrawItem events.
Logged
theo
Global Moderator
Hero Member
Posts: 1939
Re: Which component for highlighting part of item/string
«
Reply #6 on:
March 21, 2013, 09:16:47 am »
Yes, OnDrawItem, OnCustomDraw ... etc. whatever seems appropriate.
Logged
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
LCL
»
Which component for highlighting part of item/string
TinyPortal
© 2005-2018