def InitSpecCheck(self):
        """make an interactive grid in which users can edit specimen names
        as well as which sample a specimen belongs to"""

        self.panel = wx.Panel(self, style=wx.SIMPLE_BORDER)
        #import wx.lib.scrolledpanel as libpanel # does not work well
        #self.panel = libpanel.ScrolledPanel(self, style=wx.SIMPLE_BORDER)

        text = """Step 1:
Check that all specimens belong to the correct sample
(if sample name is simply wrong, that will be fixed in step 2)"""
        label = wx.StaticText(self.panel, label=text)
        self.grid_builder = grid_frame2.GridBuilder(self.er_magic_data, 'specimen',
                                                   self.er_magic_data.headers, self.panel,
                                                   'sample')
        self.spec_grid = self.grid_builder.make_grid(incl_pmag=False)
        self.grid = self.spec_grid

        self.spec_grid.InitUI()

        self.grid_builder.add_data_to_grid(self.spec_grid, 'specimen', incl_pmag=False)

        samples = self.er_magic_data.make_name_list(self.er_magic_data.samples)
        self.drop_down_menu = drop_down_menus.Menus("specimen", self, self.spec_grid, samples)


        #### Create Buttons ####
        hbox_one = wx.BoxSizer(wx.HORIZONTAL)
        self.addSampleButton = wx.Button(self.panel, label="Add a new sample")
        self.samples = [name for name in self.er_magic_data.samples]
        self.Bind(wx.EVT_BUTTON, self.on_addSampleButton, self.addSampleButton)
        self.helpButton = wx.Button(self.panel, label="Help")
        self.Bind(wx.EVT_BUTTON, lambda event: self.on_helpButton(event, "ErMagicSpecimenHelp.html"), self.helpButton)
        hbox_one.Add(self.addSampleButton, flag=wx.ALIGN_LEFT|wx.RIGHT, border=10)
        hbox_one.Add(self.helpButton)

        #
        hboxok = wx.BoxSizer(wx.HORIZONTAL)
        self.saveButton = wx.Button(self.panel, id=-1, label='Save')
        self.Bind(wx.EVT_BUTTON, lambda event: self.on_saveButton(event, self.spec_grid), self.saveButton)
        self.cancelButton = wx.Button(self.panel, wx.ID_CANCEL, '&Cancel')
        self.Bind(wx.EVT_BUTTON, self.on_cancelButton, self.cancelButton)
        self.continueButton = wx.Button(self.panel, id=-1, label='Save and continue')
        self.Bind(wx.EVT_BUTTON, lambda event: self.on_continueButton(event, self.spec_grid, next_dia=self.InitSampCheck), self.continueButton)

        hboxok.Add(self.saveButton, flag=wx.ALIGN_LEFT|wx.RIGHT, border=10)
        hboxok.Add(self.cancelButton, flag=wx.ALIGN_LEFT|wx.RIGHT, border=10)
        hboxok.Add(self.continueButton, flag=wx.ALIGN_LEFT)

        #
        hboxgrid = pw.hbox_grid(self.panel, self.onDeleteRow, 'specimen', self.grid)
        self.deleteRowButton = hboxgrid.deleteRowButton

        self.panel.Bind(wx.grid.EVT_GRID_LABEL_LEFT_CLICK, self.onLeftClickLabel, self.grid)

        ### Create Containers ###
        vbox = wx.BoxSizer(wx.VERTICAL)
        vbox.AddSpacer(10)
        vbox.Add(label, flag=wx.ALIGN_CENTER|wx.TOP|wx.BOTTOM, border=10)

        vbox.Add(hbox_one, flag=wx.TOP|wx.LEFT|wx.BOTTOM, border=10)
        vbox.Add(hboxok, flag=wx.BOTTOM|wx.LEFT, border=10)
        vbox.Add(hboxgrid, flag=wx.BOTTOM|wx.LEFT, border=10)
        vbox.Add(self.spec_grid, flag=wx.ALL, border=10)#|wx.EXPAND, border=30)
        vbox.AddSpacer(20)

        self.hbox_all = wx.BoxSizer(wx.HORIZONTAL)
        self.hbox_all.AddSpacer(20)
        self.hbox_all.Add(vbox)
        self.hbox_all.AddSpacer(20)

        self.panel.SetSizer(self.hbox_all)
        #self.panel.SetScrollbars(20, 20, 50, 50)
        self.hbox_all.Fit(self)
        self.Centre()
        self.Show()
        self.Hide()
        self.Show()
