class Frames(Sink): def __init__(self): self.frame=Frame(self.baseURL() + "rembrandt/LaMarcheNocturne.html") self.frame.setWidth("100%") self.frame.setHeight("48em") self.initWidget(self.frame)
class Frames(Sink): def __init__(self): self.frame = Frame(self.baseURL() + "rembrandt/LaMarcheNocturne.html") self.frame.setWidth("100%") self.frame.setHeight("48em") self.setWidget(self.frame)
class App(wx.App): def OnInit(self): self.frame = Frame(None, Level1()) self.frame.Show(True) self.SetTopWindow(self.frame) return True
class App(wx.App): def OnInit(self): self.frame = Frame(parent = None) self.frame.Show(True) self.SetTopWindow(self.frame) return True
def __init__(self): DialogBox.__init__(self) self.setText("Sample DialogBox with embedded Frame") iframe = Frame(Popups.baseURL() + "rembrandt/LaMarcheNocturne.html") closeButton = Button("Close", self) msg = HTML("<center>This is an example of a standard dialog box component.<br> You can put pretty much anything you like into it,<br>such as the following IFRAME:</center>", True) dock = DockPanel() dock.setSpacing(4) dock.add(closeButton, DockPanel.SOUTH) dock.add(msg, DockPanel.NORTH) dock.add(iframe, DockPanel.CENTER) dock.setCellHorizontalAlignment(closeButton, HasAlignment.ALIGN_RIGHT) dock.setCellWidth(iframe, "100%") dock.setWidth("100%") iframe.setWidth("36em") iframe.setHeight("20em") self.setWidget(dock)
def main(): """! @brief Main of the software""" ## Qt Application app = QtGui.QApplication(sys.argv) app.setOrganizationName('Digiclever') app.setApplicationName('NFC Golf Ball Dispenser') ## Frame instance frame = Frame() frame.show() ## PiFaceControl instance piface = PiFaceControl() ## Action instance action = Action(piface) ## CardReader instance cardReader = CardReader(action) # connect signals to slots frame.b1.clicked.connect(cardReader.someBalls) frame.b2.clicked.connect(cardReader.manyBalls) frame.transaction.clicked.connect(lambda: action.getLastTransactions(cardReader.cardUid)) frame.admin.clicked.connect(frame.toggleAdminView) frame.log.clicked.connect(lambda: frame.displayAdmin(frame.adminUsername.text(), frame.adminPassword.text())) frame.bRecharge.clicked.connect(lambda: cardReader.recharge(frame.moneyBox.value())) frame.bCreateAccount.clicked.connect(lambda: action.addUser(frame.username.text(), frame.name.text(), frame.surname.text())) frame.bAddDevice.clicked.connect(lambda: action.addDevice(frame.username2.text(), cardReader.cardUid, cardReader.ATR)) action.status.connect(frame.displayStatus) action.transactionsLoaded.connect(frame.displayTransactions) frame.connect(frame.warningTimer, SIGNAL("timeout()"), cardReader.start) frame.connect(frame.releaseCardTimer, SIGNAL("timeout()"), cardReader.start) cardReader.connect(cardReader.timer, SIGNAL("timeout()"), cardReader.waitForCard) cardReader.updateWaiting.connect(frame.update) cardReader.cardDetected.connect(frame.displayCard) cardReader.warning.connect(frame.displayWarning) frame.activateButton.connect(piface.activateButtonListener) frame.deactivateButton.connect(piface.deactivateButtonListener) piface.b1.connect(cardReader.someBalls) piface.b2.connect(cardReader.manyBalls) piface.b3.connect(lambda: action.getLastTransactions(cardReader.cardUid)) piface.b4.connect(frame.toggleAdminView) cardReader.start() sys.exit(app.exec_())
def __init__(self): DialogBox.__init__(self) self.setText("Sample DialogBox with embedded Frame") iframe = Frame(Popups.baseURL() + "rembrandt/LaMarcheNocturne.html") closeButton = Button("Close", self) msg = HTML("<center>This is an example of a standard dialog box component.<br> You can put pretty much anything you like into it,<br>such as the following IFRAME:</center>", True) dock = DockPanel() dock.setSpacing(4) dock.add(closeButton, DockPanel.SOUTH) dock.add(msg, DockPanel.NORTH) dock.add(iframe, DockPanel.CENTER) dock.setCellHorizontalAlignment(closeButton, HasAlignment.ALIGN_RIGHT) dock.setCellWidth(iframe, "100%") dock.setWidth("100%") iframe.setWidth("36em") iframe.setHeight("20em") self.add(dock)