Skip to content

Commit 8bc2874

Browse files
committed
Added the Simple Demo
1 parent b0bd45c commit 8bc2874

15 files changed

+1537
-0
lines changed
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
program D4P_export_demo;
2+
3+
uses
4+
System.StartUpCopy,
5+
FMX.Forms,
6+
parent_window in 'parent_window.pas' {Parent_Form},
7+
child_window in 'child_window.pas' {Child_Form};
8+
9+
{$R *.res}
10+
11+
begin
12+
Application.Initialize;
13+
Application.CreateForm(TParent_Form, Parent_Form);
14+
Application.CreateForm(TChild_Form, Child_Form);
15+
Application.Run;
16+
end.

Samples/Simple_Demo/D4P_export_demo.dproj

+1,128
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import os
2+
from delphifmx import *
3+
4+
class Child_Form(Form):
5+
6+
def __init__(self, owner):
7+
self.child_heading = None
8+
self.result_text_heading = None
9+
self.result_text_label = None
10+
self.LoadProps(os.path.join(os.path.dirname(os.path.abspath(__file__)), "child_window.pyfmx"))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
object Child_Form: TChild_Form
2+
Left = 0
3+
Top = 0
4+
Caption = 'Child Window'
5+
ClientHeight = 480
6+
ClientWidth = 640
7+
FormFactor.Width = 320
8+
FormFactor.Height = 480
9+
FormFactor.Devices = [Desktop]
10+
DesignerMasterStyle = 0
11+
object child_heading: TLabel
12+
StyledSettings = [Family, FontColor]
13+
Position.X = 192.000000000000000000
14+
Position.Y = 40.000000000000000000
15+
Size.Width = 161.000000000000000000
16+
Size.Height = 41.000000000000000000
17+
Size.PlatformDefault = False
18+
TextSettings.Font.Size = 20.000000000000000000
19+
TextSettings.Font.StyleExt = {00070000000000000004000000}
20+
Text = 'I'#39'm a child form'
21+
TabOrder = 0
22+
end
23+
object result_text_heading: TLabel
24+
Position.X = 16.000000000000000000
25+
Position.Y = 128.000000000000000000
26+
Size.Width = 201.000000000000000000
27+
Size.Height = 17.000000000000000000
28+
Size.PlatformDefault = False
29+
Text = 'Text you entered in the Mainform is:'
30+
TabOrder = 1
31+
end
32+
object result_text_label: TLabel
33+
Position.X = 225.000000000000000000
34+
Position.Y = 128.000000000000000000
35+
Size.Width = 384.000000000000000000
36+
Size.Height = 17.000000000000000000
37+
Size.PlatformDefault = False
38+
TabOrder = 2
39+
end
40+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import os
2+
from delphifmx import *
3+
4+
class Parent_Form(Form):
5+
6+
def __init__(self, owner):
7+
self.my_button = None
8+
self.enter_text_edit = None
9+
self.enter_text_label = None
10+
self.main_heading = None
11+
self.LoadProps(os.path.join(os.path.dirname(os.path.abspath(__file__)), "parent_window.pyfmx"))
12+
13+
def my_buttonClick(self, Sender):
14+
pass
15+
16+
def main():
17+
Application.Initialize()
18+
Application.Title = 'Parent Window'
19+
Application.MainForm = Parent_Form(Application)
20+
Application.MainForm.Show()
21+
Application.Run()
22+
Application.MainForm.Destroy()
23+
24+
if __name__ == '__main__':
25+
main()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
object Parent_Form: TParent_Form
2+
Left = 0
3+
Top = 0
4+
Caption = 'Parent Window'
5+
ClientHeight = 480
6+
ClientWidth = 640
7+
FormFactor.Width = 320
8+
FormFactor.Height = 480
9+
FormFactor.Devices = [Desktop]
10+
DesignerMasterStyle = 0
11+
object my_button: TButton
12+
Position.X = 241.000000000000000000
13+
Position.Y = 192.000000000000000000
14+
TabOrder = 0
15+
Text = 'Press Me'
16+
OnClick = my_buttonClick
17+
end
18+
object enter_text_edit: TEdit
19+
Touch.InteractiveGestures = [LongTap, DoubleTap]
20+
TabOrder = 1
21+
Position.X = 176.000000000000000000
22+
Position.Y = 144.000000000000000000
23+
Size.Width = 209.000000000000000000
24+
Size.Height = 30.000000000000000000
25+
Size.PlatformDefault = False
26+
end
27+
object enter_text_label: TLabel
28+
Position.X = 176.000000000000000000
29+
Position.Y = 119.000000000000000000
30+
Size.Width = 217.000000000000000000
31+
Size.Height = 17.000000000000000000
32+
Size.PlatformDefault = False
33+
Text = 'Please enter something in the Edit box'
34+
TabOrder = 2
35+
end
36+
object main_heading: TLabel
37+
StyledSettings = [Family, FontColor]
38+
Position.X = 136.000000000000000000
39+
Position.Y = 32.000000000000000000
40+
Size.Width = 281.000000000000000000
41+
Size.Height = 41.000000000000000000
42+
Size.PlatformDefault = False
43+
TextSettings.Font.Size = 30.000000000000000000
44+
TextSettings.Font.StyleExt = {00070000000000000004000000}
45+
Text = 'I'#39'm the MainForm'
46+
TabOrder = 3
47+
end
48+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from delphifmx import *
2+
from parent_window import Parent_Form
3+
4+
def main():
5+
Application.Initialize()
6+
Application.Title = 'Exporter Demo'
7+
Application.MainForm = Parent_Form(Application)
8+
Application.MainForm.Show()
9+
Application.Run()
10+
Application.MainForm.Destroy()
11+
12+
if __name__ == '__main__':
13+
main()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import os
2+
from delphifmx import *
3+
4+
class Child_Form(Form):
5+
6+
def __init__(self, owner):
7+
self.child_heading = None
8+
self.result_text_heading = None
9+
self.result_text_label = None
10+
self.LoadProps(os.path.join(os.path.dirname(os.path.abspath(__file__)), "child_window.pyfmx"))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
object Child_Form: TChild_Form
2+
Left = 0
3+
Top = 0
4+
Caption = 'Child Window'
5+
ClientHeight = 480
6+
ClientWidth = 640
7+
FormFactor.Width = 320
8+
FormFactor.Height = 480
9+
FormFactor.Devices = [Desktop]
10+
DesignerMasterStyle = 0
11+
object child_heading: TLabel
12+
StyledSettings = [Family, FontColor]
13+
Position.X = 192.000000000000000000
14+
Position.Y = 40.000000000000000000
15+
Size.Width = 161.000000000000000000
16+
Size.Height = 41.000000000000000000
17+
Size.PlatformDefault = False
18+
TextSettings.Font.Size = 20.000000000000000000
19+
TextSettings.Font.StyleExt = {00070000000000000004000000}
20+
Text = 'I'#39'm a child form'
21+
TabOrder = 0
22+
end
23+
object result_text_heading: TLabel
24+
Position.X = 16.000000000000000000
25+
Position.Y = 128.000000000000000000
26+
Size.Width = 201.000000000000000000
27+
Size.Height = 17.000000000000000000
28+
Size.PlatformDefault = False
29+
Text = 'Text you entered in the Mainform is:'
30+
TabOrder = 1
31+
end
32+
object result_text_label: TLabel
33+
Position.X = 225.000000000000000000
34+
Position.Y = 128.000000000000000000
35+
Size.Width = 384.000000000000000000
36+
Size.Height = 17.000000000000000000
37+
Size.PlatformDefault = False
38+
TabOrder = 3
39+
end
40+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import os
2+
from delphifmx import *
3+
from child_window import Child_Form
4+
5+
class Parent_Form(Form):
6+
7+
def __init__(self, owner):
8+
self.my_button = None
9+
self.enter_text_edit = None
10+
self.enter_text_label = None
11+
self.main_heading = None
12+
self.LoadProps(os.path.join(os.path.dirname(os.path.abspath(__file__)), "parent_window.pyfmx"))
13+
self.child_form = Child_Form(self)
14+
15+
def my_buttonClick(self, Sender):
16+
self.child_form.result_text_label.Text = self.enter_text_edit.Text
17+
self.child_form.show()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
object Parent_Form: TParent_Form
2+
Left = 0
3+
Top = 0
4+
Caption = 'Parent Window'
5+
ClientHeight = 480
6+
ClientWidth = 640
7+
FormFactor.Width = 320
8+
FormFactor.Height = 480
9+
FormFactor.Devices = [Desktop]
10+
DesignerMasterStyle = 0
11+
object my_button: TButton
12+
Position.X = 241.000000000000000000
13+
Position.Y = 192.000000000000000000
14+
TabOrder = 0
15+
Text = 'Press Me'
16+
OnClick = my_buttonClick
17+
end
18+
object enter_text_edit: TEdit
19+
Touch.InteractiveGestures = [LongTap, DoubleTap]
20+
TabOrder = 1
21+
Position.X = 176.000000000000000000
22+
Position.Y = 144.000000000000000000
23+
Size.Width = 209.000000000000000000
24+
Size.Height = 22.000000000000000000
25+
Size.PlatformDefault = False
26+
end
27+
object enter_text_label: TLabel
28+
Position.X = 176.000000000000000000
29+
Position.Y = 119.000000000000000000
30+
Size.Width = 217.000000000000000000
31+
Size.Height = 17.000000000000000000
32+
Size.PlatformDefault = False
33+
Text = 'Please enter something in the Edit box'
34+
TabOrder = 2
35+
end
36+
object main_heading: TLabel
37+
StyledSettings = [Family, FontColor]
38+
Position.X = 136.000000000000000000
39+
Position.Y = 32.000000000000000000
40+
Size.Width = 281.000000000000000000
41+
Size.Height = 41.000000000000000000
42+
Size.PlatformDefault = False
43+
TextSettings.Font.Size = 30.000000000000000000
44+
TextSettings.Font.StyleExt = {00070000000000000004000000}
45+
Text = 'I'#39'm the MainForm'
46+
TabOrder = 3
47+
end
48+
end

