Пример #1
0
    def __init__(self, parent, fileName, text):
        wx.Dialog.__init__(self, parent, size=(425,350),
                           title="Edit Startup Script",
                           style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER)
        
        pst = wx.StaticText(self, -1, "Path:")
        ptx = wx.TextCtrl(self, -1, fileName, style=wx.TE_READONLY)
        self.editor = editwindow.EditWindow(self)
        self.editor.SetText(text)
        wx.CallAfter(self.editor.SetFocus)
        
        ok = wx.Button(self, wx.ID_OK)
        cancel = wx.Button(self, wx.ID_CANCEL)

        mainSizer = wx.BoxSizer(wx.VERTICAL)

        pthSizer = wx.BoxSizer(wx.HORIZONTAL)
        pthSizer.Add(pst, flag=wx.ALIGN_CENTER_VERTICAL)
        pthSizer.Add((5,5))
        pthSizer.Add(ptx, 1)
        mainSizer.Add(pthSizer, 0, wx.EXPAND|wx.ALL, 10)

        mainSizer.Add(self.editor, 1, wx.EXPAND|wx.LEFT|wx.RIGHT, 10)
        
        btnSizer = wx.BoxSizer(wx.HORIZONTAL)
        btnSizer.Add((5,5), 1)
        btnSizer.Add(ok)
        btnSizer.Add((5,5), 1)
        btnSizer.Add(cancel)
        btnSizer.Add((5,5), 1)
        mainSizer.Add(btnSizer, 0, wx.EXPAND|wx.ALL, 10)
        
        self.SetSizer(mainSizer)
        self.Layout()
Пример #2
0
        self.totalWeight.setObjectName('totalWeight')
        font.setPointSize(13)
        self.totalWeight.setFont(font)
        self.totalWeight.setAlignment(Qt.AlignCenter)
        self.totalWeight.setText('')
        self.totalWeight.setStyleSheet('background-color: {0}; border: 1px solid black;'.format(color0))

        # total cost of all products
        self.totalCost.setFixedSize(210, 40)
        font.setBold(False)
        self.totalCost.setObjectName('totalCost')
        font.setPointSize(13)
        self.totalCost.setFont(font)
        self.totalCost.setAlignment(Qt.AlignCenter)
        self.totalCost.setText('')
        self.totalCost.setStyleSheet('background-color: {0}; border: 1px solid black;'.format(color0))


if __name__ == '__main__':
    import sys
    from PyQt5.QtWidgets import QApplication
    app = QApplication(sys.argv)
    controller.load()
    config.mainFont = 'Century Gothic'
    editWindow = editwindow.EditWindow()
    window = MainWindow()
    print(type(windowObject))
    print(type(editWindow))
    window.show()
    sys.exit(app.exec_())