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
Possible bug in Lazarus 4...
by
Alex.Machado
[
Today
at 06:05:45 am]
Clipboard Formats
by
dbannon
[
Today
at 05:18:37 am]
[SOLVED] progress dialog ...
by
Xenno
[
Today
at 04:58:10 am]
TurboBird for FireBird 5
by
maurog
[
Today
at 04:45:18 am]
TurboBird IBX
by
maurog
[
Today
at 04:41:20 am]
a bug about FPC spurce
by
dsiders
[
Today
at 02:44:18 am]
Convert string with Key-V...
by
dseligo
[
Today
at 02:38:28 am]
How to get at files that ...
by
Martin_fr
[
Today
at 12:33:32 am]
Need help converting a C+...
by
jamie
[
Today
at 12:30:59 am]
Lazarus Bugfix Release 4...
by
calebs
[December 07, 2025, 10:37:53 pm]
make cycle fails on macOS...
by
Thausand
[December 07, 2025, 10:05:00 pm]
Matching video to form
by
Thausand
[December 07, 2025, 09:48:04 pm]
[Solved] Need help with c...
by
Thausand
[December 07, 2025, 08:03:53 pm]
TTagEdit Component 1.2
by
JD
[December 07, 2025, 08:02:41 pm]
[SOLVED] Form OnTop not w...
by
Pe3s
[December 07, 2025, 07:32:12 pm]
Save record to BLOB Field
by
Sc0li0sis
[December 07, 2025, 07:31:24 pm]
$ifdef highlighting
by
440bx
[December 07, 2025, 07:09:02 pm]
[BUG REPORT] Code explore...
by
Martin_fr
[December 07, 2025, 02:54:20 pm]
Qt6 / X11: problem with G...
by
paweld
[December 07, 2025, 02:44:07 pm]
Dumb Problems Contest!
by
Thaddy
[December 07, 2025, 02:41:59 pm]
Please ask about the valu...
by
zzzzzzz7
[December 07, 2025, 02:14:52 pm]
laz_xmlstreaming.pas fail...
by
Ryan J
[December 07, 2025, 01:00:52 pm]
Probleme installing Lazar...
by
DonAlfredo
[December 07, 2025, 09:05:41 am]
Wikipedia pollution
by
Thaddy
[December 07, 2025, 08:31:35 am]
How to register a windows...
by
Thaddy
[December 07, 2025, 08:24:15 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Which component for highlighting part of item/string (Read 4563 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: 11911
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: 1933
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: 1933
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