Skip to content

Commit 0f4d3b4

Browse files
committed
Fixing demo 1
1 parent 8d71443 commit 0f4d3b4

File tree

4 files changed

+121
-61
lines changed

4 files changed

+121
-61
lines changed

PythonForDelphi/Demos/FPC/Demo01/project1.lpi

Lines changed: 83 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,87 @@
1-
<?xml version="1.0"?>
1+
<?xml version="1.0" encoding="UTF-8"?>
22
<CONFIG>
33
<ProjectOptions>
4-
<Version Value="9"/>
4+
<Version Value="10"/>
55
<PathDelim Value="\"/>
66
<General>
77
<MainUnit Value="0"/>
88
<UseXPManifest Value="True"/>
99
<Icon Value="0"/>
10-
<ActiveWindowIndexAtStart Value="0"/>
1110
</General>
1211
<VersionInfo>
1312
<Language Value=""/>
1413
<CharSet Value=""/>
15-
<StringTable ProductVersion=""/>
1614
</VersionInfo>
17-
<BuildModes Count="1">
15+
<BuildModes Count="3" Active="Debug">
1816
<Item1 Name="default" Default="True"/>
17+
<Item2 Name="Debug">
18+
<CompilerOptions>
19+
<Version Value="11"/>
20+
<PathDelim Value="\"/>
21+
<SearchPaths>
22+
<IncludeFiles Value="$(ProjOutDir)"/>
23+
</SearchPaths>
24+
<Parsing>
25+
<SyntaxOptions>
26+
<IncludeAssertionCode Value="True"/>
27+
<UseAnsiStrings Value="False"/>
28+
</SyntaxOptions>
29+
</Parsing>
30+
<CodeGeneration>
31+
<Checks>
32+
<IOChecks Value="True"/>
33+
<RangeChecks Value="True"/>
34+
<OverflowChecks Value="True"/>
35+
<StackChecks Value="True"/>
36+
</Checks>
37+
<VerifyObjMethodCallValidity Value="True"/>
38+
</CodeGeneration>
39+
<Linking>
40+
<Debugging>
41+
<DebugInfoType Value="dsDwarf2Set"/>
42+
<UseHeaptrc Value="True"/>
43+
<TrashVariables Value="True"/>
44+
<UseExternalDbgSyms Value="True"/>
45+
</Debugging>
46+
<Options>
47+
<Win32>
48+
<GraphicApplication Value="True"/>
49+
</Win32>
50+
</Options>
51+
</Linking>
52+
</CompilerOptions>
53+
</Item2>
54+
<Item3 Name="Release">
55+
<CompilerOptions>
56+
<Version Value="11"/>
57+
<PathDelim Value="\"/>
58+
<SearchPaths>
59+
<IncludeFiles Value="$(ProjOutDir)"/>
60+
</SearchPaths>
61+
<Parsing>
62+
<SyntaxOptions>
63+
<UseAnsiStrings Value="False"/>
64+
</SyntaxOptions>
65+
</Parsing>
66+
<CodeGeneration>
67+
<SmartLinkUnit Value="True"/>
68+
<Optimizations>
69+
<OptimizationLevel Value="3"/>
70+
</Optimizations>
71+
</CodeGeneration>
72+
<Linking>
73+
<Debugging>
74+
<GenerateDebugInfo Value="False"/>
75+
</Debugging>
76+
<LinkSmart Value="True"/>
77+
<Options>
78+
<Win32>
79+
<GraphicApplication Value="True"/>
80+
</Win32>
81+
</Options>
82+
</Linking>
83+
</CompilerOptions>
84+
</Item3>
1985
</BuildModes>
2086
<PublishOptions>
2187
<Version Value="2"/>
@@ -42,17 +108,16 @@
42108
<Unit0>
43109
<Filename Value="project1.lpr"/>
44110
<IsPartOfProject Value="True"/>
45-
<UnitName Value="project1"/>
46111
<UsageCount Value="74"/>
47112
</Unit0>
48113
<Unit1>
49114
<Filename Value="unit1.pas"/>
50115
<IsPartOfProject Value="True"/>
51116
<ComponentName Value="Form1"/>
117+
<HasResources Value="True"/>
52118
<ResourceBaseClass Value="Form"/>
53119
<UnitName Value="Unit1"/>
54-
<EditorIndex Value="0"/>
55-
<WindowIndex Value="0"/>
120+
<IsVisibleTab Value="True"/>
56121
<TopLine Value="30"/>
57122
<CursorPos X="62" Y="43"/>
58123
<UsageCount Value="74"/>
@@ -61,24 +126,19 @@
61126
</Unit1>
62127
<Unit2>
63128
<Filename Value="..\..\..\..\..\..\lazarus\fpc\2.2.4\source\rtl\inc\variants.pp"/>
64-
<UnitName Value="variants"/>
65-
<WindowIndex Value="0"/>
66129
<TopLine Value="4220"/>
67130
<CursorPos X="9" Y="4225"/>
68131
<UsageCount Value="37"/>
69132
</Unit2>
70133
<Unit3>
71134
<Filename Value="..\..\..\..\..\..\lazarus\fpc\2.2.4\source\rtl\inc\varianth.inc"/>
72-
<WindowIndex Value="0"/>
73135
<TopLine Value="115"/>
74136
<CursorPos X="94" Y="134"/>
75137
<UsageCount Value="37"/>
76138
</Unit3>
77139
<Unit4>
78140
<Filename Value="..\..\..\Components\Sources\Core\PythonGUIInputOutput.pas"/>
79-
<UnitName Value="PythonGUIInputOutput"/>
80-
<EditorIndex Value="3"/>
81-
<WindowIndex Value="0"/>
141+
<EditorIndex Value="2"/>
82142
<TopLine Value="154"/>
83143
<CursorPos X="52" Y="166"/>
84144
<UsageCount Value="11"/>
@@ -87,50 +147,42 @@
87147
</Unit4>
88148
<Unit5>
89149
<Filename Value="..\..\..\Components\Sources\Core\PythonEngine.pas"/>
90-
<UnitName Value="PythonEngine"/>
91-
<EditorIndex Value="4"/>
92-
<WindowIndex Value="0"/>
93-
<TopLine Value="1"/>
94-
<CursorPos X="1" Y="1"/>
150+
<EditorIndex Value="3"/>
151+
<TopLine Value="3382"/>
152+
<CursorPos X="31" Y="3391"/>
95153
<UsageCount Value="11"/>
96154
<Loaded Value="True"/>
97155
<DefaultSyntaxHighlighter Value="Delphi"/>
98156
</Unit5>
99157
<Unit6>
100158
<Filename Value="..\..\..\Components\p4dlaz.pas"/>
101159
<UnitName Value="P4DLaz"/>
102-
<EditorIndex Value="2"/>
103-
<WindowIndex Value="0"/>
104-
<TopLine Value="1"/>
160+
<EditorIndex Value="1"/>
105161
<CursorPos X="36" Y="11"/>
106162
<UsageCount Value="10"/>
107163
<Loaded Value="True"/>
108164
<DefaultSyntaxHighlighter Value="Delphi"/>
109165
</Unit6>
110166
<Unit7>
111167
<Filename Value="..\Demo06\Unit1.lfm"/>
112-
<IsVisibleTab Value="True"/>
113-
<EditorIndex Value="1"/>
114-
<WindowIndex Value="0"/>
115-
<TopLine Value="1"/>
116-
<CursorPos X="1" Y="1"/>
168+
<ComponentName Value="Form1"/>
169+
<HasResources Value="True"/>
170+
<ResourceBaseClass Value="Form"/>
171+
<EditorIndex Value="-1"/>
117172
<UsageCount Value="10"/>
118-
<Loaded Value="True"/>
119173
<DefaultSyntaxHighlighter Value="LFM"/>
120174
</Unit7>
121175
</Units>
122176
<JumpHistory Count="7" HistoryIndex="6">
123177
<Position1>
124178
<Filename Value="..\..\..\Components\Sources\Core\PythonGUIInputOutput.pas"/>
125-
<Caret Line="1" Column="1" TopLine="1"/>
126179
</Position1>
127180
<Position2>
128181
<Filename Value="..\..\..\Components\Sources\Core\PythonGUIInputOutput.pas"/>
129182
<Caret Line="205" Column="19" TopLine="193"/>
130183
</Position2>
131184
<Position3>
132185
<Filename Value="..\..\..\Components\Sources\Core\PythonEngine.pas"/>
133-
<Caret Line="1" Column="1" TopLine="1"/>
134186
</Position3>
135187
<Position4>
136188
<Filename Value="..\..\..\Components\Sources\Core\PythonEngine.pas"/>
@@ -146,12 +198,11 @@
146198
</Position6>
147199
<Position7>
148200
<Filename Value="..\..\..\Components\p4dlaz.pas"/>
149-
<Caret Line="1" Column="1" TopLine="1"/>
150201
</Position7>
151202
</JumpHistory>
152203
</ProjectOptions>
153204
<CompilerOptions>
154-
<Version Value="9"/>
205+
<Version Value="11"/>
155206
<PathDelim Value="\"/>
156207
<SearchPaths>
157208
<IncludeFiles Value="$(ProjOutDir)"/>
@@ -168,9 +219,6 @@
168219
</Win32>
169220
</Options>
170221
</Linking>
171-
<Other>
172-
<CompilerPath Value="$(CompPath)"/>
173-
</Other>
174222
</CompilerOptions>
175223
<Debugging>
176224
<Exceptions Count="3">
0 Bytes
Binary file not shown.

