Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
Operating Systems
»
Android
»
Subclass existing visual control ?
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
We are starting to use La...
by
dbannon
[
Today
at 02:15:01 am]
Reporting a Bug? in Strin...
by
Bart
[
Today
at 01:48:34 am]
QuestionDlg does strange ...
by
Martin_fr
[
Today
at 01:16:29 am]
SoundTracker Player Libra...
by
hukka
[
Today
at 01:01:39 am]
it2play - IT/S3M module r...
by
hukka
[
Today
at 12:47:05 am]
[ANN] fpGUI Toolkit v2.0....
by
cdbc
[February 14, 2026, 11:44:49 pm]
Reflection and Review in ...
by
jwdietrich
[February 14, 2026, 09:53:31 pm]
How to determine the unkn...
by
Roland57
[February 14, 2026, 09:42:26 pm]
My AGGPas examples
by
cdbc
[February 14, 2026, 09:38:34 pm]
fpGUI Toolkit v2.0.1 has ...
by
cdbc
[February 14, 2026, 09:32:46 pm]
LazReport
by
dseligo
[February 14, 2026, 08:51:08 pm]
Howto : Double buffer wit...
by
biologic
[February 14, 2026, 06:42:42 pm]
how to enable multihelper...
by
PascalDragon
[February 14, 2026, 06:30:05 pm]
Free Pascal for a small e...
by
devEric69
[February 14, 2026, 06:19:36 pm]
Fast Canvas Library V1.05...
by
backprop
[February 14, 2026, 05:46:10 pm]
Are the source files for ...
by
Derz
[February 14, 2026, 05:12:27 pm]
[ANN] PasBuild 1.3.0 rele...
by
Graeme
[February 14, 2026, 05:02:32 pm]
Frustrating Error When us...
by
jamie
[February 14, 2026, 04:22:29 pm]
; after then
by
Curt Carpenter
[February 14, 2026, 04:09:29 pm]
Help needed compiling
by
jamie
[February 14, 2026, 03:58:08 pm]
Does not go out of functi...
by
Martin_fr
[February 14, 2026, 03:43:52 pm]
How to start LAMW emulato...
by
RaketeMike
[February 14, 2026, 12:44:46 pm]
ThorVG - test (lightweigh...
by
Antek
[February 14, 2026, 12:35:09 pm]
Questions from a Windows ...
by
hedgehog
[February 14, 2026, 12:20:15 pm]
[ANN] fpGUI Toolkit v2.0....
by
Fred vS
[February 14, 2026, 11:43:13 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Subclass existing visual control ? (Read 1083 times)
jsuzineau
Newbie
Posts: 3
Subclass existing visual control ?
«
on:
June 09, 2022, 04:31:00 pm »
Hello,
Is it possible to subclass an existing LAMW Visual Control ?
For example something like :
Code: Pascal
[Select]
[+]
[-]
type
TSomething
=
class
(
jEditText
)
// Propriété Field
private
FField
:
String
;
published
property
Field
:
String
read
FField
write
FField
;
end
;
After creating such kind of component, I can rebuild Lazarus .
But when I hit F12 to show a form which uses this component, Lazarus freezes.
And if I try to build the project, I get an an error on linking.
I also tried to copy and paste the whole code of jEditText (duplicating and modifying jEditText.create, jEditText.native, jEditText.java) but I got the same behaviour.
I didn't got this kind of problem when I added another component for android.media.AudioTrack.
My main goal is to make a LAMW version based on JEditText of a "desktop" control based on TEdit for my ORM.
I've already made an attempt in 2017, but I'm not sure it was working, and LAMW has changed since.
lamw version:
https://github.com/jsuzineau/pascal_o_r_mapping/blob/TjsDataContexte/pascal_o_r_mapping/09_Controls_LAMW/ucjChamp_Edit.pas
desktop version:
https://github.com/jsuzineau/pascal_o_r_mapping/blob/TjsDataContexte/pascal_o_r_mapping/05_Controls/ucChamp_Edit.pas
Logged
jmpessoa
Hero Member
Posts: 2330
Re: Subclass existing visual control ?
«
Reply #1 on:
June 09, 2022, 11:33:40 pm »
Quote
Is it possible to subclass an existing LAMW Visual Control ?
not so easily .... but you can easily create your new component!
«
Last Edit: June 10, 2022, 01:47:41 am by jmpessoa
»
Logged
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard
jsuzineau
Newbie
Posts: 3
Re: Subclass existing visual control ?
«
Reply #2 on:
June 10, 2022, 08:25:09 am »
Thank you very much for the answer.
So I've made a handler component which connects to jEditText "from the outside", it works:
Code: Pascal
[Select]
[+]
[-]
ThSomething
=
class
(
TComponent
)
//EditText
private
Fet
:
jEditText
;
procedure
Setet
(
_Value
:
jEditText
)
;
published
property
et
:
jEditText
read
Fet
write
Setet
;
// Propriété Field
private
FField
:
String
;
published
property
Field
:
String
read
FField
write
FField
;
end
;
Logged
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
Operating Systems
»
Android
»
Subclass existing visual control ?
TinyPortal
© 2005-2018