def initUI(self): self.controller.Disable() self.panel = wx.Panel(self) self.runButton = wx.Button(self.panel, label="Run") self.runLabel = wx.StaticText(self.panel, label="Input:") self.resultLabel = wx.StaticText(self.panel) self.simulationButton = wx.Button(self.panel, label="Step by step simulation") self.input = wx.TextCtrl(self.panel, size=(140, -1)) self.windowSizer = wx.BoxSizer() self.windowSizer.Add(self.panel, 1, wx.ALL | wx.EXPAND) self.sizer = wx.GridBagSizer(5, 5) self.sizer.Add(self.runLabel, (0, 0)) self.sizer.Add(self.input, (0, 1)) self.sizer.Add(self.resultLabel, (1, 0)) self.sizer.Add(self.runButton, (2, 0)) self.sizer.Add(self.simulationButton, (2, 1)) self.border = wx.BoxSizer() self.border.Add(self.sizer, 1, wx.ALL | wx.EXPAND, 5) self.panel.SetSizerAndFit(self.border) self.SetSizerAndFit(self.windowSizer) if not self.graph.HasStartState(): self.runButton.Disable() self.input.Disable() self.simulationButton.Disable() self.resultLabel.SetLabel('No Start State') else: self.runButton.Disable() self.simulationButton.Disable() self.resultLabel.SetLabel('No input')
def InitUI(self): self.controller.DisableWidgets() self.panel = wx.Panel(self) self.defaultColor = self.panel.GetBackgroundColour() self.stepButton = wx.Button(self.panel, label="Step") self.inputTextBoxes = [] self.inputSizer = wx.GridBagSizer() self.btnSizer = wx.GridBagSizer() self.index = 0 self.resultLabel = wx.StaticText(self.panel) self.font = wx.Font(18, wx.DECORATIVE, wx.NORMAL, wx.BOLD) self.windowSizer = wx.BoxSizer() self.windowSizer.Add(self.panel, 1, wx.ALL | wx.EXPAND) self.sizer = wx.GridBagSizer(5, 5) i = 0 for c in self.input: newTextBox = wx.StaticText(self.panel) newTextBox.SetLabel(c) newTextBox.SetFont(self.font) newTextBox.SetForegroundColour('Black') self.inputTextBoxes.append(newTextBox) self.inputSizer.Add(newTextBox, (0, i)) i += 1 self.sizer.Add(self.inputSizer, (0, 0)) self.btnSizer.Add(self.stepButton, (0, 0)) self.sizer.Add(self.resultLabel, (1, 0)) self.sizer.Add(self.btnSizer, (2, 0)) self.border = wx.BoxSizer() self.border.Add(self.sizer, 1, wx.ALL | wx.EXPAND, 5) self.panel.SetSizerAndFit(self.border) self.SetSizerAndFit(self.windowSizer)
def newImageInfoLabel(self): return wx.StaticText(self, -1, "Your texture: ")
def newSuccesorLabel(self, entity_type): return wx.StaticText(self, -1, "Successor " + entity_type + ":", size=(125, -1))
def newPredeccesorLabel(self, entity_type): return wx.StaticText(self, -1, "Predecessor " + entity_type + ":", size=(150, -1))
def newDescriptionFieldLabel(self, entity_type): return wx.StaticText( self, -1, "Description of " + entity_type + "for Tutorial module")
def newLogAreaLabel(self): return wx.StaticText(self, -1, "Below lies logging area, showing error msgs")
def newNameFieldLabel(self, entity_type): return wx.StaticText(self, -1, "Name of this " + entity_type)