def launch(): ds = pylax.Dynaset("SalesOrder", "SELECT OrderID, Customer, LE.Name AS CustomerName, OrderDate FROM SalesOrder JOIN le ON LeID=Customer;") ds.autoColumn = ds.add_column("OrderID", int, key=True) ds.add_column("Customer", int) ds.add_column("CustomerName", str, None) dt = ds.add_column("OrderDate", datetime.datetime, False, format="{:%Y-%m-%d}", default = datetime.datetime.now()) dsOrderLine = pylax.Dynaset("OrderLine", "SELECT OrderLine.OrderID AS OrderID, Item, Quantity, Price, Quantity * Price AS Amount, OrderLine.rowid AS RowID FROM OrderLine JOIN SalesOrder ON SalesOrder.OrderID=OrderLine.OrderID WHERE OrderLine.OrderID=:OrderID;", parent=ds) dsOrderLine.add_column("RowID", int, key=True) dsOrderLine.add_column("OrderID", int, parent = "OrderID") dsOrderLine.add_column("Item", int) dsOrderLine.add_column("Quantity", float) dsOrderLine.add_column("Price", float) dsOrderLine.add_column("Amount", key=None) #dsOrderLine.on_parent_changed=dsOrderLine__on_parent_changed #print(dsOrderLine.parent) #dsOrderLine.autoExecute = False form = pylax.Form(None, 20, 30, 640, 480, "Order", ds) form.icon = pylax.Image("Order.ico") #form.minWidth, form.minHeight = 640, 400 form.before_close=dsOrderLine__on_parent_changed tableSelect = pylax.Table(form, 20, 44, -20, 100, dynaset=ds) tableSelect.add_column("Customer", 150, "CustomerName") # title, width, Dynaset column name tableSelect.add_column("ID", 30, "OrderID") tableSelect.add_column("Date", 90, "OrderDate", format="{:%y-%m-%d}") entrySearch = pylax.Entry(form, 90, 20, 120, 20, "Search Name") #, label = pylax.Label(form, 20, 20, 70, 20, "Search")) #print(entrySearch.dataType) ds.buttonSearch = pylax.Button(form, 220, 20, 60, 20, "Search") ds.buttonSearch.on_click = searchButton__on_click; entryID = pylax.Entry(form, 100, 160, 120, 20, dynaset=ds, column="OrderID", dataType=int, label = pylax.Label(form, 20, 160, 70, 20, "ID")) entryDate = pylax.Entry(form, 100, 190, 120, 20, dynaset=ds, column="OrderDate", format="{:%Y-%m-%d %H:%M}", label = pylax.Label(form, 20, 190, 70, 20, "Date")) entryDate.editFormat = "{:%Y-%m-%d %H:%M:%S}" entryCustomer = pylax.Entry(form, 330, 160, 120, 20, dynaset=ds, column="CustomerName", format="{:%Y-%m-%d %H:%M}", label = pylax.Label(form, 240, 160, 90, 20, "Customer")) entryCustomer.verify = entryCustomer__verify tableOrderLine = pylax.Table(form, 20, 220, -20, -80, dynaset=dsOrderLine) tableOrderLine.add_column("Item ID", 50, "Item") tableOrderLine.add_column("Quantity", 50, "Quantity") entryQuantity = pylax.Entry(form, 120, -70, 120, 20, dynaset=dsOrderLine, column="Quantity", label = pylax.Label(form, 20, -70, 90, 20, "Quantity")) #print(entrySearch.alignHoriz) ds.buttonNew = pylax.Button(form, -370, -40, 60, 20, "New") ds.buttonEdit = pylax.Button(form, -300, -40, 60, 20, "Edit") ds.buttonUndo = pylax.Button(form, -230, -40, 60, 20, "Undo") ds.buttonSave = pylax.Button(form, -160, -40, 60, 20, "Save") ds.buttonDelete = pylax.Button(form, -90, -40, 60, 20, "Delete") labelFormCaption = pylax.Label(form, 2, 2, 20, 60, "FormCaption", dynaset=ds, column="CustomerName", visible = False) labelFormCaption.captionClient = form # passes any assigment to property 'data' on to property 'caption' of the captionClient r = ds.execute()
def launch(): form = pylax.Form(None, 20, 30, 680, 500, "Item") #form.minWidth, form.minHeight = 640, 480 ds = pylax.Dynaset( "Item", "SELECT ItemID, Name, Description, Picture, Parent FROM Item ORDER BY Name DESC LIMIT 100;" ) ds.autoColumn = ds.add_column("ItemID", int, format="{:,}", key=True) ds.add_column("Name") ds.add_column("Description", str) ds.add_column("Picture", bytes) ds.add_column("Parent", int) selectionTable = pylax.Table(form, 12, 88, -344, -170, dynaset=ds, label=pylax.Label(form, 12, 60, 90, 24, "Select")) selectionTable.add_column("Name", 70, "Name") selectionTable.add_column("Description", 100, "Description") selectionTable.showRowIndicator = True imagePicture = pylax.Image(form, -330, 20, 320, 320, dynaset=ds, column="Picture") ds.buttonEdit = pylax.Button(form, -328, -36, 60, 24, "Edit") ds.buttonNew = pylax.Button(form, -264, -36, 60, 24, "New") ds.buttonDelete = pylax.Button(form, -200, -36, 60, 24, "Delete") ds.buttonUndo = pylax.Button(form, -136, -36, 60, 24, "Undo") ds.buttonSave = pylax.Button(form, -72, -36, 60, 24, "Save") r = ds.execute()
def newWindowMenuItem__on_click(): form = pylax.Form(None, dc, dc, 640, 480, "Lybniz") form.set_icon_from_file("Lybniz.ico") # GUI canvas = pylax.Canvas(form, 0, 110, 0, 0) canvas.frame = True entryY1 = pylax.Entry(form, 40, 10, -250, 20, label=pylax.Label(form, 10, 10, 25, 20, "y1 =")) entryY1.label.textColor = (0, 0, 255) entryY1.data = "sin(x)" entryXMin = pylax.Entry(form, -200, 10, 70, 20, label=pylax.Label(form, -240, 10, 35, 20, "X min"), dataType=float) entryXMin.data = -5.0 entryYMin = pylax.Entry(form, -80, 10, 70, 20, label=pylax.Label(form, -120, 10, 35, 20, "Y min"), dataType=float) entryYMin.data = -3.0 entryY2 = pylax.Entry(form, 40, 35, -250, 20, label=pylax.Label(form, 10, 35, 25, 20, "y2 =")) entryY2.label.textColor = (10, 255, 10) entryXMax = pylax.Entry(form, -200, 35, 70, 20, label=pylax.Label(form, -240, 35, 35, 20, "X max"), dataType=float) entryXMax.data = 5.0 entryYMax = pylax.Entry(form, -80, 35, 70, 20, label=pylax.Label(form, -120, 35, 35, 20, "Y max"), dataType=float) entryYMax.data = 3.0 entryY3 = pylax.Entry(form, 40, 60, -250, 20, label=pylax.Label(form, 10, 60, 25, 20, "y3 =")) entryY3.label.textColor = (255, 0, 0) entryXScale = pylax.Entry(form, -200, 60, 70, 20, label=pylax.Label(form, -240, 60, 35, 20, "X scale"), dataType=float) entryXScale.data = 1.0 entryYScale = pylax.Entry(form, -80, 60, 70, 20, label=pylax.Label(form, -120, 60, 35, 20, "Y scale"), dataType=float) entryYScale.data = 1.0 executeButton = pylax.Button(form, -50, 85, 40, 20, "&Plot") executeButton.defaultEnter = True def canvas__on_paint(sender): canvasWidth, canvasHeight = canvas.size xMin = entryXMin.data xMax = entryXMax.data yMin = entryYMin.data yMax = entryYMax.data def canvasX(x): "Calculate position on canvas to point on graph" return int((x - xMin) * canvasWidth / (xMax - xMin)) def canvasY(y): return int((yMax - y) * canvasHeight / (yMax - yMin)) def graphX(x): "Calculate position on graph from point on canvas" return x * (xMax - xMin) / canvasWidth + xMin def GraphY(y): return yMax - (y * (yMax - yMin) / canvasHeight) # draw cross canvas.move_to(canvasX(0), 0) canvas.line_to(canvasX(0), canvasHeight + 1) canvas.move_to(0, canvasY(0)) canvas.line_to(canvasWidth + 1, canvasY(0)) # draw scaling x iv = int(entryXScale.data * canvasWidth / (xMax - xMin)) os = canvasX(0) % iv for i in range(int(canvasWidth / iv + 1)): canvas.move_to(os + i * iv, canvasY(0) - 5) canvas.line_to(os + i * iv, canvasY(0) + 6) # draw scaling y iv = int(entryYScale.data * canvasHeight / (yMax - yMin)) os = canvasY(0) % iv for i in range(int(canvasHeight / iv + 1)): canvas.move_to(canvasX(0) - 5, i * iv + os) canvas.line_to(canvasX(0) + 6, i * iv + os) # plot for e in ((entryY1.data, (0, 0, 250)), (entryY2.data, (0, 250, 0)), (entryY3.data, (250, 0, 0))): canvas.penColor = e[1] penDown = False if e[0] != None: for i in range(canvasWidth): x = graphX(i + 1) try: y = eval(e[0]) yC = canvasY(y) except: yC = -1 if yC < 0 or yC > canvasHeight: penDown = False else: if penDown: canvas.line_to(i, yC) else: canvas.move_to(i, yC) penDown = True def executeButton__on_click(data): canvas.repaint() canvas.on_paint = canvas__on_paint executeButton.on_click = executeButton__on_click
if r > 0: ds.row = 0 ds = pylax.Dynaset("Item", "SELECT itemid, name FROM item WHERE name LIKE %(Name)s ORDER BY name DESC LIMIT 100;"), connection=cnx) ds.autoColumn = ds.add_column("itemid", int, format="{:,}", key=True) ds.add_column("name") form = pylax.Form(None, 20, 10, 680, 480, "Item from PostgreSQL", ds) ds.buttonEdit = pylax.Button(form, -328, -36, 60, 24, "Edit") ds.buttonNew = pylax.Button(form, -264, -36, 60, 24, "New") ds.buttonDelete = pylax.Button(form, -200, -36, 60, 24, "Delete") ds.buttonUndo = pylax.Button(form, -136, -36, 60, 24, "Undo") ds.buttonSave = pylax.Button(form, -72, -36, 60, 24, "Save") entrySearch = pylax.Entry(form, 62, 12, -389, 24, label = pylax.Label(form, 12, 12, 40, 24, "Search")) entrySearch.data = "%" buttonSearch = pylax.Button(form, -379, 12, 24, 24, "⏎") buttonSearch.on_click = buttonSearch__on_click buttonSearch.defaultEnter = True selectionTable = pylax.Table(form, 12, 88, -344, -170, dynaset=ds, label = pylax.Label(form, 12, 60, 90, 24, "Select")) selectionTable.add_column("Name", 70, "Name") selectionTable.add_column("Description", 100, "Description") selectionTable.showRowIndicator = True entryID = pylax.Entry(form, -200, 60, 40, 24, dynaset=ds, column="ItemID", dataType=int, label = pylax.Label(form, -300, 60, 70, 24, "ID")) entryID.editFormat="{:,}" entryID.alignHoriz = pylax.Align.left entryName = pylax.Entry(form, -200, 90, -110, 24, dynaset=ds, column="Name", dataType=str, label = pylax.Label(form, -300, 90, 70, 24, "Name"))
def launch(): global ds, entrySearch ds = pylax.Dynaset( "LE", "SELECT le.LeID, le.Name, le.Description, le.Logo, le.Parent, p.Name AS ParentName FROM LE LEFT JOIN LE AS p ON le.Parent=p.LeID WHERE le.Name LIKE :Name OR le.LeID = :Name ORDER BY le.Name DESC LIMIT 100;" ) ds.autoColumn = ds.add_column("LeID", int, format="{:,}", key=True) ds.add_column("Name") ds.add_column("Description") ds.add_column("Logo", bytes) ds.add_column("Parent", int) ds.add_column("ParentName") ds.before_save = ds__before_save # GUI form = pylax.Form(None, pylax.Widget.defaultCoordinate, 10, 640, 480, "Legal Entity", ds) form.minWidth, form.minHeight = 480, 360 labelFormCaption = pylax.Label(form, 1, 1, 40, 20, dynaset=ds, column="Name", visible=False) labelFormCaption.captionClient = form # passes any assigment to property 'data' on to property 'caption' of the captionClient entrySearch = pylax.Entry(form, 70, 20, 160, 20, label=pylax.Label(form, 20, 20, 40, 20, "Search")) entrySearch.data = "%" #entrySearch.focus_in() #entrySearch.verify= entryS__verify #print(form.focus) ds.buttonSearch = pylax.Button(form, 240, 20, 60, 20, "Sea&rch") ds.buttonSearch.on_click = buttonSearch__on_click ds.buttonSearch.defaultEnter = True selectionTable = pylax.Table(form, 20, 70, -240, -55, dynaset=ds, label=pylax.Label(form, 20, 50, 90, 20, "Select:")) selectionTable.add_column("ID", 60, "LeID") # title, width, dataset selectionTable.add_column("Name", 130, "Name") selectionTable.add_column("Parent", 130, "ParentName", widget=pylax.Entry(None)) #print(selectionTable.columns[2].widget) imagePicture = pylax.ImageView(form, -140, 20, 90, 80, dynaset=ds, column="Logo", dataType=bytes) entryID = pylax.Entry(form, -160, 120, 60, 20, dynaset=ds, column="LeID", dataType=int, label=pylax.Label(form, -230, 120, 60, 20, "ID")) entryID.editFormat = "{:,}" entryID.alignHoriz = pylax.Align.left entryName = pylax.Entry(form, -160, 150, 140, 20, dynaset=ds, column="Name", label=pylax.Label(form, -230, 150, 60, 20, "Name")) entryParent = pylax.Entry(form, -160, 180, 140, 20, dynaset=ds, column="ParentName", label=pylax.Label(form, -230, 180, 60, 20, "Parent")) #entryParent.alignHoriz = pylax.Align.left #entryParentName = pylax.Entry(form, -160, 210, 100, 20, dynaset=ds, column="ParentName") entryParent.verify = entryParent__verify entryParent.on_click_button = entryParent__on_click_button ds.buttonNew = pylax.Button(form, -360, -40, 60, 20, "&New") ds.buttonEdit = pylax.Button(form, -290, -40, 60, 20, "&Edit") ds.buttonUndo = pylax.Button(form, -220, -40, 60, 20, "&Undo") ds.buttonSave = pylax.Button(form, -150, -40, 60, 20, "&Save") ds.buttonDelete = pylax.Button(form, -80, -40, 60, 20, "&Delete") r = ds.execute({"Name": entrySearch.data})
def aboutBoxMenuItem__on_click(): aboutBox = pylax.Window(None, 0, 0, 320, 160, "About") aboutBox.minHeight = 100 label = pylax.Label(aboutBox, 30, 30, -20, -20, "Pylax test form") label.alignHoriz, label.alignVert = pylax.Align.center, pylax.Align.center aboutBox.visible = True
ds.add_column("Picture", bytes) ds.add_column("Price", float) dsDetail = pylax.Dynaset("ItemSold", "SELECT ItemSold.rowid, Item, Customer, Customer.Name AS CustomerName, Quantity FROM ItemSold JOIN Customer ON ItemSold.Customer=Customer.CustomerID WHERE ItemSold.Item=:ItemID LIMIT 100;", parent=ds) dsDetail.autoColumn = dsDetail.add_column("rowid", int, key=True) dsDetail.add_column("Item", int, parent = "ItemID") dsDetail.add_column("Customer", int) dsDetail.add_column("CustomerName", str, key=None) # non database column dsDetail.whoCols = True dsDetailColumnQuantity = dsDetail.add_column("Quantity", int, format="{:,}", defaultFunction = detailColumnQuantity__default) dsDetail.on_changed = dsDetail__on_changed # GUI form = pylax.Form(None, 20, 10, 680, 480, "Item", ds) labelFormCaption = pylax.Label(form, 1, 1, 40, 20, dynaset=ds, column="Name", visible=False) labelFormCaption.captionClient = form # passes any assigment to property 'data' on to property 'caption' of the captionClient ds.buttonEdit = pylax.Button(form, -328, -36, 60, 24, "Edit") ds.buttonNew = pylax.Button(form, -264, -36, 60, 24, "New") ds.buttonDelete = pylax.Button(form, -200, -36, 60, 24, "Delete") ds.buttonUndo = pylax.Button(form, -136, -36, 60, 24, "Undo") ds.buttonSave = pylax.Button(form, -72, -36, 60, 24, "Save") tab = pylax.Tab(form, 2, 2, -2, -55) tabPageMain = pylax.TabPage(tab, 0, 0, 0, 0, "Main") tabPagePicture = pylax.TabPage(tab, 0, 0, 0, 0, "Picture") entrySearch = pylax.Entry(tabPageMain, 62, 12, -389, 24, label = pylax.Label(tabPageMain, 12, 12, 40, 24, "Search")) entrySearch.data = "%" buttonSearch = pylax.Button(tabPageMain, -379, 12, 24, 24, "⏎")
def launch(): global ds, entrySearch, comboBoxSearch ds = pylax.Dynaset( "Person", "SELECT PersonID, FirstName, LastName, Picture FROM Person ORDER BY LastName DESC LIMIT 100;" ) ds.autoColumn = ds.add_column("PersonID", int, format="{:,}", key=True) ds.add_column("LastName", str, False) ds.add_column("FirstName", str, False, default="One") ds.add_column("Picture", bytes) # GUI form = pylax.Form(None, 10, 10, 680, 450, "Person", ds) form.minWidth, form.minHeight = 640, 480 labelFormCaption = pylax.Label(form, 1, 1, 40, 20, dynaset=ds, column="LastName", visible=False) labelFormCaption.captionClient = form # passes any assigment to property 'data' on to property 'caption' of the captionClient comboBoxSearch = pylax.ComboBox(form, 82, 12, 50, 20, label=pylax.Label(form, 12, 12, 70, 20, "Search by")) comboBoxSearch.append("ID") comboBoxSearch.append("Name") comboBoxSearch.data = "Name" entrySearch = pylax.Entry(form, 160, 20, -410, 20) buttonSearch = pylax.Button(form, -400, 20, 20, 20, "⏎") buttonSearch.on_click = buttonSearch__on_click buttonSearch.defaultEnter = True selectionTable = pylax.Table(form, 12, 88, -344, -170, dynaset=ds, label=pylax.Label(form, 12, 60, 90, 24, "Select")) selectionTable.add_column("First Name", 70, "FirstName") selectionTable.add_column("Last Name", 150, "LastName") selectionTable.showRowIndicator = True imagePicture = pylax.Image(form, -260, 10, 150, 150, dynaset=ds, column="Picture") entryID = pylax.Entry(form, -260, 180, 60, 20, dynaset=ds, column="PersonID", dataType=int, label=pylax.Label(form, -340, 180, 70, 20, "ID")) entryID.editFormat = "{:,}" entryID.alignHoriz = pylax.Align.left entryID.readOnly = True entryFirstName = pylax.Entry(form, -260, 210, 60, 20, dynaset=ds, column="FirstName", dataType=str, label=pylax.Label(form, -340, 210, 70, 20, "First Name")) entryLastName = pylax.Entry(form, -260, 240, 60, 20, dynaset=ds, column="LastName", dataType=str, label=pylax.Label(form, -340, 240, 70, 20, "Last Name")) #comboBox = pylax.ComboBox(form, -260, 270, 60, 20, dynaset=ds, column="PersonID", label = pylax.Label(form, -340, 270, 70, 20, "PersonID")) #comboBox.append("Zero", 0) #comboBox.append("One", 1) #comboBox.append("Two", 2) ds.buttonEdit = pylax.Button(form, -328, -36, 60, 24, "Edit") ds.buttonNew = pylax.Button(form, -264, -36, 60, 24, "New") ds.buttonDelete = pylax.Button(form, -200, -36, 60, 24, "Delete") ds.buttonUndo = pylax.Button(form, -136, -36, 60, 24, "Undo") ds.buttonSave = pylax.Button(form, -72, -36, 60, 24, "Save") r = ds.execute()
# Pylax example program, 2017 by Thomas Führinger import pylax form = pylax.Form(None, 20, 10, 680, 480, "Hello World") label = pylax.Label(form, 12, 12, -12, -12, "Welcome to Pylax!") label.alignHoriz, label.alignVert = pylax.Align.center, pylax.Align.center
ds.add_column("Description", str) form = pylax.Form(None, 20, 10, 680, 480, "Item from Hinterland", ds) ds.buttonEdit = pylax.Button(form, -328, -36, 60, 24, "Edit") ds.buttonNew = pylax.Button(form, -264, -36, 60, 24, "New") ds.buttonDelete = pylax.Button(form, -200, -36, 60, 24, "Delete") ds.buttonUndo = pylax.Button(form, -136, -36, 60, 24, "Undo") ds.buttonSave = pylax.Button(form, -72, -36, 60, 24, "Save") entrySearch = pylax.Entry(form, 62, 12, -389, 24, label=pylax.Label(form, 12, 12, 40, 24, "Search")) entrySearch.data = "%" buttonSearch = pylax.Button(form, -379, 12, 24, 24, "⏎") buttonSearch.on_click = buttonSearch__on_click buttonSearch.defaultEnter = True selectionTable = pylax.Table(form, 12, 88, -344, -170, dynaset=ds, label=pylax.Label(form, 12, 60, 90, 24, "Select")) selectionTable.add_column("Name", 70, "Name") selectionTable.add_column("Description", 100, "Description") selectionTable.showRowIndicator = True
def launch(): global ds, entrySearch def nameColumn__default(): pylax.message("Default", "Gratuliere") return "Hallo" ds = pylax.Dynaset( "Person", "SELECT PersonID, FirstName, LastName, Picture FROM Person ORDER BY LastName DESC LIMIT 100;" ) ds.autoColumn = ds.add_column("PersonID", int, format="{:,}", key=True) ds.add_column("FirstName", str, defaultFunction=nameColumn__default) ds.add_column("LastName", str, False, default="Geschafft") ds.add_column("Picture", bytes) # GUI form = pylax.Form(None, pylax.Widget.defaultCoordinate, 10, 680, 450, "Person", ds) form.minWidth, form.minHeight = 640, 480 def entryFirstName__verify(widget, data): pylax.message("Nicht Geklückt! 品", "Gratuliere") return False labelFormCaption = pylax.Label(form, 1, 1, 40, 20, dynaset=ds, column="LastName", visible=False) labelFormCaption.captionClient = form # passes any assigment to property 'data' on to property 'caption' of the captionClient entrySearch = pylax.Entry(form, 70, 20, 160, 20, label=pylax.Label(form, 20, 20, 40, 20, "Search")) ds.buttonSearch = pylax.Button(form, 240, 20, 60, 20, "Search") ds.buttonSearch.on_click = buttonSearch__on_click ds.buttonSearch.defaultEnter = True selectionTable = pylax.Table(form, 20, 70, -240, -55, dynaset=ds, label=pylax.Label(form, 20, 50, 90, 20, "Select:")) selectionTable.add_column("First Name", 70, "FirstName") # title, width, dataset selectionTable.add_column("Last Name", 150, "LastName") # title, width, dataset selectionTable.add_column("ID", 130, "PersonID") # title, width, dataset imagePicture = pylax.ImageView(form, -130, 20, 90, 80, dynaset=ds, column="Picture", dataType=bytes) entryID = pylax.Entry(form, -130, 120, 120, 20, dynaset=ds, column="PersonID", dataType=int, label=pylax.Label(form, -230, 120, 90, 20, "ID")) entryID.editFormat = "{:,}" entryID.alignHoriz = pylax.Align.left entryFirstName = pylax.Entry(form, -130, 150, 120, 20, dynaset=ds, column="FirstName", dataType=str, label=pylax.Label(form, -230, 150, 90, 20, "First Name")) entryFirstName.verify = entryFirstName__verify entryLastName = pylax.Entry(form, -130, 180, 120, 20, dynaset=ds, column="LastName", dataType=str, label=pylax.Label(form, -230, 180, 90, 20, "Last Name")) comboBox = pylax.ComboBox(form, -130, 220, 120, 20, dynaset=ds, column="PersonID", label=pylax.Label(form, -230, 220, 90, 20, "PersonID")) comboBox.append("Zero", 0) comboBox.append("One", 1) comboBox.append("Two", 2) entryLastName.readOnly = True ds.buttonNew = pylax.Button(form, -370, -40, 60, 20, "New") ds.buttonEdit = pylax.Button(form, -300, -40, 60, 20, "Edit") ds.buttonUndo = pylax.Button(form, -230, -40, 60, 20, "Undo") ds.buttonSave = pylax.Button(form, -160, -40, 60, 20, "Save") ds.buttonDelete = pylax.Button(form, -90, -40, 60, 20, "Delete")
dsDetailColumnQuantity = dsDetail.add_column("Quantity", int, format="{:,}") def dsDetail__on_changed(ds, row, column): if column == dsDetailColumnQuantity or column is None: entryTotalQuanity.data = ds.get_column_data_sum("Quantity") dsDetail.on_changed = dsDetail__on_changed form = pylax.Form(None, 20, 10, 680, 480, "Item", ds) labelFormCaption = pylax.Label(form, 1, 1, 40, 20, dynaset=ds, column="Name", visible=False) labelFormCaption.captionClient = form # passes any assigment to property 'data' on to property 'caption' of the captionClient ds.buttonEdit = pylax.Button(form, -360, -40, 60, 20, "Edit") ds.buttonNew = pylax.Button(form, -290, -40, 60, 20, "New") ds.buttonDelete = pylax.Button(form, -220, -40, 60, 20, "Delete") ds.buttonUndo = pylax.Button(form, -150, -40, 60, 20, "Undo") ds.buttonSave = pylax.Button(form, -80, -40, 60, 20, "Save") tab = pylax.Tab(form, 2, 2, -2, -55) tabPageMain = pylax.TabPage(tab, 0, 0, 0, 0, "Main") tabPagePicture = pylax.TabPage(tab, 0, 0, 0, 0, "Picture")
# Pylax example program, 2017 by Thomas Führinger import pylax form = pylax.Form(None, 20, 10, 680, 480, "Hello World") label = pylax.Label(form, 30, 30, -20, -20, "Welcome to Pylax!") label.alignHoriz, label.alignVert = pylax.Align.center, pylax.Align.center