-
-
Notifications
You must be signed in to change notification settings - Fork 318
/
Copy pathTestFMX.py
46 lines (34 loc) · 1.2 KB
/
TestFMX.py
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
from DelphiFMX import *
class MainForm(Form):
def __init__(self, Owner):
self.Caption = "A FMX Form..."
self.SetBounds(10, 10, 500, 400)
self.lblHello = Label(self)
self.lblHello.SetProps(Parent=self, Text="Hello Python")
self.lblHello.SetBounds(10, 10, 300, 24)
self.edit1 = Edit(self)
self.edit1.SetProps(Parent=self)
self.edit1.SetBounds(10, 30, 250, 24)
self.button1 = Button(self)
self.button1.Parent = self
self.button1.SetBounds(270,24,100,30)
self.button1.Text = "Add"
self.button1.OnClick = self.Button1Click
self.lb1 = ListBox(self)
self.lb1.Parent = self
self.lb1.SetBounds(10,60,300,300)
self.OnClose = self.MainFormClose
def MainFormClose(self, Sender, Action):
Action.Value = caFree
Application.Terminate
def Button1Click(self, Sender):
self.lb1.Items.Add(self.edit1.Text)
self.edit1.Text = ""
def main():
Application.Initialize()
Application.Title = "MyDelphiApp"
f = MainForm(Application)
f.Show()
#FreeConsole()
Application.Run()
main()