def InitSpecCheck ( self ) : self . panel = wx . Panel ( self , style = wx . SIMPLE_BORDER ) text = """Step 1:
Check that all specimens belong to the correct sample
(if sample name is simply wrong, that will be fixed in step 2)""" label = wx . StaticText ( self . panel , label = text ) self . grid_builder = grid_frame2 . GridBuilder ( self . er_magic_data , 'specimen' , self . er_magic_data . headers , self . panel , 'sample' ) self . spec_grid = self . grid_builder . make_grid ( incl_pmag = False ) self . grid = self . spec_grid self . spec_grid . InitUI ( ) self . grid_builder . add_data_to_grid ( self . spec_grid , 'specimen' , incl_pmag = False ) samples = self . er_magic_data . make_name_list ( self . er_magic_data . samples ) self . drop_down_menu = drop_down_menus . Menus ( "specimen" , self , self . spec_grid , samples ) hbox_one = wx . BoxSizer ( wx . HORIZONTAL ) self . addSampleButton = wx . Button ( self . panel , label = "Add a new sample" ) self . samples = [ name for name in self . er_magic_data . samples ] self . Bind ( wx . EVT_BUTTON , self . on_addSampleButton , self . addSampleButton ) self . helpButton = wx . Button ( self . panel , label = "Help" ) self . Bind ( wx . EVT_BUTTON , lambda event : self . on_helpButton ( event , "ErMagicSpecimenHelp.html" ) , self . helpButton ) hbox_one . Add ( self . addSampleButton , flag = wx . ALIGN_LEFT | wx . RIGHT , border = 10 ) hbox_one . Add ( self . helpButton ) hboxok = wx . BoxSizer ( wx . HORIZONTAL ) self . saveButton = wx . Button ( self . panel , id = - 1 , label = 'Save' ) self . Bind ( wx . EVT_BUTTON , lambda event : self . on_saveButton ( event , self . spec_grid ) , self . saveButton ) self . cancelButton = wx . Button ( self . panel , wx . ID_CANCEL , '&Cancel' ) self . Bind ( wx . EVT_BUTTON , self . on_cancelButton , self . cancelButton ) self . continueButton = wx . Button ( self . panel , id = - 1 , label = 'Save and continue' ) self . Bind ( wx . EVT_BUTTON , lambda event : self . on_continueButton ( event , self . spec_grid , next_dia = self . InitSampCheck ) , self . continueButton ) hboxok . Add ( self . saveButton , flag = wx . ALIGN_LEFT | wx . RIGHT , border = 10 ) hboxok . Add ( self . cancelButton , flag = wx . ALIGN_LEFT | wx . RIGHT , border = 10 ) hboxok . Add ( self . continueButton , flag = wx . ALIGN_LEFT ) hboxgrid = pw . hbox_grid ( self . panel , self . onDeleteRow , 'specimen' , self . grid ) self . deleteRowButton = hboxgrid . deleteRowButton self . panel . Bind ( wx . grid . EVT_GRID_LABEL_LEFT_CLICK , self . onLeftClickLabel , self . grid ) vbox = wx . BoxSizer ( wx . VERTICAL ) vbox . AddSpacer ( 10 ) vbox . Add ( label , flag = wx . ALIGN_CENTER | wx . TOP | wx . BOTTOM , border = 10 ) vbox . Add ( hbox_one , flag = wx . TOP | wx . LEFT | wx . BOTTOM , border = 10 ) vbox . Add ( hboxok , flag = wx . BOTTOM | wx . LEFT , border = 10 ) vbox . Add ( hboxgrid , flag = wx . BOTTOM | wx . LEFT , border = 10 ) vbox . Add ( self . spec_grid , flag = wx . ALL , border = 10 ) vbox . AddSpacer ( 20 ) self . hbox_all = wx . BoxSizer ( wx . HORIZONTAL ) self . hbox_all . AddSpacer ( 20 ) self . hbox_all . Add ( vbox ) self . hbox_all . AddSpacer ( 20 ) self . panel . SetSizer ( self . hbox_all ) self . hbox_all . Fit ( self ) self . Centre ( ) self . Show ( ) self . Hide ( ) self . Show ( )
make an interactive grid in which users can edit specimen names
        as well as which sample a specimen belongs to