Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
General
»
Creating forms dynamically
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
Lazarus for Windows on aa...
by
Wallaby
[April 23, 2024, 11:46:56 pm]
Parameter passing odditie...
by
KodeZwerg
[April 23, 2024, 11:04:39 pm]
Can function be used for ...
by
jamie
[April 23, 2024, 10:53:10 pm]
(Solved) TIndexedAVLTree ...
by
lainz
[April 23, 2024, 10:49:03 pm]
Demo Scene Picture sinwav...
by
KodeZwerg
[April 23, 2024, 10:26:21 pm]
fkInternalCalc
by
zraja
[April 23, 2024, 09:31:07 pm]
A fairly simple sound sol...
by
KodeZwerg
[April 23, 2024, 09:23:37 pm]
add new targets to make
by
marcov
[April 23, 2024, 08:38:42 pm]
how to tweek fpmake to co...
by
marcov
[April 23, 2024, 08:29:16 pm]
Quirky windows
by
ASerge
[April 23, 2024, 07:07:16 pm]
[Request] Demo Scene Sub ...
by
Gigatron
[April 23, 2024, 06:29:39 pm]
Unlocking Files
by
KodeZwerg
[April 23, 2024, 06:03:08 pm]
[SOLVED] trunk bug for mi...
by
Key-Real
[April 23, 2024, 05:56:32 pm]
Demo Scene Bitmap Font Sc...
by
Gigatron
[April 23, 2024, 05:56:27 pm]
Compile/Convert Delphi pr...
by
Martin_fr
[April 23, 2024, 05:43:11 pm]
Generics - correct syntax
by
Thaddy
[April 23, 2024, 05:40:59 pm]
InstallAware Using Lazaru...
by
msintle
[April 23, 2024, 05:26:36 pm]
Xcode Command Line Tools ...
by
Joseph
[April 23, 2024, 05:16:39 pm]
Offical launch of the 1 B...
by
Hartmut
[April 23, 2024, 04:49:29 pm]
what to do if my target M...
by
nickysn
[April 23, 2024, 04:16:02 pm]
compiler error in unit
by
paule32
[April 23, 2024, 03:49:50 pm]
Multithreading - synchron...
by
mika
[April 23, 2024, 01:48:51 pm]
May be useful to somebody
by
KodeZwerg
[April 23, 2024, 12:38:22 pm]
match automatic highlight...
by
Чебурашка
[April 23, 2024, 11:35:14 am]
Tchart with dual numbers ...
by
wp
[April 23, 2024, 10:48:18 am]
« previous
next »
Print
Pages:
1
[
2
]
Author
Topic: Creating forms dynamically (Read 17876 times)
RAW
Hero Member
Posts: 868
Re: Creating forms dynamically
«
Reply #15 on:
July 15, 2017, 01:45:41 am »
I guess it's better to use RELEASE than CLOSE...
If I use SHOW and after that CLOSE then the form goes to HIDE ??? Is that true ??? OK then RELEASE is better:
Code: Pascal
[Select]
[+]
[-]
Procedure
TForm1
.
FormActivate
(
Sender
:
TObject
)
;
Begin
If
booKillSplash
Then
Begin
If
Assigned
(
wndSplash
)
Then
wndSplash
.
Release
;
End
;
End
;
Procedure
TForm1
.
FormPaint
(
Sender
:
TObject
)
;
Begin
wndSplash
.
BringToFront
;
booKillSplash
:
=
True
;
End
;
Procedure
TForm1
.
wndSplashClick
(
Sender
:
TObject
)
;
Begin
wndSplash
.
Release
;
End
;
Logged
Windows 7 Pro (x64 Sp1) & Windows XP Pro (x86 Sp3).
RAW
Hero Member
Posts: 868
Re: Creating forms dynamically
«
Reply #16 on:
July 15, 2017, 07:25:55 am »
If you like to draw yourself, then you can download BGRABitmap from here
https://github.com/bgrabitmap/bgrabitmap
, extract it into the main program directory and use the attached program...
// interesting, if I use DRAW then the edge of the PNG looks darker and not like the original one... maybe I can figure it out tomorrow...
Logged
Windows 7 Pro (x64 Sp1) & Windows XP Pro (x86 Sp3).
RAW
Hero Member
Posts: 868
Re: Creating forms dynamically
«
Reply #17 on:
July 15, 2017, 07:29:03 am »
The edge is definitely darker...
Logged
Windows 7 Pro (x64 Sp1) & Windows XP Pro (x86 Sp3).
dietmar
Full Member
Posts: 170
Re: Creating forms dynamically
«
Reply #18 on:
July 15, 2017, 07:14:43 pm »
ThanksALot to all of you for your help which is really appreciated!
Dietmar
Logged
Lazarus 2.2.0RC1 with FPC 3.2.2 (32 Bit) on Windows10 (64Bit)
Handoko
Hero Member
Posts: 5158
My goal: build my own game engine using Lazarus
Re: Creating forms dynamically
«
Reply #19 on:
July 15, 2017, 07:21:28 pm »
RAW's fluid splashing splash screen really is
splash
screen.
+1
Logged
RAW
Hero Member
Posts: 868
Re: Creating forms dynamically
«
Reply #20 on:
July 16, 2017, 11:12:29 pm »
Dietmar found a bug...
I haven't noticed that: OnPaint should be executed only once.
Code: Pascal
[Select]
[+]
[-]
PRIVATE
booOnce
:
Boolean
;
Procedure
TForm1
.
FormPaint
(
Sender
:
TObject
)
;
Begin
If
Not
booOnce
Then
Begin
wndSplash
.
BringToFront
;
booKillSplash
:
=
True
;
booOnce
:
=
True
;
End
;
End
;
OR
Code: Pascal
[Select]
[+]
[-]
Procedure
TForm1
.
FormActivate
(
Sender
:
TObject
)
;
Begin
If
booKillSplash
Then
Begin
If
Assigned
(
wndSplash
)
Then
Begin
wndSplash
.
Release
;
wndSplash
:
=
Nil
;
End
;
End
;
End
;
Procedure
TForm1
.
FormPaint
(
Sender
:
TObject
)
;
Begin
If
Assigned
(
wndSplash
)
Then
Begin
wndSplash
.
BringToFront
;
booKillSplash
:
=
True
;
End
;
End
;
Procedure
TForm1
.
wndSplashClick
(
Sender
:
TObject
)
;
Begin
wndSplash
.
Release
;
wndSplash
:
=
Nil
;
End
;
Logged
Windows 7 Pro (x64 Sp1) & Windows XP Pro (x86 Sp3).
cpicanco
Hero Member
Posts: 618
Behavioral Scientist and Programmer
Re: Creating forms dynamically
«
Reply #21 on:
July 18, 2017, 11:06:19 pm »
Why form.release instead form.free ?
Logged
Be mindful and excellent with each other.
https://github.com/cpicanco/
RAW
Hero Member
Posts: 868
Re: Creating forms dynamically
«
Reply #22 on:
July 18, 2017, 11:47:01 pm »
I guess it's my habit...
(In this case probably overkill) ... you don't have to copy it...
Logged
Windows 7 Pro (x64 Sp1) & Windows XP Pro (x86 Sp3).
cpicanco
Hero Member
Posts: 618
Behavioral Scientist and Programmer
Re: Creating forms dynamically
«
Reply #23 on:
July 19, 2017, 12:57:33 am »
Release : mark for destruction -> I am guessing it is not destroyed immediately
Free : destroy -> Immediately?
Just trying to learn something new
Logged
Be mindful and excellent with each other.
https://github.com/cpicanco/
RAW
Hero Member
Posts: 868
Re: Creating forms dynamically
«
Reply #24 on:
July 19, 2017, 02:13:39 am »
I guess RELEASE let the form handle all messages before the form will be destroyed.
Maybe it's more safe...
Logged
Windows 7 Pro (x64 Sp1) & Windows XP Pro (x86 Sp3).
Print
Pages:
1
[
2
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
General
»
Creating forms dynamically
TinyPortal
© 2005-2018