Samples/Simple_Demo/child_window.fmx

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
object Child_Form: TChild_Form
2+
Left = 0
3+
Top = 0
4+
Caption = 'Child Window'
5+
ClientHeight = 480
6+
ClientWidth = 640
7+
FormFactor.Width = 320
8+
FormFactor.Height = 480
9+
FormFactor.Devices = [Desktop]
10+
DesignerMasterStyle = 0
11+
object child_heading: TLabel
12+
StyledSettings = [Family, FontColor]
13+
Position.X = 192.000000000000000000
14+
Position.Y = 40.000000000000000000
15+
Size.Width = 161.000000000000000000
16+
Size.Height = 41.000000000000000000
17+
Size.PlatformDefault = False
18+
TextSettings.Font.Size = 20.000000000000000000
19+
TextSettings.Font.StyleExt = {00070000000000000004000000}
20+
Text = 'I'#39'm a child form'
21+
TabOrder = 0
22+
end
23+
object result_text_heading: TLabel
24+
Position.X = 16.000000000000000000
25+
Position.Y = 128.000000000000000000
26+
Size.Width = 201.000000000000000000
27+
Size.Height = 17.000000000000000000
28+
Size.PlatformDefault = False
29+
Text = 'Text you entered in the Mainform is:'
30+
TabOrder = 1
31+
end
32+
end

