def __init__(self, parent): wx.Frame.__init__(self, parent, id=wx.ID_ANY, title=wx.EmptyString, pos=wx.DefaultPosition, size=wx.Size(1000, 700), style=wx.DEFAULT_FRAME_STYLE | wx.TAB_TRAVERSAL) self.display = display_panel(self) self.display.Layout()
def __init__(self, parent): MainFrame.__init__(self, parent) # Add menu bar menubar = wx.MenuBar() file = wx.Menu() file.Append(22, '&Quit', 'Exit Panel Control') menubar.Append(file, '&File') self.SetMenuBar(menubar) wx.EVT_MENU(self, 22, self.on_close) # Here we create a panel and a notebook on the panel self.nb = fnb.FlatNotebook(self) # create the page windows as children of the notebook self.page1 = control_panel(self.nb) self.page2 = display_panel(self.nb) self.page3 = eeprom_panel(self.nb) self.page4 = logger_panel(self) self.page5 = sql_panel(self) # add the pages to the notebook with the label to show on the tab self.nb.AddPage(self.page1, 'Control') self.nb.AddPage(self.page2, 'Display') self.nb.AddPage(self.page3, 'EEPROM') self.nb.AddPage(self.page5, 'Database') # finally, put the notebook in a sizer for the panel to manage the # layout grid = wx.GridBagSizer(hgap=5, vgap=5) # start of grid grid.Add(self.nb, pos=(0, 0), span=( 1, 2), flag=wx.TE_RIGHT | wx.ALIGN_CENTER) grid.Add(self.page4, pos=(0, 2), flag=wx.TE_RIGHT) self.SetSizerAndFit(grid) # initialize all the environment and do the layout self.init_zmq() self.init_variable() self.retrieve_runlog() self.bind_bk() self.read_curr() self.bind_led() self.bind_pga() self.bind_eeprom() self.bind_drs4() self.do_logger_binding() self.init_thread()