Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
General
»
Font draw in customdraw in dbgid
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
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
Use mORMot2 to export PDF...
by
rvk
[
Today
at 10:13:38 am]
Xtensa-freertos wiki
by
ccrause
[
Today
at 09:48:49 am]
Why MaxDouble does not eq...
by
jollytall
[
Today
at 09:40:23 am]
Building FPC 3.2.2 on Deb...
by
MarkMLl
[
Today
at 09:27:48 am]
Win SHBrowseForFolder API...
by
d2010
[
Today
at 09:02:38 am]
Class helpers cannot have...
by
Thaddy
[
Today
at 08:51:02 am]
Not able to install "fpc-...
by
dbannon
[
Today
at 07:19:07 am]
TPairSplitter control lea...
by
MOSTech6502
[
Today
at 05:06:09 am]
[Solved] Package Laz_Syna...
by
Fibonacci
[
Today
at 03:40:50 am]
Making a plea :)
by
dbannon
[
Today
at 02:25:25 am]
Q Win SHBrowseForFolder A...
by
ASerge
[
Today
at 02:18:29 am]
Reintroduce events and pr...
by
Joanna
[
Today
at 01:58:28 am]
Besides TForm is there a ...
by
mas steindorff
[
Today
at 12:40:09 am]
About $ and Cents - Dbf L...
by
Fibonacci
[
Today
at 12:01:43 am]
Is there a TPanel substit...
by
Sieben
[October 04, 2024, 11:47:42 pm]
FPC 3.2.2 / Lazarus 2.2.6...
by
Fred vS
[October 04, 2024, 09:58:43 pm]
Why I can not set affinit...
by
440bx
[October 04, 2024, 09:28:07 pm]
Feature announcement: Imp...
by
corpsman
[October 04, 2024, 08:48:30 pm]
Trying to tweak the bsTri...
by
carl_caulkett
[October 04, 2024, 08:19:54 pm]
AY_FLY Library
by
Gigatron
[October 04, 2024, 07:58:37 pm]
Error code documentation
by
Ștefan-Iulian Alecu
[October 04, 2024, 07:09:10 pm]
code seems bulky
by
Ștefan-Iulian Alecu
[October 04, 2024, 07:07:19 pm]
Еличка - a simple calcula...
by
CM630
[October 04, 2024, 06:12:07 pm]
standard or third party f...
by
Packs
[October 04, 2024, 03:41:49 pm]
Working MIDI app for the ...
by
carl_caulkett
[October 04, 2024, 03:29:15 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Font draw in customdraw in dbgid (Read 707 times)
mikutu
New Member
Posts: 16
Font draw in customdraw in dbgid
«
on:
September 10, 2024, 10:28:00 am »
if set color in DBGrid1DrawColumnCell and call DefaultDrawColumnCell font draw another if not use custom draw. In picture attach up - standart draw, down - custom draw.
Code: Pascal
[Select]
[+]
[-]
procedure
TfrmMain
.
DBGrid1DrawColumnCell
(
Sender
:
TObject
;
const
Rect
:
TRect
;
DataCol
:
Integer
;
Column
:
TColumn
;
State
:
TGridDrawState
)
;
var
x
,
y
:
integer
;
isSelect
:
boolean
;
begin
isSelect
:
=
(
(
gdFocused
in
State
)
or
(
gdSelected
in
State
)
)
;
if
(
not
isSelect
)
then
begin
TDBGrid
(
Sender
)
.
Canvas
.
Font
.
Color
:
=
$00C04020
;
TDBGrid
(
Sender
)
.
DefaultDrawColumnCell
(
Rect
,
DataCol
,
Column
,
State
)
;
end
;
end
;
Logged
jamie
Hero Member
Posts: 6556
Re: Font draw in customdraw in dbgid
«
Reply #1 on:
September 10, 2024, 11:00:54 pm »
Use "OnPrepairCanvas" to set the font and colors prior to painting.
Logged
The only true wisdom is knowing you know nothing
mikutu
New Member
Posts: 16
Re: Font draw in customdraw in dbgid
«
Reply #2 on:
September 12, 2024, 08:02:02 am »
thank you, it's work
Logged
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
General
»
Font draw in customdraw in dbgid
TinyPortal
© 2005-2018