Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
LCL
»
[SOLVED]Can I change the background color while editing the TreeView node text?
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
Heaptrc reports unfreed m...
by
bytebites
[
Today
at 03:39:08 pm]
Info for PTCGraph users.....
by
TBMan
[
Today
at 03:32:47 pm]
Help with search and repa...
by
CM630
[
Today
at 12:54:09 pm]
Initialize list in functi...
by
PeterHu
[
Today
at 10:33:27 am]
Lazarus Blowfish
by
Thaddy
[
Today
at 09:30:07 am]
Tips for cross-compiling ...
by
Seenkao
[
Today
at 09:25:29 am]
An Idea for a helpful uti...
by
Thaddy
[
Today
at 08:27:38 am]
Drawing a picture on the ...
by
DMH
[
Today
at 05:01:07 am]
Anyone interested in help...
by
ad1mt
[November 09, 2025, 07:57:13 pm]
How detect a keypress in ...
by
Remy Lebeau
[November 09, 2025, 07:49:50 pm]
Paradox date filter
by
tawfiq-lz
[November 09, 2025, 07:46:20 pm]
Why is there no Chinese s...
by
Ten_Mile_Hike
[November 09, 2025, 06:55:11 pm]
Convert table to JSON arr...
by
paweld
[November 09, 2025, 05:56:56 pm]
Unexpected lack of error ...
by
n7800
[November 09, 2025, 05:39:10 pm]
FPC 3.2.4-rc1 available
by
pleumann
[November 09, 2025, 05:12:32 pm]
application crashes on st...
by
Thaddy
[November 09, 2025, 04:17:28 pm]
Blog area?
by
Martin_fr
[November 09, 2025, 02:00:17 pm]
SimpleXML
by
ednaldomoreira
[November 09, 2025, 01:45:18 pm]
What happens if you use "...
by
Thaddy
[November 09, 2025, 01:39:12 pm]
CustomDraw package compil...
by
lainz
[November 09, 2025, 01:21:58 pm]
Register global hotkey
by
Thaddy
[November 09, 2025, 12:46:46 pm]
How to port TArray.Sort?
by
Thaddy
[November 09, 2025, 12:20:36 pm]
Dynamic libraries in Linu...
by
Fred vS
[November 08, 2025, 10:28:42 pm]
FPC v3.2.2 internal error
by
440bx
[November 08, 2025, 09:15:48 pm]
Distance of gridlines in ...
by
wp
[November 08, 2025, 08:08:14 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [SOLVED]Can I change the background color while editing the TreeView node text? (Read 3193 times)
tomitomy
Sr. Member
Posts: 251
[SOLVED]Can I change the background color while editing the TreeView node text?
«
on:
October 27, 2017, 04:48:53 am »
Hi, I would like to change the background color when editing the TreeView node text, this can be achieved?
Or change the font color, Because their colors are too close.
Lazarus 1.8.0 RC4 GTK2
«
Last Edit: November 07, 2017, 02:25:58 pm by tomitomy
»
Logged
zeljko
Hero Member
Posts: 1792
Re: Can I change the background color while editing the TreeView node text?
«
Reply #1 on:
October 27, 2017, 09:15:59 am »
It looks like gtk2 theme problem.
Logged
tomitomy
Sr. Member
Posts: 251
Re: Can I change the background color while editing the TreeView node text?
«
Reply #2 on:
October 27, 2017, 11:00:35 am »
Quote from: zeljko on October 27, 2017, 09:15:59 am
It looks like gtk2 theme problem.
Oh, It's bad news. Thank you zeljko.
Logged
tomitomy
Sr. Member
Posts: 251
Re: Can I change the background color while editing the TreeView node text?
«
Reply #3 on:
November 02, 2017, 09:24:39 am »
I use TEdit instead of Naming Box to achieve my needs:
Code: Pascal
[Select]
[+]
[-]
unit
Unit1
;
{$mode objfpc}{$H+}
interface
uses
Classes
,
SysUtils
,
FileUtil
,
Forms
,
Controls
,
Graphics
,
Dialogs
,
ComCtrls
,
StdCtrls
;
type
{ TForm1 }
TForm1
=
class
(
TForm
)
Edit1
:
TEdit
;
TreeView1
:
TTreeView
;
procedure
Edit1Exit
(
Sender
:
TObject
)
;
procedure
Edit1KeyDown
(
Sender
:
TObject
;
var
Key
:
Word
;
Shift
:
TShiftState
)
;
procedure
TreeView1Editing
(
Sender
:
TObject
;
Node
:
TTreeNode
;
var
AllowEdit
:
Boolean
)
;
private
public
end
;
var
Form1
:
TForm1
;
implementation
uses
LCLType
;
{$R *.lfm}
{ TForm1 }
procedure
TForm1
.
TreeView1Editing
(
Sender
:
TObject
;
Node
:
TTreeNode
;
var
AllowEdit
:
Boolean
)
;
var
ANode
:
TTreeNode
;
ARect
:
TRect
;
begin
AllowEdit
:
=
False
;
ANode
:
=
TreeView1
.
Selected
;
if
ANode
=
nil
then
Exit
;
Edit1
.
Parent
:
=
TreeView1
;
ARect
:
=
ANode
.
DisplayRect
(
True
)
;
ARect
.
Right
:
=
TreeView1
.
Width
;
Edit1
.
BoundsRect
:
=
ARect
;
Edit1
.
Text
:
=
ANode
.
Text
;
Edit1
.
SelectAll
;
Edit1
.
Show
;
Edit1
.
SetFocus
;
end
;
procedure
TForm1
.
Edit1Exit
(
Sender
:
TObject
)
;
var
ANode
:
TTreeNode
;
begin
ANode
:
=
TreeView1
.
Selected
;
if
ANode
=
nil
then
Exit
;
ANode
.
Text
:
=
Edit1
.
Text
;
Edit1
.
Hide
;
end
;
procedure
TForm1
.
Edit1KeyDown
(
Sender
:
TObject
;
var
Key
:
Word
;
Shift
:
TShiftState
)
;
begin
case
Key
of
VK_RETURN
:
Edit1
.
OnExit
(
Sender
)
;
VK_ESCAPE
:
Edit1
.
Hide
;
end
;
end
;
end
.
Logged
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
LCL
»
[SOLVED]Can I change the background color while editing the TreeView node text?
TinyPortal
© 2005-2018