PythonForDelphi/Demos/FPC/Demo01/unit1.lfm

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@ object Form1: TForm1
33
Height = 391
44
Top = 175
55
Width = 547
6+
ActiveControl = Memo1
67
Caption = 'Form1'
78
ClientHeight = 391
89
ClientWidth = 547
9-
LCLVersion = '0.9.30.2'
10+
DesignTimePPI = 134
11+
LCLVersion = '1.7'
12+
Visible = False
1013
object Panel1: TPanel
1114
Left = 0
1215
Height = 391
@@ -15,13 +18,15 @@ object Form1: TForm1
1518
Align = alClient
1619
ClientHeight = 391
1720
ClientWidth = 547
21+
ParentFont = False
1822
TabOrder = 0
1923
object Memo1: TMemo
2024
Left = 1
2125
Height = 183
2226
Top = 1
2327
Width = 545
2428
Align = alTop
29+
ParentFont = False
2530
TabOrder = 0
2631
end
2732
object PairSplitter1: TPairSplitter
@@ -53,8 +58,9 @@ object Form1: TForm1
5358
Width = 545
5459
Align = alClient
5560
Lines.Strings = (
56-
'print 2+2'
61+
'print(2+2)'
5762
)
63+
ParentFont = False
5864
TabOrder = 2
5965
end
6066
object Panel2: TPanel
@@ -65,6 +71,7 @@ object Form1: TForm1
6571
Align = alBottom
6672
ClientHeight = 46
6773
ClientWidth = 545
74+
ParentFont = False
6875
TabOrder = 3
6976
object Button1: TButton
7077
Left = 223
@@ -73,21 +80,23 @@ object Form1: TForm1
7380
Width = 75
7481
Caption = 'Execute'
7582
OnClick = Button1Click
83+
ParentFont = False
7684
TabOrder = 0
7785
end
7886
end
7987
end
8088
object PythonEngine1: TPythonEngine
8189
IO = PythonGUIInputOutput1
82-
left = 96
83-
top = 48
90+
PyFlags = [pfIgnoreEnvironmentFlag]
91+
Left = 96
92+
Top = 48
8493
end
8594
object PythonGUIInputOutput1: TPythonGUIInputOutput
8695
DelayWrites = True
8796
UnicodeIO = False
8897
RawOutput = False
8998
Output = Memo1
90-
left = 338
91-
top = 48
99+
Left = 338
100+
Top = 48
92101
end
93102
end

