forked from pyscripter/python4delphi
-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathMainForm.fmx
153 lines (152 loc) · 4.25 KB
/
MainForm.fmx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
object Form1: TForm1
Left = 0
Top = 0
Caption = 'MainForm'
ClientHeight = 480
ClientWidth = 640
FormFactor.Width = 320
FormFactor.Height = 480
FormFactor.Devices = [Desktop]
DesignerMasterStyle = 0
object OpenDialog1: TOpenDialog
DefaultExt = '*.py'
Filter = 'Python files|*.py|Text files|*.txt|All files|*.*'
Left = 200
end
object SaveDialog1: TSaveDialog
DefaultExt = '*.py'
Filter = 'Python files|*.py|Text files|*.txt|All files|*.*'
Left = 232
end
object Memo1: TMemo
Touch.InteractiveGestures = [Pan, LongTap, DoubleTap]
DataDetectorTypes = []
Align = Top
Size.Width = 640.000000000000000000
Size.Height = 200.000000000000000000
Size.PlatformDefault = False
TabOrder = 8
Viewport.Width = 636.000000000000000000
Viewport.Height = 196.000000000000000000
end
object Splitter1: TSplitter
Align = Top
Cursor = crVSplit
MinSize = 20.000000000000000000
Position.Y = 200.000000000000000000
Size.Width = 640.000000000000000000
Size.Height = 3.000000000000000000
Size.PlatformDefault = False
end
object Memo2: TMemo
Touch.InteractiveGestures = [Pan, LongTap, DoubleTap]
DataDetectorTypes = []
Lines.Strings = (
'from spam import Form'
''
'class SubForm(Form): '
' def __init__(self, Owner):'
' self.Caption = '#39'Subclassed form defined in Python'#39
''
'class DelphiSecondForm(Form):'
' pass'
''
'def createbaseform():'
' print('#39'Creates a Delphi FMX.TForm'#39')'
' form = Form(None)'
' try:'
' form.Caption = "Delphi FMX base form"'
' form.ShowModal()'
' finally:'
' form.Free();'
''
'def createpysubform():'
' print('#39'Creates a Delphi FMX.TForm subtype defined in Python'#39')'
' form = SubForm(None)'
' try:'
' form.ShowModal()'
' finally:'
' form.Free()'
''
'def createdelphisubform():'
' print('#39'Creates an instance of TDelphiSecondForm registerd form' +
#39')'
' form = DelphiSecondForm(None)'
' try:'
' print('#39'Label: '#39', form.Label1.Text)'
' form.ShowModal()'
' finally:'
' form.Free()'
''
'def main():'
' createbaseform()'
' createpysubform()'
' createdelphisubform()'
''
'if __name__ == '#39'__main__'#39':'
' try:'
' main()'
' except SystemExit:'
' pass')
Align = Client
Size.Width = 640.000000000000000000
Size.Height = 232.000000000000000000
Size.PlatformDefault = False
TabOrder = 10
Viewport.Width = 620.000000000000000000
Viewport.Height = 228.000000000000000000
end
object Panel1: TPanel
Align = Bottom
Position.Y = 435.000000000000000000
Size.Width = 640.000000000000000000
Size.Height = 45.000000000000000000
Size.PlatformDefault = False
TabOrder = 11
object Button1: TButton
Position.X = 8.000000000000000000
Position.Y = 10.000000000000000000
Size.Width = 97.000000000000000000
Size.Height = 22.000000000000000000
Size.PlatformDefault = False
TabOrder = 2
Text = 'Execute script'
OnClick = Button1Click
end
object Button2: TButton
Position.X = 192.000000000000000000
Position.Y = 10.000000000000000000
TabOrder = 1
Text = 'Load script...'
OnClick = Button2Click
end
object Button3: TButton
Position.X = 280.000000000000000000
Position.Y = 10.000000000000000000
TabOrder = 0
Text = 'Save script...'
OnClick = Button3Click
end
end
object PythonEngine1: TPythonEngine
IO = PythonGUIInputOutput1
Left = 8
end
object PythonModule1: TPythonModule
Engine = PythonEngine1
ModuleName = 'spam'
Errors = <>
Left = 40
end
object PythonGUIInputOutput1: TPythonGUIInputOutput
UnicodeIO = True
RawOutput = False
Output = Memo1
Left = 104
end
object PyDelphiWrapper1: TPyDelphiWrapper
Engine = PythonEngine1
Module = PythonModule1
Left = 72
end
end