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
WIKI Timeout issues
Please read here if you have trouble connecting to the wiki
Recent
Fast Canvas Library V1.05...
by
Gigatron
[
Today
at 01:47:23 pm]
"Mario & Luigi" (1994-200...
by
paule32
[
Today
at 01:09:14 pm]
Compare two text lines an...
by
dbannon
[
Today
at 12:29:47 pm]
Setting up an ARM embedde...
by
Ruptor
[
Today
at 12:14:28 pm]
Fpcupdeluxe
by
heejit
[
Today
at 11:51:44 am]
LMath and Components 0.6....
by
wp
[
Today
at 11:40:02 am]
[S]Call anchor editor for...
by
Martin_fr
[
Today
at 11:32:30 am]
Bug if FileListBox.Sorted...
by
hannaconner
[
Today
at 11:19:17 am]
how to create different c...
by
paule32
[
Today
at 10:49:43 am]
new private messages fly ...
by
Nitorami
[
Today
at 10:14:05 am]
[SOLVED] SQLite query to ...
by
Zvoni
[
Today
at 09:30:48 am]
Sharing utilities
by
lucabertoncini
[
Today
at 09:01:00 am]
Triple Gosper Space Filli...
by
Thaddy
[
Today
at 07:17:33 am]
Program vs Simple Program...
by
ASBzone
[
Today
at 06:43:56 am]
Is Lazarus still serious ...
by
dbannon
[
Today
at 06:09:15 am]
replace the Executable St...
by
paule32
[
Today
at 04:25:38 am]
outsource RTTI
by
paule32
[
Today
at 04:22:43 am]
Lazarus Tool for creating...
by
JuhaManninen
[
Today
at 12:39:37 am]
How to control subform: S...
by
madref
[July 13, 2025, 11:35:23 pm]
Building warnings ?
by
madref
[July 13, 2025, 11:26:32 pm]
Need help testing demonst...
by
Gustavo 'Gus' Carreno
[July 13, 2025, 10:41:44 pm]
trunc builtin function is...
by
jamie
[July 13, 2025, 10:01:41 pm]
Circumvent the assignment...
by
Thaddy
[July 13, 2025, 08:31:45 pm]
activex.pp DosDateTimeToV...
by
nanobit
[July 13, 2025, 08:23:05 pm]
Searching for current wor...
by
PascalDragon
[July 13, 2025, 07:13:06 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Which component for highlighting part of item/string (Read 4460 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: 11460
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
Bright theme for bright minds
theo
Global Moderator
Hero Member
Posts: 1932
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: 1932
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