PythonForDelphi/Demos/FPC/Demo01/unit1.lrs

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,27 @@
22

33
LazarusResources.Add('TForm1','FORMDATA',[
44
'TPF0'#6'TForm1'#5'Form1'#4'Left'#3'"'#1#6'Height'#3#135#1#3'Top'#3#175#0#5'W'
5-
+'idth'#3'#'#2#7'Caption'#6#5'Form1'#12'ClientHeight'#3#135#1#11'ClientWidth'
6-
+#3'#'#2#10'LCLVersion'#6#8'0.9.30.2'#0#6'TPanel'#6'Panel1'#4'Left'#2#0#6'Hei'
7-
+'ght'#3#135#1#3'Top'#2#0#5'Width'#3'#'#2#5'Align'#7#8'alClient'#12'ClientHei'
8-
+'ght'#3#135#1#11'ClientWidth'#3'#'#2#8'TabOrder'#2#0#0#5'TMemo'#5'Memo1'#4'L'
9-
+'eft'#2#1#6'Height'#3#183#0#3'Top'#2#1#5'Width'#3'!'#2#5'Align'#7#5'alTop'#8
10-
+'TabOrder'#2#0#0#0#13'TPairSplitter'#13'PairSplitter1'#4'Left'#2#1#6'Height'
11-
+#2#8#3'Top'#3#184#0#5'Width'#3'!'#2#5'Align'#7#5'alTop'#8'Position'#2'-'#0#17
12-
+'TPairSplitterSide'#17'PairSplitterSide1'#6'Cursor'#7#7'crArrow'#4'Left'#2#0
13-
+#6'Height'#2#8#3'Top'#2#0#5'Width'#2'-'#0#0#17'TPairSplitterSide'#17'PairSpl'
14-
+'itterSide2'#6'Cursor'#7#7'crArrow'#4'Left'#2'2'#6'Height'#2#8#3'Top'#2#0#5
15-
+'Width'#3#239#1#0#0#0#5'TMemo'#5'Memo2'#4'Left'#2#1#6'Height'#3#152#0#3'Top'
16-
+#3#192#0#5'Width'#3'!'#2#5'Align'#7#8'alClient'#13'Lines.Strings'#1#6#9'prin'
17-
+'t 2+2'#0#8'TabOrder'#2#2#0#0#6'TPanel'#6'Panel2'#4'Left'#2#1#6'Height'#2'.'
18-
+#3'Top'#3'X'#1#5'Width'#3'!'#2#5'Align'#7#8'alBottom'#12'ClientHeight'#2'.'
19-
+#11'ClientWidth'#3'!'#2#8'TabOrder'#2#3#0#7'TButton'#7'Button1'#4'Left'#3#223
20-
+#0#6'Height'#2#25#3'Top'#2#8#5'Width'#2'K'#7'Caption'#6#7'Execute'#7'OnClick'
21-
+#7#12'Button1Click'#8'TabOrder'#2#0#0#0#0#0#13'TPythonEngine'#13'PythonEngin'
22-
+'e1'#2'IO'#7#21'PythonGUIInputOutput1'#4'left'#2'`'#3'top'#2'0'#0#0#21'TPyth'
23-
+'onGUIInputOutput'#21'PythonGUIInputOutput1'#11'DelayWrites'#9#9'UnicodeIO'#8
24-
+#9'RawOutput'#8#6'Output'#7#5'Memo1'#4'left'#3'R'#1#3'top'#2'0'#0#0#0
5+
+'idth'#3'#'#2#13'ActiveControl'#7#5'Memo1'#7'Caption'#6#5'Form1'#12'ClientHe'
6+
+'ight'#3#135#1#11'ClientWidth'#3'#'#2#13'DesignTimePPI'#3#134#0#10'LCLVersio'
7+
+'n'#6#3'1.7'#7'Visible'#8#0#6'TPanel'#6'Panel1'#4'Left'#2#0#6'Height'#3#135#1
8+
+#3'Top'#2#0#5'Width'#3'#'#2#5'Align'#7#8'alClient'#12'ClientHeight'#3#135#1
9+
+#11'ClientWidth'#3'#'#2#10'ParentFont'#8#8'TabOrder'#2#0#0#5'TMemo'#5'Memo1'
10+
+#4'Left'#2#1#6'Height'#3#183#0#3'Top'#2#1#5'Width'#3'!'#2#5'Align'#7#5'alTop'
11+
+#10'ParentFont'#8#8'TabOrder'#2#0#0#0#13'TPairSplitter'#13'PairSplitter1'#4
12+
+'Left'#2#1#6'Height'#2#8#3'Top'#3#184#0#5'Width'#3'!'#2#5'Align'#7#5'alTop'#8
13+
+'Position'#2'-'#0#17'TPairSplitterSide'#17'PairSplitterSide1'#6'Cursor'#7#7
14+
+'crArrow'#4'Left'#2#0#6'Height'#2#8#3'Top'#2#0#5'Width'#2'-'#0#0#17'TPairSpl'
15+
+'itterSide'#17'PairSplitterSide2'#6'Cursor'#7#7'crArrow'#4'Left'#2'2'#6'Heig'
16+
+'ht'#2#8#3'Top'#2#0#5'Width'#3#239#1#0#0#0#5'TMemo'#5'Memo2'#4'Left'#2#1#6'H'
17+
+'eight'#3#152#0#3'Top'#3#192#0#5'Width'#3'!'#2#5'Align'#7#8'alClient'#13'Lin'
18+
+'es.Strings'#1#6#10'print(2+2)'#0#10'ParentFont'#8#8'TabOrder'#2#2#0#0#6'TPa'
19+
+'nel'#6'Panel2'#4'Left'#2#1#6'Height'#2'.'#3'Top'#3'X'#1#5'Width'#3'!'#2#5'A'
20+
+'lign'#7#8'alBottom'#12'ClientHeight'#2'.'#11'ClientWidth'#3'!'#2#10'ParentF'
21+
+'ont'#8#8'TabOrder'#2#3#0#7'TButton'#7'Button1'#4'Left'#3#223#0#6'Height'#2
22+
+#25#3'Top'#2#8#5'Width'#2'K'#7'Caption'#6#7'Execute'#7'OnClick'#7#12'Button1'
23+
+'Click'#10'ParentFont'#8#8'TabOrder'#2#0#0#0#0#0#13'TPythonEngine'#13'Python'
24+
+'Engine1'#2'IO'#7#21'PythonGUIInputOutput1'#7'PyFlags'#11#23'pfIgnoreEnviron'
25+
+'mentFlag'#0#4'Left'#2'`'#3'Top'#2'0'#0#0#21'TPythonGUIInputOutput'#21'Pytho'
26+
+'nGUIInputOutput1'#11'DelayWrites'#9#9'UnicodeIO'#8#9'RawOutput'#8#6'Output'
27+
+#7#5'Memo1'#4'Left'#3'R'#1#3'Top'#2'0'#0#0#0
2528
]);

0 commit comments

Comments
 (0)