Samples/Simple_Demo/child_window.pas

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
unit child_window;
2+
3+
interface
4+
5+
uses
6+
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
7+
FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs,
8+
FMX.Controls.Presentation, FMX.StdCtrls;
9+
10+
type
11+
TChild_Form = class(TForm)
12+
child_heading: TLabel;
13+
result_text_heading: TLabel;
14+
private
15+
{ Private declarations }
16+
public
17+
{ Public declarations }
18+
end;
19+
20+
var
21+
Child_Form: TChild_Form;
22+
23+
implementation
24+
25+
{$R *.fmx}
26+
27+
end.

Samples/Simple_Demo/parent_window.fmx

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
object Parent_Form: TParent_Form
2+
Left = 0
3+
Top = 0
4+
Caption = 'Parent Window'
5+
ClientHeight = 480
6+
ClientWidth = 640
7+
FormFactor.Width = 320
8+
FormFactor.Height = 480
9+
FormFactor.Devices = [Desktop]
10+
DesignerMasterStyle = 0
11+
object my_button: TButton
12+
Position.X = 241.000000000000000000
13+
Position.Y = 192.000000000000000000
14+
TabOrder = 0
15+
Text = 'Press Me'
16+
OnClick = my_buttonClick
17+
end
18+
object enter_text_edit: TEdit
19+
Touch.InteractiveGestures = [LongTap, DoubleTap]
20+
TabOrder = 1
21+
Position.X = 176.000000000000000000
22+
Position.Y = 144.000000000000000000
23+
Size.Width = 209.000000000000000000
24+
Size.Height = 22.000000000000000000
25+
Size.PlatformDefault = False
26+
end
27+
object enter_text_label: TLabel
28+
Position.X = 176.000000000000000000
29+
Position.Y = 119.000000000000000000
30+
Size.Width = 217.000000000000000000
31+
Size.Height = 17.000000000000000000
32+
Size.PlatformDefault = False
33+
Text = 'Please enter something in the Edit box'
34+
TabOrder = 2
35+
end
36+
object main_heading: TLabel
37+
StyledSettings = [Family, FontColor]
38+
Position.X = 136.000000000000000000
39+
Position.Y = 32.000000000000000000
40+
Size.Width = 281.000000000000000000
41+
Size.Height = 41.000000000000000000
42+
Size.PlatformDefault = False
43+
TextSettings.Font.Size = 30.000000000000000000
44+
TextSettings.Font.StyleExt = {00070000000000000004000000}
45+
Text = 'I'#39'm the MainForm'
46+
TabOrder = 3
47+
end
48+
end

0 commit comments

Comments
 (0)