Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions Demos/Demo32/Demo32.dproj
Original file line number Diff line number Diff line change
Expand Up @@ -57,23 +57,25 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win32)'!=''">
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<Icon_MainIcon>Demo32_Icon.ico</Icon_MainIcon>
<Icon_MainIcon>$(BDS)\bin\delphi_PROJECTICON.ico</Icon_MainIcon>
<DCC_Namespace>System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
<VerInfo_Locale>1033</VerInfo_Locale>
<Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
<UWP_DelphiLogo44>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png</UWP_DelphiLogo44>
<UWP_DelphiLogo150>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png</UWP_DelphiLogo150>
<AppDPIAwarenessMode>PerMonitorV2</AppDPIAwarenessMode>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win64)'!=''">
<DCC_Namespace>System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace)</DCC_Namespace>
<Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<VerInfo_Locale>1033</VerInfo_Locale>
<Icon_MainIcon>Demo32_Icon.ico</Icon_MainIcon>
<Icon_MainIcon>$(BDS)\bin\delphi_PROJECTICON.ico</Icon_MainIcon>
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
<UWP_DelphiLogo44>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png</UWP_DelphiLogo44>
<UWP_DelphiLogo150>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png</UWP_DelphiLogo150>
<AppDPIAwarenessMode>PerMonitorV2</AppDPIAwarenessMode>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1)'!=''">
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
Expand All @@ -88,7 +90,6 @@
<BT_BuildType>Debug</BT_BuildType>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2_Win64)'!=''">
<Icon_MainIcon>$(BDS)\bin\delphi_PROJECTICON.ico</Icon_MainIcon>
<VerInfo_Locale>1033</VerInfo_Locale>
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<BT_BuildType>Debug</BT_BuildType>
Expand Down Expand Up @@ -153,10 +154,7 @@
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="Comments"/>
</VersionInfoKeys>
<Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dcloffice2k210.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dclofficexp210.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages>
</Excluded_Packages>
<Excluded_Packages/>
</Delphi.Personality>
<Platforms>
<Platform value="Win32">True</Platform>
Expand Down
85 changes: 48 additions & 37 deletions Demos/Demo32/Unit1.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ object Form1: TForm1
OldCreateOrder = True
Visible = True
PixelsPerInch = 96
TextHeight = 11
TextHeight = 13
object Splitter1: TSplitter
Left = 0
Top = 169
Expand All @@ -32,6 +32,12 @@ object Form1: TForm1
Width = 576
Height = 170
Align = alClient
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -13
Font.Name = 'Consolas'
Font.Pitch = fpVariable
Font.Style = []
Lines.Strings = (
'import spam'
''
Expand All @@ -40,46 +46,46 @@ object Form1: TForm1
' Self.OffsetBy(v, v)'
''
'p = spam.Point(2, 5)'
'print p, type(p)'
'print (p, type(p))'
'p.OffsetBy( 3, 3 )'
'print p.x, p.y'
'print "Name =", p.Name'
'print (p.x, p.y)'
'print ("Name =", p.Name)'
'p.Name = '#39'Hello world!'#39
'print "Name =", p.Name'
'print ("Name =", p.Name)'
''
'p = spam.Point(2, 5) '
'print p, type(p)'
'p = spam.Point(2, 5)'
'print (p, type(p))'
'p.OffsetBy( 3, 3 )'
'print p.x, p.y'
'print (p.x, p.y)'
''
'# create a subtype instance'
'p = MyPoint(2, 5)'
'print p, type(p)'
'print (p, type(p))'
'p.OffsetBy( 3, 3 )'
'print p.x, p.y'
'print (p.x, p.y)'
'p.Foo( 4 )'
'print p.x, p.y'
'print dir(spam)'
'print spam.Point'
'print "p = ", p, " --> ",'
'print (p.x, p.y)'
'print (dir(spam))'
'print (spam.Point)'
'print ("p = ", p, " --> ",)'
'if type(p) is spam.Point:'
' print "p is a Point"'
' print ("p is a Point")'
'else:'
' print "p is not a point"'
' print ("p is not a point")'
'p = 2'
'print "p = ", p, " --> ",'
'print ("p = ", p, " --> ",)'
'if type(p) is spam.Point:'
' print "p is a Point"'
' print ("p is a Point")'
'else:'
' print "p is not a point"'
' print ("p is not a point")'
''
'# You can raise error from a Python script to !'
'# You can raise errors from a Python script too !'

'print "---------------------------------------------------------' +
'---------"'
'print "Errors in a Python script"'
'print ("--------------------------------------------------------' +
'----------")'
'print ("Errors in a Python script")'
'try:'
' raise spam.EBadPoint, "this is a test !"'
' raise spam.EBadPoint("this is a test !")'
'except:'
' pass'
''
Expand All @@ -90,19 +96,21 @@ object Form1: TForm1
' err.c = 3'
' raise err'

'except spam.PointError, what: #it shows you that you can interce' +
'pt a parent class'
' print "Catched an error dirived from PointError"'
'except spam.PointError as what: # this shows that you can interc' +
'ept a parent class'
' print ("Caught an error derived from PointError")'

' print "Error class = ", what.__class__, " a =", what.a, " ' +
' b =", what.b, " c =", what.c'
' print ("Error class = ", what.__class__, " a =", what.a, "' +
' b =", what.b, " c =", what.c)'
''
'if p == spam.Point(2, 5): '
' print "Equal"'
'if p == spam.Point(2, 5):'
' print ("Equal")'
'else:'
' print "Not equal"')
ScrollBars = ssVertical
' print ("Not equal")')
ParentFont = False
ScrollBars = ssBoth
TabOrder = 0
WordWrap = False
end
object Panel1: TPanel
Left = 0
Expand All @@ -128,14 +136,17 @@ object Form1: TForm1
Width = 576
Height = 169
Align = alTop
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -13
Font.Name = 'Consolas'
Font.Pitch = fpVariable
Font.Style = []
ParentFont = False
ScrollBars = ssBoth
TabOrder = 2
end
object PythonEngine1: TPythonEngine
DllName = 'python27.dll'
APIVersion = 1013
RegVersion = '2.7'
UseLastKnownVersion = False
IO = PythonGUIInputOutput1
Left = 32
Top = 16
Expand Down