def makeCompoundsList(self): """Make compounds list.""" # init list self.compoundsList = mwx.sortListCtrl(self, -1, size=(721, 300), style=mwx.LISTCTRL_STYLE_SINGLE) self.compoundsList.SetFont(wx.SMALL_FONT) self.compoundsList.setSecondarySortColumn(1) self.compoundsList.setAltColour(mwx.LISTCTRL_ALTCOLOUR) # set events self.compoundsList.Bind(wx.EVT_LIST_ITEM_SELECTED, self.onItemSelected) self.compoundsList.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.onItemActivated) self.compoundsList.Bind(wx.EVT_KEY_DOWN, self.onListKey) if wx.Platform == '__WXMAC__': self.compoundsList.Bind(wx.EVT_RIGHT_UP, self.onListRMU) else: self.compoundsList.Bind(wx.EVT_LIST_ITEM_RIGHT_CLICK, self.onListRMU) # make columns self.compoundsList.InsertColumn(0, "compound", wx.LIST_FORMAT_LEFT) self.compoundsList.InsertColumn(1, "m/z", wx.LIST_FORMAT_RIGHT) self.compoundsList.InsertColumn(2, "z", wx.LIST_FORMAT_CENTER) self.compoundsList.InsertColumn(3, "adduct", wx.LIST_FORMAT_CENTER) self.compoundsList.InsertColumn(4, "formula", wx.LIST_FORMAT_LEFT) self.compoundsList.InsertColumn(5, "error", wx.LIST_FORMAT_RIGHT) # set column widths for col, width in enumerate((230,90,40,90,180,70)): self.compoundsList.SetColumnWidth(col, width)
def makeScanList(self): """Make list for scans.""" # init list self.scanList = mwx.sortListCtrl(self, -1, size=(656, 200), style=mwx.LISTCTRL_STYLE_MULTI) self.scanList.SetFont(wx.SMALL_FONT) self.scanList.setAltColour(mwx.LISTCTRL_ALTCOLOUR) # set events self.scanList.Bind(wx.EVT_LIST_ITEM_SELECTED, self.onItemSelected) self.scanList.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.onItemActivated) # make columns self.scanList.InsertColumn(0, "id", wx.LIST_FORMAT_RIGHT) self.scanList.InsertColumn(1, "retention", wx.LIST_FORMAT_RIGHT) self.scanList.InsertColumn(2, "ms", wx.LIST_FORMAT_CENTER) self.scanList.InsertColumn(3, "precursor", wx.LIST_FORMAT_RIGHT) self.scanList.InsertColumn(4, "z", wx.LIST_FORMAT_CENTER) self.scanList.InsertColumn(5, "mz range", wx.LIST_FORMAT_RIGHT) self.scanList.InsertColumn(6, "ion current", wx.LIST_FORMAT_RIGHT) self.scanList.InsertColumn(7, "points", wx.LIST_FORMAT_RIGHT) self.scanList.InsertColumn(8, "data type", wx.LIST_FORMAT_CENTER) # set column widths for col, width in enumerate((45, 110, 40, 85, 40, 85, 90, 60, 80)): self.scanList.SetColumnWidth(col, width)
def makePeakList(self): """Make peaklist list.""" # init peaklist self.peakList = mwx.sortListCtrl(self, -1, size=(201, -1), style=mwx.LISTCTRL_STYLE_MULTI) self.peakList.SetFont(wx.SMALL_FONT) self.peakList.setSecondarySortColumn(0) self.peakList.setAltColour(mwx.LISTCTRL_ALTCOLOUR) # set events self.peakList.Bind(wx.EVT_LIST_COL_RIGHT_CLICK, self.onColumnRMU) self.peakList.Bind(wx.EVT_LIST_ITEM_SELECTED, self.onItemSelected) self.peakList.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.onItemActivated) self.peakList.Bind(wx.EVT_KEY_DOWN, self.onListKey) if wx.Platform == '__WXMAC__': self.peakList.Bind(wx.EVT_RIGHT_UP, self.onItemRMU) else: self.peakList.Bind(wx.EVT_LIST_ITEM_RIGHT_CLICK, self.onItemRMU) # make columns self.makePeakListColumns() # set DnD dropTarget = fileDropTarget(self.parent.onDocumentDropped) self.peakList.SetDropTarget(dropTarget)
def makeReferencesList(self): """Make references list.""" # init list self.referencesList = mwx.sortListCtrl(self, -1, size=(581, 250), style=mwx.LISTCTRL_STYLE_SINGLE) self.referencesList.SetFont(wx.SMALL_FONT) self.referencesList.setSecondarySortColumn(2) self.referencesList.setAltColour(mwx.LISTCTRL_ALTCOLOUR) # set events self.referencesList.Bind(wx.EVT_LIST_ITEM_SELECTED, self.onItemSelected) self.referencesList.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.onItemActivated) if wx.Platform == '__WXMAC__': self.referencesList.Bind(wx.EVT_RIGHT_UP, self.onListRMU) else: self.referencesList.Bind(wx.EVT_LIST_ITEM_RIGHT_CLICK, self.onListRMU) # make columns self.referencesList.InsertColumn(0, "reference", wx.LIST_FORMAT_LEFT) self.referencesList.InsertColumn(1, "m/z", wx.LIST_FORMAT_RIGHT) self.referencesList.InsertColumn(2, "error", wx.LIST_FORMAT_RIGHT) # set column widths for col, width in enumerate((380, 90, 90)): self.referencesList.SetColumnWidth(col, width)
def makeItemsList(self): """Make list for items.""" # init list self.itemsList = mwx.sortListCtrl(self, -1, size=(841, 250), style=mwx.LISTCTRL_STYLE_MULTI) self.itemsList.SetFont(wx.SMALL_FONT) self.itemsList.setAltColour(mwx.LISTCTRL_ALTCOLOUR) # set events self.itemsList.Bind(wx.EVT_LIST_ITEM_SELECTED, self.onItemSelected) # make columns self.itemsList.InsertColumn(0, "name", wx.LIST_FORMAT_LEFT) self.itemsList.InsertColumn(1, "gain", wx.LIST_FORMAT_LEFT) self.itemsList.InsertColumn(2, "loss", wx.LIST_FORMAT_LEFT) self.itemsList.InsertColumn(3, "mo. mass", wx.LIST_FORMAT_RIGHT) self.itemsList.InsertColumn(4, "av. mass", wx.LIST_FORMAT_RIGHT) self.itemsList.InsertColumn(5, "amino", wx.LIST_FORMAT_LEFT) self.itemsList.InsertColumn(6, "term", wx.LIST_FORMAT_CENTER) self.itemsList.InsertColumn(7, "description", wx.LIST_FORMAT_LEFT) # set column widths for col, width in enumerate((110, 100, 60, 90, 90, 100, 50, 220)): self.itemsList.SetColumnWidth(col, width)
def makeFormulaeList(self): """Make compounds list.""" # init list self.formulaeList = mwx.sortListCtrl(self, -1, size=(751, 250), style=mwx.LISTCTRL_STYLE_SINGLE) self.formulaeList.SetFont(wx.SMALL_FONT) self.formulaeList.setAltColour(mwx.LISTCTRL_ALTCOLOUR) # set events self.formulaeList.Bind(wx.EVT_LIST_ITEM_SELECTED, self.onItemSelected) self.formulaeList.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.onItemActivated) self.formulaeList.Bind(wx.EVT_KEY_DOWN, self.onListKey) if wx.Platform == '__WXMAC__': self.formulaeList.Bind(wx.EVT_RIGHT_UP, self.onListRMU) else: self.formulaeList.Bind(wx.EVT_LIST_ITEM_RIGHT_CLICK, self.onListRMU) # make columns self.formulaeList.InsertColumn(0, "neutral formula", wx.LIST_FORMAT_LEFT) self.formulaeList.InsertColumn(1, "mass", wx.LIST_FORMAT_RIGHT) self.formulaeList.InsertColumn(2, "m/z", wx.LIST_FORMAT_RIGHT) self.formulaeList.InsertColumn(3, "error", wx.LIST_FORMAT_RIGHT) self.formulaeList.InsertColumn(4, "H/C", wx.LIST_FORMAT_RIGHT) self.formulaeList.InsertColumn(5, "rdbe", wx.LIST_FORMAT_RIGHT) self.formulaeList.InsertColumn(6, "pattern", wx.LIST_FORMAT_RIGHT) # set column widths for col, width in enumerate((200,110,100,80,80,80,80)): self.formulaeList.SetColumnWidth(col, width)
def makeReferencesList(self): """Make references list.""" # init list self.referencesList = mwx.sortListCtrl(self, -1, size=(581, 250), style=mwx.LISTCTRL_STYLE_SINGLE) self.referencesList.SetFont(wx.SMALL_FONT) self.referencesList.setSecondarySortColumn(2) self.referencesList.setAltColour(mwx.LISTCTRL_ALTCOLOUR) # set events self.referencesList.Bind(wx.EVT_LIST_ITEM_SELECTED, self.onItemSelected) self.referencesList.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.onItemActivated) if wx.Platform == '__WXMAC__': self.referencesList.Bind(wx.EVT_RIGHT_UP, self.onListRMU) else: self.referencesList.Bind(wx.EVT_LIST_ITEM_RIGHT_CLICK, self.onListRMU) # make columns self.referencesList.InsertColumn(0, "reference", wx.LIST_FORMAT_LEFT) self.referencesList.InsertColumn(1, "m/z", wx.LIST_FORMAT_RIGHT) self.referencesList.InsertColumn(2, "error", wx.LIST_FORMAT_RIGHT) # set column widths for col, width in enumerate((380,90,90)): self.referencesList.SetColumnWidth(col, width)
def makeItemsList(self): """Make list for items.""" # init list self.itemsList = mwx.sortListCtrl(self, -1, size=(741, 200), style=mwx.LISTCTRL_STYLE_MULTI) self.itemsList.SetFont(wx.SMALL_FONT) self.itemsList.setAltColour(mwx.LISTCTRL_ALTCOLOUR) # set events self.itemsList.Bind(wx.EVT_LIST_ITEM_SELECTED, self.onItemSelected) # make columns self.itemsList.InsertColumn(0, "name", wx.LIST_FORMAT_LEFT) self.itemsList.InsertColumn(1, "expression", wx.LIST_FORMAT_LEFT) self.itemsList.InsertColumn(2, "c-term", wx.LIST_FORMAT_LEFT) self.itemsList.InsertColumn(3, "n-term", wx.LIST_FORMAT_LEFT) self.itemsList.InsertColumn(4, "mods before", wx.LIST_FORMAT_CENTER) self.itemsList.InsertColumn(5, "mods after", wx.LIST_FORMAT_CENTER) # set column widths for col, width in enumerate((130, 130, 130, 130, 100, 100)): self.itemsList.SetColumnWidth(col, width)
def makeReferencesList(self): """Make references list.""" # init list self.referencesList = mwx.sortListCtrl(self, -1, size=(651, 250), style=mwx.LISTCTRL_STYLE_SINGLE) self.referencesList.SetFont(wx.SMALL_FONT) self.referencesList.setSecondarySortColumn(2) self.referencesList.setAltColour(mwx.LISTCTRL_ALTCOLOUR) # set events self.referencesList.Bind(wx.EVT_LIST_ITEM_SELECTED, self.onItemSelected) self.referencesList.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.onItemActivated) # make columns self.referencesList.InsertColumn(0, "reference", wx.LIST_FORMAT_LEFT) self.referencesList.InsertColumn(1, "theoretical", wx.LIST_FORMAT_RIGHT) self.referencesList.InsertColumn(2, "measured", wx.LIST_FORMAT_RIGHT) self.referencesList.InsertColumn(3, "calibrated", wx.LIST_FORMAT_RIGHT) self.referencesList.InsertColumn(4, "error before", wx.LIST_FORMAT_RIGHT) self.referencesList.InsertColumn(5, "error after", wx.LIST_FORMAT_RIGHT) # set column widths for col, width in enumerate((180, 90, 90, 90, 90, 90)): self.referencesList.SetColumnWidth(col, width)
def makeCompoundsList(self): """Make compounds list.""" # init list self.compoundsList = mwx.sortListCtrl(self, -1, size=(721, 300), style=mwx.LISTCTRL_STYLE_SINGLE) self.compoundsList.SetFont(wx.SMALL_FONT) self.compoundsList.setSecondarySortColumn(1) self.compoundsList.setAltColour(mwx.LISTCTRL_ALTCOLOUR) # set events self.compoundsList.Bind(wx.EVT_LIST_ITEM_SELECTED, self.onItemSelected) self.compoundsList.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.onItemActivated) self.compoundsList.Bind(wx.EVT_KEY_DOWN, self.onListKey) if wx.Platform == '__WXMAC__': self.compoundsList.Bind(wx.EVT_RIGHT_UP, self.onListRMU) else: self.compoundsList.Bind(wx.EVT_LIST_ITEM_RIGHT_CLICK, self.onListRMU) # make columns self.compoundsList.InsertColumn(0, "compound", wx.LIST_FORMAT_LEFT) self.compoundsList.InsertColumn(1, "m/z", wx.LIST_FORMAT_RIGHT) self.compoundsList.InsertColumn(2, "z", wx.LIST_FORMAT_CENTER) self.compoundsList.InsertColumn(3, "adduct", wx.LIST_FORMAT_CENTER) self.compoundsList.InsertColumn(4, "formula", wx.LIST_FORMAT_LEFT) self.compoundsList.InsertColumn(5, "error", wx.LIST_FORMAT_RIGHT) # set column widths for col, width in enumerate((230, 90, 40, 90, 180, 70)): self.compoundsList.SetColumnWidth(col, width)
def makeItemsList(self): """Make list for items.""" # init list self.itemsList = mwx.sortListCtrl(self, -1, size=(871, 250), style=mwx.LISTCTRL_STYLE_MULTI) self.itemsList.SetFont(wx.SMALL_FONT) self.itemsList.setAltColour(mwx.LISTCTRL_ALTCOLOUR) # set events self.itemsList.Bind(wx.EVT_LIST_ITEM_SELECTED, self.onItemSelected) # make columns self.itemsList.InsertColumn(0, "abbr.", wx.LIST_FORMAT_LEFT) self.itemsList.InsertColumn(1, "name", wx.LIST_FORMAT_LEFT) self.itemsList.InsertColumn(2, "category", wx.LIST_FORMAT_LEFT) self.itemsList.InsertColumn(3, "formula", wx.LIST_FORMAT_LEFT) self.itemsList.InsertColumn(4, "mo. mass", wx.LIST_FORMAT_RIGHT) self.itemsList.InsertColumn(5, "av. mass", wx.LIST_FORMAT_RIGHT) self.itemsList.InsertColumn(6, "losses", wx.LIST_FORMAT_LEFT) # set column widths for col, width in enumerate((110, 180, 90, 110, 90, 90, 180)): self.itemsList.SetColumnWidth(col, width)
def makeSummaryList(self): """Make match summary list.""" # init list self.summaryList = mwx.sortListCtrl(self, -1, size=(631, 200), style=mwx.LISTCTRL_STYLE_SINGLE) self.summaryList.SetFont(wx.SMALL_FONT) self.summaryList.setAltColour(mwx.LISTCTRL_ALTCOLOUR) # make columns self.summaryList.InsertColumn(0, "parameter", wx.LIST_FORMAT_LEFT) self.summaryList.InsertColumn(1, "value", wx.LIST_FORMAT_LEFT) # set column widths for col, width in enumerate((250,360)): self.summaryList.SetColumnWidth(col, width)
def makeResultsList(self, panel): """Make results list.""" # init results list self.resultsList = mwx.sortListCtrl(panel, -1, size=(171, 350), style=mwx.LISTCTRL_STYLE_MULTI) self.resultsList.SetFont(wx.SMALL_FONT) self.resultsList.setAltColour(mwx.LISTCTRL_ALTCOLOUR) self.resultsList.Bind(wx.EVT_KEY_DOWN, self.onListKey) # make columns self.resultsList.InsertColumn(0, "# of X", wx.LIST_FORMAT_LEFT) self.resultsList.InsertColumn(1, "%", wx.LIST_FORMAT_RIGHT) # set column widths for col, width in enumerate((75,75)): self.resultsList.SetColumnWidth(col, width)
def makeResultsList(self, panel): """Make results list.""" # init results list self.resultsList = mwx.sortListCtrl(panel, -1, size=(171, 350), style=mwx.LISTCTRL_STYLE_MULTI) self.resultsList.SetFont(wx.SMALL_FONT) self.resultsList.setAltColour(mwx.LISTCTRL_ALTCOLOUR) self.resultsList.Bind(wx.EVT_KEY_DOWN, self.onListKey) # make columns self.resultsList.InsertColumn(0, "# of X", wx.LIST_FORMAT_LEFT) self.resultsList.InsertColumn(1, "%", wx.LIST_FORMAT_RIGHT) # set column widths for col, width in enumerate((75, 75)): self.resultsList.SetColumnWidth(col, width)
def makeItemsList(self): """Make list for items.""" # init list self.itemsList = mwx.sortListCtrl(self, -1, size=(501, 200), style=mwx.LISTCTRL_STYLE_MULTI) self.itemsList.SetFont(wx.SMALL_FONT) self.itemsList.setAltColour(mwx.LISTCTRL_ALTCOLOUR) # set events self.itemsList.Bind(wx.EVT_LIST_ITEM_SELECTED, self.onItemSelected) # make columns self.itemsList.InsertColumn(0, "name", wx.LIST_FORMAT_LEFT) self.itemsList.InsertColumn(1, "category", wx.LIST_FORMAT_LEFT) # set column widths for col, width in enumerate((330,150)): self.itemsList.SetColumnWidth(col, width)
def makeMonomerList(self): """Make references list.""" # init list self.monomerList = mwx.sortListCtrl(self, -1, size=(231, 300), style=mwx.LISTCTRL_STYLE_SINGLE) self.monomerList.SetFont(wx.SMALL_FONT) self.monomerList.setAltColour(mwx.LISTCTRL_ALTCOLOUR) # set events self.monomerList.Bind(wx.EVT_LIST_BEGIN_DRAG, self.onBeginDrag) # make columns self.monomerList.InsertColumn(0, "abbr", wx.LIST_FORMAT_LEFT) self.monomerList.InsertColumn(1, "name", wx.LIST_FORMAT_LEFT) # set column widths for col, width in enumerate((100,110)): self.monomerList.SetColumnWidth(col, width)
def makeItemsList(self): """Make list for items.""" # init list self.itemsList = mwx.sortListCtrl(self, -1, size=(461, 200), style=mwx.LISTCTRL_STYLE_MULTI) self.itemsList.SetFont(wx.SMALL_FONT) self.itemsList.setAltColour(mwx.LISTCTRL_ALTCOLOUR) # set events self.itemsList.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.onItemActivated) # make columns self.itemsList.InsertColumn(0, "group title", wx.LIST_FORMAT_LEFT) self.itemsList.InsertColumn(1, "references", wx.LIST_FORMAT_RIGHT) # set column widths for col, width in enumerate((350,90)): self.itemsList.SetColumnWidth(col, width)
def makeSummaryList(self): """Make match summary list.""" # init list self.summaryList = mwx.sortListCtrl(self, -1, size=(631, 200), style=mwx.LISTCTRL_STYLE_SINGLE) self.summaryList.SetFont(wx.SMALL_FONT) self.summaryList.setAltColour(mwx.LISTCTRL_ALTCOLOUR) # make columns self.summaryList.InsertColumn(0, "parameter", wx.LIST_FORMAT_LEFT) self.summaryList.InsertColumn(1, "value", wx.LIST_FORMAT_LEFT) # set column widths for col, width in enumerate((250, 360)): self.summaryList.SetColumnWidth(col, width)
def makeIonsList(self): """Make ions list.""" # init list self.ionsList = mwx.sortListCtrl(self, -1, size=(531, 200), style=mwx.LISTCTRL_STYLE_SINGLE) self.ionsList.SetFont(wx.SMALL_FONT) self.ionsList.setAltColour(mwx.LISTCTRL_ALTCOLOUR) # set events self.ionsList.Bind(wx.EVT_LIST_ITEM_SELECTED, self.onIonSelected) self.ionsList.Bind(wx.EVT_KEY_DOWN, self.onListKey) # make columns self.ionsList.InsertColumn(0, "ion", wx.LIST_FORMAT_LEFT) self.ionsList.InsertColumn(1, "monoisotopic mass", wx.LIST_FORMAT_RIGHT) self.ionsList.InsertColumn(2, "average mass", wx.LIST_FORMAT_RIGHT) # set column widths for col, width in enumerate((190,160,160)): self.ionsList.SetColumnWidth(col, width)
def makeSequenceList(self): """Make list for sequences.""" # init list self.sequenceList = mwx.sortListCtrl(self, -1, size=(626, 250), style=mwx.LISTCTRL_STYLE_MULTI) self.sequenceList.SetFont(wx.SMALL_FONT) self.sequenceList.setAltColour(mwx.LISTCTRL_ALTCOLOUR) # set events self.sequenceList.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.onItemActivated) # make columns self.sequenceList.InsertColumn(0, "#", wx.LIST_FORMAT_RIGHT) self.sequenceList.InsertColumn(1, "accession", wx.LIST_FORMAT_LEFT) self.sequenceList.InsertColumn(2, "title", wx.LIST_FORMAT_LEFT) self.sequenceList.InsertColumn(3, "length", wx.LIST_FORMAT_RIGHT) # set column widths for col, width in enumerate((30,120,385,70)): self.sequenceList.SetColumnWidth(col, width)
def makeItemsList(self): """Make list for items.""" # init list self.itemsList = mwx.sortListCtrl(self, -1, size=(771, 250), style=mwx.LISTCTRL_STYLE_MULTI) self.itemsList.SetFont(wx.SMALL_FONT) self.itemsList.setAltColour(mwx.LISTCTRL_ALTCOLOUR) # set events self.itemsList.Bind(wx.EVT_LIST_ITEM_SELECTED, self.onItemSelected) # make columns self.itemsList.InsertColumn(0, "name", wx.LIST_FORMAT_LEFT) self.itemsList.InsertColumn(1, "formula", wx.LIST_FORMAT_LEFT) self.itemsList.InsertColumn(2, "mo. mass", wx.LIST_FORMAT_RIGHT) self.itemsList.InsertColumn(3, "av. mass", wx.LIST_FORMAT_RIGHT) self.itemsList.InsertColumn(4, "description", wx.LIST_FORMAT_LEFT) # set column widths for col, width in enumerate((200, 120, 90, 90, 250)): self.itemsList.SetColumnWidth(col, width)
def makeItemsList(self): """Make list for items.""" # init list self.itemsList = mwx.sortListCtrl(self, -1, size=(501, 200), style=mwx.LISTCTRL_STYLE_MULTI) self.itemsList.SetFont(wx.SMALL_FONT) self.itemsList.setAltColour(mwx.LISTCTRL_ALTCOLOUR) # set events self.itemsList.Bind(wx.EVT_LIST_ITEM_SELECTED, self.onItemSelected) # make columns self.itemsList.InsertColumn(0, "name", wx.LIST_FORMAT_LEFT) self.itemsList.InsertColumn(1, "category", wx.LIST_FORMAT_LEFT) # set column widths for col, width in enumerate((330, 150)): self.itemsList.SetColumnWidth(col, width)
def makeMonomerList(self): """Make references list.""" # init list self.monomerList = mwx.sortListCtrl(self, -1, size=(231, 300), style=mwx.LISTCTRL_STYLE_SINGLE) self.monomerList.SetFont(wx.SMALL_FONT) self.monomerList.setAltColour(mwx.LISTCTRL_ALTCOLOUR) # set events self.monomerList.Bind(wx.EVT_LIST_BEGIN_DRAG, self.onBeginDrag) # make columns self.monomerList.InsertColumn(0, "abbr", wx.LIST_FORMAT_LEFT) self.monomerList.InsertColumn(1, "name", wx.LIST_FORMAT_LEFT) # set column widths for col, width in enumerate((100, 110)): self.monomerList.SetColumnWidth(col, width)
def makeItemsList(self): """Make list for items.""" # init list self.itemsList = mwx.sortListCtrl(self, -1, size=(461, 200), style=mwx.LISTCTRL_STYLE_MULTI) self.itemsList.SetFont(wx.SMALL_FONT) self.itemsList.setAltColour(mwx.LISTCTRL_ALTCOLOUR) # set events self.itemsList.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.onItemActivated) # make columns self.itemsList.InsertColumn(0, "group title", wx.LIST_FORMAT_LEFT) self.itemsList.InsertColumn(1, "compounds", wx.LIST_FORMAT_RIGHT) # set column widths for col, width in enumerate((350, 90)): self.itemsList.SetColumnWidth(col, width)
def makeItemsList(self): """Make list for items.""" # init list self.itemsList = mwx.sortListCtrl(self, -1, size=(741, 200), style=mwx.LISTCTRL_STYLE_MULTI) self.itemsList.SetFont(wx.SMALL_FONT) self.itemsList.setAltColour(mwx.LISTCTRL_ALTCOLOUR) # set events self.itemsList.Bind(wx.EVT_LIST_ITEM_SELECTED, self.onItemSelected) # make columns self.itemsList.InsertColumn(0, "name", wx.LIST_FORMAT_LEFT) self.itemsList.InsertColumn(1, "expression", wx.LIST_FORMAT_LEFT) self.itemsList.InsertColumn(2, "c-term", wx.LIST_FORMAT_LEFT) self.itemsList.InsertColumn(3, "n-term", wx.LIST_FORMAT_LEFT) self.itemsList.InsertColumn(4, "mods before", wx.LIST_FORMAT_CENTER) self.itemsList.InsertColumn(5, "mods after", wx.LIST_FORMAT_CENTER) # set column widths for col, width in enumerate((130,130,130,130,100,100)): self.itemsList.SetColumnWidth(col, width)
def makeIonsList(self): """Make ions list.""" # init list self.ionsList = mwx.sortListCtrl(self, -1, size=(531, 200), style=mwx.LISTCTRL_STYLE_SINGLE) self.ionsList.SetFont(wx.SMALL_FONT) self.ionsList.setAltColour(mwx.LISTCTRL_ALTCOLOUR) # set events self.ionsList.Bind(wx.EVT_LIST_ITEM_SELECTED, self.onIonSelected) self.ionsList.Bind(wx.EVT_KEY_DOWN, self.onListKey) # make columns self.ionsList.InsertColumn(0, "ion", wx.LIST_FORMAT_LEFT) self.ionsList.InsertColumn(1, "monoisotopic mass", wx.LIST_FORMAT_RIGHT) self.ionsList.InsertColumn(2, "average mass", wx.LIST_FORMAT_RIGHT) # set column widths for col, width in enumerate((190, 160, 160)): self.ionsList.SetColumnWidth(col, width)
def makeSequenceList(self): """Make list for sequences.""" # init list self.sequenceList = mwx.sortListCtrl(self, -1, size=(626, 250), style=mwx.LISTCTRL_STYLE_MULTI) self.sequenceList.SetFont(wx.SMALL_FONT) self.sequenceList.setAltColour(mwx.LISTCTRL_ALTCOLOUR) # set events self.sequenceList.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.onItemActivated) # make columns self.sequenceList.InsertColumn(0, "#", wx.LIST_FORMAT_RIGHT) self.sequenceList.InsertColumn(1, "accession", wx.LIST_FORMAT_LEFT) self.sequenceList.InsertColumn(2, "title", wx.LIST_FORMAT_LEFT) self.sequenceList.InsertColumn(3, "length", wx.LIST_FORMAT_RIGHT) # set column widths for col, width in enumerate((30, 120, 385, 70)): self.sequenceList.SetColumnWidth(col, width)