Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
LCL
»
[CLOSED] Custom PopUpMenu
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
IRC channel
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
Form scaling
by
wp
[
Today
at 07:38:50 pm]
InstallAware Using Lazaru...
by
Thaddy
[
Today
at 07:21:31 pm]
Macros confuse error mess...
by
MarkMLl
[
Today
at 07:20:43 pm]
Post your internal error ...
by
Eugene Loza
[
Today
at 07:12:35 pm]
Lazarus project made on M...
by
Odacir
[
Today
at 06:57:45 pm]
C-evo: New Horizons 1.3.0...
by
Chronos
[
Today
at 06:32:41 pm]
Lazarus for Windows on aa...
by
msintle
[
Today
at 06:32:02 pm]
How can i make this windo...
by
Handoko
[
Today
at 06:23:43 pm]
CocoaInt.CocoaIconUse no ...
by
dsiders
[
Today
at 06:22:10 pm]
Does anyone know why this...
by
Laksen
[
Today
at 06:01:04 pm]
For-in loop over constant...
by
alpine
[
Today
at 05:20:47 pm]
pre-processor symbol when...
by
paule32
[
Today
at 05:11:35 pm]
How are cookies share Web...
by
Thaddy
[
Today
at 04:59:59 pm]
CORBA interface and Varia...
by
JdeHaan
[
Today
at 04:56:48 pm]
Azure sql database will n...
by
wpflum
[
Today
at 04:04:56 pm]
Values of a custom compon...
by
CM630
[
Today
at 01:42:08 pm]
Arabic text, problem on L...
by
marius.maximus
[
Today
at 12:59:47 pm]
[solved] Lazarus does not...
by
wp
[
Today
at 12:38:09 pm]
How does Castle Game Eng...
by
Aistis
[
Today
at 12:21:03 pm]
Minimum code for implemen...
by
MISV
[
Today
at 11:37:54 am]
[re-opened] Package PPU l...
by
CCRDude
[
Today
at 11:19:11 am]
Distro has depreciated qt...
by
TheMouseAUS
[
Today
at 11:12:25 am]
How can I draw a rectangl...
by
jcmontherock
[
Today
at 11:08:24 am]
TBGRABitmap.TextSize retu...
by
KodeZwerg
[
Today
at 10:26:36 am]
Lazreport: Question about...
by
teco
[
Today
at 09:18:07 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [CLOSED] Custom PopUpMenu (Read 5155 times)
Pe3s
Hero Member
Posts: 533
[CLOSED] Custom PopUpMenu
«
on:
November 30, 2021, 09:45:16 pm »
How can I fix the code to get rid of this gray frame.
Code: Pascal
[Select]
[+]
[-]
procedure
TForm1
.
PopupMenu1DrawItem
(
Sender
:
TObject
;
ACanvas
:
TCanvas
;
ARect
:
TRect
;
AState
:
TOwnerDrawState
)
;
var
x
,
y
:
Integer
;
begin
ACanvas
.
Font
.
Assign
(
Screen
.
MenuFont
)
;
if
AState
*
[
odSelected
,
odFocused
]
<>
[
]
then
begin
ACanvas
.
Brush
.
Color
:
=
RGBToColor
(
216
,
215
,
255
)
;
ACanvas
.
Pen
.
Color
:
=
RGBToColor
(
190
,
190
,
230
)
;
ACanvas
.
Rectangle
(
ARect
)
;
//ACanvas.Font.Style := [fsBold];
end
else
ACanvas
.
GradientFill
(
ARect
,
clSkyBlue
,
clSkyBlue
,
gdHorizontal
)
;
x
:
=
2
;
y
:
=
(
ARect
.
Top
+
ARect
.
Bottom
-
ImageList1
.
Height
)
div
2
;
ImageList1
.
Draw
(
ACanvas
,
x
,
y
,
TMenuItem
(
Sender
)
.
ImageIndex
,
TMenuItem
(
Sender
)
.
Enabled
)
;;
x
:
=
x
+
ImageList1
.
Width
+
4
;
ACanvas
.
Pen
.
Color
:
=
clGray
;
ACanvas
.
Line
(
x
,
ARect
.
Top
,
x
,
ARect
.
Bottom
)
;
x
:
=
x
+
4
;
y
:
=
(
ARect
.
Top
+
ARect
.
Bottom
-
ACanvas
.
TextHeight
(
'Tg'
)
)
div
2
;
ACanvas
.
Brush
.
Style
:
=
bsClear
;
ACanvas
.
TextOut
(
x
,
y
,
TMenuItem
(
Sender
)
.
Caption
)
;
end
;
«
Last Edit: December 01, 2021, 07:52:15 pm by Pe3s
»
Logged
Pe3s
Hero Member
Posts: 533
Re: Custom PopUpMenu
«
Reply #1 on:
December 01, 2021, 07:38:34 am »
@Jamie My point was to fill the entire background of the menu with color. I don't want to remove the shadow. Remove white border
«
Last Edit: December 01, 2021, 01:33:51 pm by Pe3s
»
Logged
Pe3s
Hero Member
Posts: 533
Re: Custom PopUpMenu
«
Reply #2 on:
December 01, 2021, 07:51:53 pm »
Thank you
Logged
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
LCL
»
[CLOSED] Custom PopUpMenu
TinyPortal
© 2005-2018