Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
General
»
[Solved]How can I make a descendent of a TCustomLabeledEdit
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
any one knows how to set ...
by
greenzyzyzy
[
Today
at 06:51:53 am]
How can I capture all key...
by
Handoko
[
Today
at 05:21:56 am]
general reference manual ...
by
Curt Carpenter
[
Today
at 03:52:39 am]
Are We Dead Yet?
by
dbannon
[
Today
at 03:33:02 am]
Changes in "Search Result...
by
n7800
[
Today
at 03:13:36 am]
TBufferDataSet List Index...
by
eldonfsr
[
Today
at 01:54:18 am]
How to download a file fr...
by
jmpessoa
[
Today
at 01:44:30 am]
[SOLVED] LAMW BackButton ...
by
maurobio
[
Today
at 01:12:12 am]
Clean up at ide/include/i...
by
Bart
[June 03, 2023, 11:03:10 pm]
Tips for deep debuging of...
by
Grew
[June 03, 2023, 10:46:22 pm]
discarding an array
by
robert rozee
[June 03, 2023, 09:54:10 pm]
TSynEdit crashes when loa...
by
Martin_fr
[June 03, 2023, 09:37:47 pm]
How to create form in thr...
by
PascalDragon
[June 03, 2023, 07:22:32 pm]
Who uses "caret past EOL"...
by
Martin_fr
[June 03, 2023, 06:34:39 pm]
array of array of type?
by
jamie
[June 03, 2023, 04:42:22 pm]
if then else syntax
by
jamie
[June 03, 2023, 04:37:44 pm]
how to do a HTTP POST wit...
by
rvk
[June 03, 2023, 03:51:05 pm]
[SOLVED] SynEdit resize t...
by
Hansvb
[June 03, 2023, 03:42:16 pm]
[SOLVED] Help for downloa...
by
magleft
[June 03, 2023, 11:32:31 am]
Two issues related to fcl...
by
wp
[June 03, 2023, 11:07:07 am]
ANN: ODBC DAC under GNU G...
by
Andrey Zubik
[June 03, 2023, 01:14:38 am]
LAMW - (SOLVED) simple es...
by
Mongkey
[June 03, 2023, 12:20:54 am]
Fast Base64 encoding/deco...
by
mika
[June 02, 2023, 10:53:10 pm]
help choosing laptop
by
Leledumbo
[June 02, 2023, 08:18:27 pm]
TStringGrid : Conflict be...
by
Nel_Fie
[June 02, 2023, 06:17:51 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [Solved]How can I make a descendent of a TCustomLabeledEdit (Read 202 times)
bobonwhidbey
Hero Member
Posts: 557
[Solved]How can I make a descendent of a TCustomLabeledEdit
«
on:
April 01, 2023, 06:50:51 pm »
I'm trying to make a new component but
TMyComp = class(TCustomLabelEdit)
doesn't work even though ExtCtrls is in my Uses clause.
«
Last Edit: April 01, 2023, 08:21:26 pm by bobonwhidbey
»
Logged
Win11 64-bit / Lazarus 32-bit 2.2.6 / FPC 3.2.2
wp
Hero Member
Posts: 10858
Re: How can I make a descendent of a TCustomLabeledEdit
«
Reply #1 on:
April 01, 2023, 07:00:57 pm »
What isn't working? And what should be different from TCustomLabeledEdit?
The following demo is working. It creates a TMyComp component as descendant of TCustomLabeledEdit in which the label font color defaults to red.
Code: Pascal
[Select]
[+]
[-]
unit
Unit1
;
{$mode objfpc}{$H+}
interface
uses
Classes
,
SysUtils
,
Forms
,
Controls
,
Graphics
,
Dialogs
,
ExtCtrls
;
type
TMyComp
=
class
(
TCustomLabeledEdit
)
public
constructor
Create
(
AOwner
:
TComponent
)
;
override
;
end
;
{ TForm1 }
TForm1
=
class
(
TForm
)
procedure
FormCreate
(
Sender
:
TObject
)
;
private
myComp
:
TMyComp
;
public
end
;
var
Form1
:
TForm1
;
implementation
{$R *.lfm}
constructor
TMyComp
.
Create
(
AOwner
:
TComponent
)
;
begin
inherited
;
EditLabel
.
Font
.
Color
:
=
clRed
;
end
;
{ TForm1 }
procedure
TForm1
.
FormCreate
(
Sender
:
TObject
)
;
begin
myComp
:
=
TMyComp
.
Create
(
self
)
;
myComp
.
Left
:
=
8
;
myComp
.
Top
:
=
24
;
myComp
.
Width
:
=
200
;
myComp
.
Parent
:
=
self
;
myComp
.
EditLabel
.
Caption
:
=
'My new component'
;
myComp
.
Text
:
=
'This is a test.'
;
end
;
«
Last Edit: April 01, 2023, 07:03:40 pm by wp
»
Logged
Blaazen
Hero Member
Posts: 3234
POKE 54296,15
Re: How can I make a descendent of a TCustomLabeledEdit
«
Reply #2 on:
April 01, 2023, 07:02:33 pm »
It is "Labeled". A typo, I guess. And yes, it is in ExtCtrls.
Code: Pascal
[Select]
[+]
[-]
TMyComp
=
class
(
TCustomLabeledEdit
)
Otherwise I cannot imagine how it cannot be subclassed.
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/
bobonwhidbey
Hero Member
Posts: 557
Re: How can I make a descendent of a TCustomLabeledEdit
«
Reply #3 on:
April 01, 2023, 08:21:11 pm »
Thanks Blaazen....just a dumb typo :'(
Logged
Win11 64-bit / Lazarus 32-bit 2.2.6 / FPC 3.2.2
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
General
»
[Solved]How can I make a descendent of a TCustomLabeledEdit
TinyPortal
© 2005-2018