def make_controls(self): panel = self.GetContentsPane() panel.SetSizerType("horizontal") panel.SetSizerProps(expand=True) lhs_panel = sc.SizedPanel(panel) lhs_panel.SetSizerType("vertical") lhs_panel.SetSizerProps(expand=True) wx.StaticText(lhs_panel, -1, _("Provider")) self.provider_choice = wx.Choice( lhs_panel, -1, choices=[prov.display_name for prov in self.providers], ) wx.StaticText(lhs_panel, -1, _("Categories")) self.tree_tabs = wx.Treebook(lhs_panel, -1) self.tree_tabs.SetSizerProps(expand=True) tree_ctrl = self.tree_tabs.GetTreeCtrl() tree_ctrl.SetMinSize((200, 1000)) tree_ctrl.SetLabel(_("Categories")) self.Bind(wx.EVT_CHOICE, self.onProviderChoiceChange, self.provider_choice) self.Bind(wx.EVT_TREEBOOK_PAGE_CHANGED, self.OnPageChanged, self.tree_tabs) tree_ctrl.Bind(wx.EVT_KEY_UP, self.onTreeKeyUp, tree_ctrl) tree_ctrl.Bind(wx.EVT_TREE_ITEM_MENU, self.onTreeContextMenu) self.provider_choice.SetSelection(0) self.setup_provider()
def __init__(self, parent, initial_page_name=None): wx.Dialog.__init__(self, parent, -1, "Preferences", size=(700, 400), pos=wx.DefaultPosition, style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER) sizer = wx.BoxSizer(wx.VERTICAL) self.SetSizer(sizer) self.book = wx.Treebook(self, -1, style=wx.LB_LEFT) sizer.Add(self.book, 1, wx.ALL | wx.EXPAND, self.border) self.add_pages() if initial_page_name: self.show_page(initial_page_name) # self.Bind(wx.EVT_TREEBOOK_PAGE_CHANGED, self.OnPageChanged) # self.Bind(wx.EVT_TREEBOOK_PAGE_CHANGING, self.OnPageChanging) btnsizer = wx.StdDialogButtonSizer() self.ok_btn = wx.Button(self, wx.ID_OK) self.ok_btn.SetDefault() btnsizer.AddButton(self.ok_btn) btn = wx.Button(self, wx.ID_CANCEL) btnsizer.AddButton(btn) btnsizer.Realize() sizer.Add(btnsizer, 0, wx.ALL | wx.EXPAND, self.border) self.Bind(wx.EVT_BUTTON, self.on_button) # Don't call self.Fit() otherwise the dialog buttons are zero height sizer.Fit(self)
def __init__(self, parent, application): style = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER super(PrefDialog, self).__init__(parent, style=style) self._application = application self.__treeBook = wx.Treebook(self, -1) self.__do_layout() self._application.onPreferencesDialogCreate(self)
def __init__(self, *args, **kwargs): self.needsRestart = False super(preferencesDialog, self).__init__(*args, **kwargs) self.Categories = wx.Treebook(self.pane, -1, style=wx.BK_DEFAULT) self.GeneralPage = categories.generalCategory(self.Categories) self.Categories.AddPage(self.GeneralPage, _("General")) self.OutputPage = categories.outputCategory(self.Categories) self.Categories.AddPage(self.OutputPage, _("Output")) self.AlertsPage = categories.alertsCategory(self.Categories) self.Categories.AddPage(self.AlertsPage, _("Alerts")) self.VerbosityPage = categories.verbosityCategory(self.Categories) self.Categories.AddPage(self.VerbosityPage, _("Verbosity")) self.AdvancedPage = categories.advancedCategory(self.Categories) self.Categories.AddPage(self.AdvancedPage, _("Advanced")) self.UpdatesPage = categories.updatesCategory(self.Categories) self.Categories.AddPage(self.UpdatesPage, _("Updates")) self.ContactsManagerPage = categories.contactsManagerCategory( self.Categories) self.Categories.AddPage(self.ContactsManagerPage, _("Contacts Manager")) self.hotKeysPage = categories.hotKeysCategory(self.Categories) self.Categories.AddPage(self.hotKeysPage, _("Hot keys")) self.Categories.GetTreeCtrl().SetFocus() wx.FutureCall(-1, self.AdjustTreebookSize) self.finish_setup(set_focus=False)
def test_treebook4(self): book = wx.Treebook(self.frame) book.AddPage(wx.Panel(book), 'one') book.AddPage(wx.Panel(book), 'two') book.AddSubPage(wx.Panel(book), 'three') tree = book.GetTreeCtrl() assert isinstance(tree, wx.TreeCtrl)
def __init__( self, parent, ID=-1, title='Option Panel', pos=wx.DefaultPosition, size=(640,480), style=wx.DEFAULT_FRAME_STYLE ): wx.Frame.__init__(self, parent, ID, title, pos, size, style) self.temp_userconfig = CopyDict(userConfig) self.temp_customuserconfig = CopyDict(customUserConfig) pp = wx.Panel(self, -1) self.optpane = wx.Treebook(pp, -1, style= wx.BK_DEFAULT) # These are the default panels laying in a tree-like fashion optList = [['Files and Folders'], ['Sleep options'],['Video options'], ['Graphs', 'Style', 'Colours'], ['Custom Panels Options'], ['Information']] # Here we add to position two of the list, under Custom Panels Option, every needed customPanel for panName in self.temp_customuserconfig: optList[3].append(panName) # Now make a bunch of panels for the list book for optCategory in optList: # The first item of the list is the main Panel tbPanel = self.makePanel(self.optpane, optCategory[0]) self.optpane.AddPage(tbPanel, optCategory[0]) for optName in optCategory[1:]: # All the following ones are children tbPanel = self.makePanel(self.optpane, optName) self.optpane.AddSubPage(tbPanel, optName) #self.Bind(wx.EVT_TREEBOOK_PAGE_CHANGED, self.OnPageChanged) btSave = wx.Button(pp, wx.ID_SAVE) btCancel = wx.Button(pp, wx.ID_CANCEL) btSave.Bind(wx.EVT_BUTTON, self.OnSaveOptions) btCancel.Bind(wx.EVT_BUTTON, self.OnCancelOptions) self.Bind(wx.EVT_CLOSE, self.OnCancelOptions) btSz = wx.BoxSizer(wx.HORIZONTAL) btSz.Add (btCancel) btSz.Add (btSave) sz = wx.BoxSizer(wx.VERTICAL) sz.Add (self.optpane, 1, wx.EXPAND) sz.Add (btSz, 0, wx.ALIGN_RIGHT | wx.ALL, 10) pp.SetSizer(sz) # This is a workaround for a sizing bug on Mac... wx.FutureCall(100, self.AdjustSize) for i in range(0,len(self.optpane.Children)-1): self.optpane.ExpandNode(i)
def __init__(self): """ Main function of this class.""" super(mainFrame, self).__init__(None, -1, application.name, size=(1600, 1600)) self.panel = wx.Panel(self) self.sizer = wx.BoxSizer(wx.VERTICAL) self.SetTitle(application.name) self.SetMenuBar(self.makeMenus()) self.nb = wx.Treebook(self.panel, wx.NewId()) self.buffers = {}
def __init__(self, *args, **kwds): kwds[ "style"] = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER | wx.THICK_FRAME wx.Dialog.__init__(self, *args, **kwds) self.__treeBook = wx.Treebook(self, -1) self.__do_layout() Application.onPreferencesDialogCreate(self) self.__expandAllPages() self.__treeBook.SetSelection(0) self.__loadAllOptions() self.__set_properties()
def __init__(self, parent, ID=-1, title='pySolo Video Options', pos=wx.DefaultPosition, size=(640, 480), style=wx.DEFAULT_FRAME_STYLE): wx.Frame.__init__(self, parent, ID, title, pos, size, style) pp = wx.Panel(self, -1) self.optpane = wx.Treebook(pp, -1, style=wx.BK_DEFAULT) # Now make a bunch of panels for the list book for section in options.getOptionsGroups(): # The first item of the list is the main Panel tbPanel = self.makePanel(self.optpane, section) self.optpane.AddPage(tbPanel, section) #for option in options.getOptionsNames(section): # # All the following ones are children # tbPanel = self.makePanel(self.optpane, option) # self.optpane.AddSubPage(tbPanel, option) btSave = wx.Button(pp, wx.ID_SAVE) btCancel = wx.Button(pp, wx.ID_CANCEL) btSave.Bind(wx.EVT_BUTTON, self.onSaveOptions) btCancel.Bind(wx.EVT_BUTTON, self.onCancelOptions) self.Bind(wx.EVT_CLOSE, self.onCancelOptions) btSz = wx.BoxSizer(wx.HORIZONTAL) btSz.Add(btCancel) btSz.Add(btSave) sz = wx.BoxSizer(wx.VERTICAL) sz.Add(self.optpane, 1, wx.EXPAND) sz.Add(btSz, 0, wx.ALIGN_RIGHT | wx.ALL, 10) pp.SetSizer(sz) # This is a workaround for a sizing bug on Mac... wx.FutureCall(100, self.__adjustSize) for i in range(0, len(self.optpane.Children) - 1): self.optpane.ExpandNode(i)
def __init__(self, parent): # Create a dialog super(optionsFrame, self).__init__(parent, -1, 'pySolo Video Options', pos=wx.DefaultPosition, size=(640,480), style=wx.DEFAULT_FRAME_STYLE | wx.OK | wx.CANCEL) #wx.Frame.__init__(self, parent, ID, title, pos, size, style) # Add the options in the side menu pp = wx.Panel(self, -1) self.optpane = wx.Treebook(pp, -1, style= wx.BK_DEFAULT) # Now make a bunch of panels for the list book for section in options.getOptionsGroups(): # The first item of the list is the main Panel tbPanel = self.makePanel(self.optpane, section) self.optpane.AddPage(tbPanel, section) #for option in options.getOptionsNames(section): # # All the following ones are children # tbPanel = self.makePanel(self.optpane, option) # self.optpane.AddSubPage(tbPanel, option) # Add save and cancel buttons to the dialog btSave = wx.Button(pp, wx.ID_OK) btCancel = wx.Button(pp, wx.ID_CANCEL) #btSave.Bind(wx.EVT_BUTTON, self.onSaveOptions) #btCancel.Bind(wx.EVT_BUTTON, self.onCancelOptions) #self.Bind(wx.EVT_CLOSE, self.onCancelOptions) # Boxsizers keep things from being on top of each other # This boxsizer holds the buttons btSz = wx.BoxSizer(wx.HORIZONTAL) btSz.Add (btCancel) btSz.Add (btSave) # This boxsizer holds everything sz = wx.BoxSizer(wx.VERTICAL) sz.Add (self.optpane, 1, wx.EXPAND) sz.Add (btSz, 0, wx.ALIGN_RIGHT | wx.ALL, 10) # The panel will display our main boxsizer pp.SetSizer(sz) # This is a workaround for a sizing bug on Mac... wx.FutureCall(100, self.__adjustSize)
def __init__(self, radio, *a, **k): super(ChirpRadioBrowser, self).__init__(*a, **k) self._loaded = False self._radio = radio self._features = radio.get_features() self._treebook = wx.Treebook(self) try: view = self._treebook.GetTreeCtrl() except AttributeError: # https://github.com/wxWidgets/Phoenix/issues/918 view = self._treebook.GetChildren()[0] view.SetMinSize((250, 0)) self._treebook.Bind(wx.EVT_TREEBOOK_PAGE_CHANGED, self.page_selected) sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(self._treebook, 1, wx.EXPAND) self.SetSizer(sizer)
def __init__(self, parent): super().__init__(parent) self.treebook = wx.Treebook(self) self.treebook_control = self.treebook.GetTreeCtrl() self.base_sizer = wx.BoxSizer(wx.VERTICAL) self.page_overview_panel = PageOverview(self.treebook) self.panel_overview_panel = PanelOverview(self.treebook) self.bubble_overview_panel = BubbleOverview(self.treebook) self.treebook.AddPage(self.page_overview_panel, "Page 1") self.treebook.AddSubPage(self.panel_overview_panel, "Panel 1") self.treebook.InsertSubPage(1, self.bubble_overview_panel, "Bubble 300") self.treebook_control.SetMinSize([125, self.treebook_control.GetMinSize().height]) # forces control to be wide enough to display fully expanded tree self.base_sizer.Add(self.treebook, 1, wx.EXPAND) self.SetSizer(self.base_sizer)
def _init_ctrls(self, prnt): # generated method, don't edit wx.Frame.__init__(self, id=wxID_BASICINTERFACEFRAME, name=u'BasicInterfaceFrame', parent=prnt, pos=wx.Point(1745, 92), size=wx.Size(1448, 874), style=wx.DEFAULT_FRAME_STYLE, title=u'Basic Interface') self._init_utils() self.SetClientSize(wx.Size(1440, 840)) self.SetMenuBar(self.InterfaceMenuBar) self.Bind(wx.EVT_CLOSE, self.OnBasicInterfaceFrameClose) self.InterfaceStatusBar = wx.StatusBar( id=wxID_BASICINTERFACEFRAMEINTERFACESTATUSBAR, name=u'InterfaceStatusBar', parent=self, style=0) self.InterfaceStatusBar.SetHelpText(u'Status') self.InterfaceStatusBar.SetLabel(u'') self._init_coll_InterfaceStatusBar_Fields(self.InterfaceStatusBar) self.SetStatusBar(self.InterfaceStatusBar) self.InterfaceToolBar = wx.ToolBar( id=wxID_BASICINTERFACEFRAMEINTERFACETOOLBAR, name=u'InterfaceToolBar', parent=self, pos=wx.Point(0, 0), size=wx.Size(1440, 40), style=wx.TAB_TRAVERSAL | wx.TB_3DBUTTONS | wx.TB_HORIZONTAL | wx.MAXIMIZE_BOX | wx.NO_BORDER) self.InterfaceToolBar.SetHelpText(u'Launch Boa Contstructor') self.InterfaceToolBar.SetToolTipString(u'InterfaceToolBar') self.InterfaceToolBar.SetToolBitmapSize(wx.Size(30, 30)) self.InterfaceToolBar.SetToolPacking(0) self.InterfaceToolBar.SetToolSeparation(1) self.SetToolBar(self.InterfaceToolBar) self.MainPanel = wx.Panel(id=wxID_BASICINTERFACEFRAMEMAINPANEL, name=u'MainPanel', parent=self, pos=wx.Point(1, 1), size=wx.Size(1438, 838), style=wx.TAB_TRAVERSAL) self.LeftInterfacePanel = wx.Panel( id=wxID_BASICINTERFACEFRAMELEFTINTERFACEPANEL, name=u'LeftInterfacePanel', parent=self.MainPanel, pos=wx.Point(2, 2), size=wx.Size(1355, 834), style=wx.TAB_TRAVERSAL) self.RightControlPanel = wx.Panel( id=wxID_BASICINTERFACEFRAMERIGHTCONTROLPANEL, name=u'RightControlPanel', parent=self.MainPanel, pos=wx.Point(1361, 2), size=wx.Size(75, 834), style=wx.TAB_TRAVERSAL) self.RightControlPanel.SetBackgroundColour(wx.Colour(192, 192, 192)) self.LowerControlPanel = wx.Panel( id=wxID_BASICINTERFACEFRAMELOWERCONTROLPANEL, name=u'LowerControlPanel', parent=self.LeftInterfacePanel, pos=wx.Point(2, 808), size=wx.Size(1351, 24), style=wx.TAB_TRAVERSAL) self.LowerControlPanel.SetBackgroundColour(wx.Colour(0, 255, 128)) self.UpperInterfacePanel = wx.Panel( id=wxID_BASICINTERFACEFRAMEUPPERINTERFACEPANEL, name=u'UpperInterfacePanel', parent=self.LeftInterfacePanel, pos=wx.Point(2, 2), size=wx.Size(1351, 640), style=wx.TAB_TRAVERSAL) self.UpperInterfacePanel.SetBackgroundColour(wx.Colour(128, 128, 128)) self.UpperInterfacePanel.SetHelpText(u'UpperInterfacePanel') self.LowerInterfacePanel = wx.Panel( id=wxID_BASICINTERFACEFRAMELOWERINTERFACEPANEL, name=u'LowerInterfacePanel', parent=self.LeftInterfacePanel, pos=wx.Point(2, 646), size=wx.Size(1351, 158), style=wx.TAB_TRAVERSAL) self.LowerInterfacePanel.SetBackgroundColour(wx.Colour(192, 192, 192)) self.UpperInterface = wx.Notebook( id=wxID_BASICINTERFACEFRAMEUPPERINTERFACE, name=u'UpperInterface', parent=self.UpperInterfacePanel, pos=wx.Point(2, 2), size=wx.Size(1347, 636), style=0) self.LowerInterface = wx.Treebook( id=wxID_BASICINTERFACEFRAMELOWERINTERFACE, name=u'LowerInterface', parent=self.LowerInterfacePanel, pos=wx.Point(2, 2), size=wx.Size(1347, 154), style=0) self.LowerInterface.Bind(wx.EVT_TREEBOOK_PAGE_CHANGED, self.OnLowerInterfaceTreebookPageChanged, id=wxID_BASICINTERFACEFRAMELOWERINTERFACE) self.Display = IEPanel(id=wxID_BASICINTERFACEFRAMEDISPLAY, name=u'Display', parent=self.UpperInterface, pos=wx.Point(0, 0), size=wx.Size(1339, 610), style=wx.TAB_TRAVERSAL) self.Shell = ShellPanel(id=wxID_BASICINTERFACEFRAMESHELL, name=u'Shell', parent=self.LowerInterface, pos=wx.Point(0, 0), size=wx.Size(1281, 154), style=wx.TAB_TRAVERSAL) self.button1 = wx.Button(id=wxID_BASICINTERFACEFRAMEBUTTON1, label=u'Java Script Example', name='button1', parent=self.LowerControlPanel, pos=wx.Point(0, 0), size=wx.Size(136, 23), style=0) self.button1.Bind(wx.EVT_BUTTON, self.OnButton1Button, id=wxID_BASICINTERFACEFRAMEBUTTON1) self.button2 = wx.Button(id=wxID_BASICINTERFACEFRAMEBUTTON2, label='button2', name='button2', parent=self.LowerControlPanel, pos=wx.Point(136, 0), size=wx.Size(75, 23), style=0) self.button2.Bind(wx.EVT_BUTTON, self.OnButton2Button, id=wxID_BASICINTERFACEFRAMEBUTTON2) self.button3 = wx.Button(id=wxID_BASICINTERFACEFRAMEBUTTON3, label='button3', name='button3', parent=self.LowerControlPanel, pos=wx.Point(211, 0), size=wx.Size(75, 23), style=0) self.ExecuteButton = wx.Button( id=wxID_BASICINTERFACEFRAMEEXECUTEBUTTON, label=u'Execute IEPanel.py', name=u'ExecuteButton', parent=self.LowerControlPanel, pos=wx.Point(286, 0), size=wx.Size(111, 23), style=0) self.ExecuteButton.Bind(wx.EVT_BUTTON, self.OnExecuteButtonButton, id=wxID_BASICINTERFACEFRAMEEXECUTEBUTTON) self.ReplaceRightControlButtton = wx.Button( id=wxID_BASICINTERFACEFRAMEREPLACERIGHTCONTROLBUTTTON, label=u'Replace Right Control Panel', name=u'ReplaceRightControlButtton', parent=self.LowerControlPanel, pos=wx.Point(397, 0), size=wx.Size(180, 24), style=0) self.ReplaceRightControlButtton.Bind( wx.EVT_BUTTON, self.OnReplaceRightControlButttonButton, id=wxID_BASICINTERFACEFRAMEREPLACERIGHTCONTROLBUTTTON) self.StatesButton = wx.Button(id=wxID_BASICINTERFACEFRAMESTATESBUTTON, label=u'States', name=u'StatesButton', parent=self.RightControlPanel, pos=wx.Point(0, 0), size=wx.Size(75, 23), style=0) self.StatesButton.Bind(wx.EVT_BUTTON, self.OnStatesButtonButton, id=wxID_BASICINTERFACEFRAMESTATESBUTTON) self.InstrumentsButton = wx.Button( id=wxID_BASICINTERFACEFRAMEINSTRUMENTSBUTTON, label=u'Instruments', name=u'InstrumentsButton', parent=self.RightControlPanel, pos=wx.Point(0, 23), size=wx.Size(75, 23), style=0) self.InstrumentsButton.Bind( wx.EVT_BUTTON, self.OnInstrumentsButtonButton, id=wxID_BASICINTERFACEFRAMEINSTRUMENTSBUTTON) self.LogsPanel = SimpleLogLowerInterfacePanel( id=wxID_BASICINTERFACEFRAMELOGSPANEL, name=u'LogsPanel', parent=self.LowerInterface, pos=wx.Point(0, 0), size=wx.Size(1281, 154), style=wx.TAB_TRAVERSAL) self.ArbDBPanel = SimpleArbDBLowerInterfacePanel( id=wxID_BASICINTERFACEFRAMEARBDBPANEL, name=u'ArbDBPanel', parent=self.LowerInterface, pos=wx.Point(0, 0), size=wx.Size(1281, 154), style=wx.TAB_TRAVERSAL) self.EndOfTheDayButton = wx.Button( id=wxID_BASICINTERFACEFRAMEENDOFTHEDAYBUTTON, label=u'End of The Day Log', name=u'EndOfTheDayButton', parent=self.LowerControlPanel, pos=wx.Point(577, 0), size=wx.Size(103, 23), style=0) self.EndOfTheDayButton.Bind( wx.EVT_BUTTON, self.OnEndOfTheDayButtonButton, id=wxID_BASICINTERFACEFRAMEENDOFTHEDAYBUTTON) self.VisaDialogButton = wx.Button( id=wxID_BASICINTERFACEFRAMEVISADIALOGBUTTON, label=u'VISA Communicator', name=u'VisaDialogButton', parent=self.LowerControlPanel, pos=wx.Point(680, 0), size=wx.Size(184, 23), style=0) self.VisaDialogButton.Bind(wx.EVT_BUTTON, self.OnVisaDialogButtonButton, id=wxID_BASICINTERFACEFRAMEVISADIALOGBUTTON) self._init_coll_InterfaceToolBar_Tools(self.InterfaceToolBar) self._init_coll_UpperInterface_Pages(self.UpperInterface) self._init_coll_LowerInterface_Pages(self.LowerInterface) self._init_sizers()
def __init__(self, parent, icon, scripts_dir): wx.Frame.__init__(self, parent, -1, "mzDesktop", size=(800,620)) self.SetMinSize((800,600)) # add icon self.SetIcon(icon) # add menu bar menu_bar = wx.MenuBar() file_menu = wx.Menu() # Removed due mostly to matplotlib 'recapturing mouse' errors and # a few bugs from changed legacy code. #peak_viewer = file_menu.Append(-1, "&Open MS Data File\tCtrl+O", #"Interactive Peak Viewer") #self.Bind(wx.EVT_MENU, self.on_peak_viewer, peak_viewer) report_viewer = file_menu.Append(-1, "Open &Multiplierz Report\tCtrl+M", "Report Viewer") self.Bind(wx.EVT_MENU, self.on_report_viewer, report_viewer) file_menu.AppendSeparator() file_menu_preferences = file_menu.Append(-1, "&Preferences\tF2", "Multiplierz Preferences") self.Bind(wx.EVT_MENU, self.on_preferences, file_menu_preferences) file_menu.AppendSeparator() file_menu_exit = file_menu.Append(wx.ID_EXIT, "&Quit\tCtrl+Q", "Terminate the program") self.Bind(wx.EVT_MENU, self.on_exit, file_menu_exit) #self.Bind(wx.EVT_CLOSE, self.on_exit) menu_bar.Append(file_menu, "&File") #logger_message(50, 'Inititalizing Tools Menu...') tools_menu = wx.Menu() #full_report_menu = tools_menu.Append(-1, "Mascot Report\tCtrl+W", #"Full Report Wizard for Single Mascot File") #self.Bind(wx.EVT_MENU, self.on_full_report, full_report_menu) p2g_menu = tools_menu.Append(-1, "Pep2Gene Utility", "Prepare and Use Pep2Gene Databases for Gene Annotation") self.Bind(wx.EVT_MENU, self.on_pep2gene, p2g_menu) mzTransform_menu = tools_menu.Append(-1, "mzTransform", "Batch processing of intact protein data.") self.Bind(wx.EVT_MENU, self.on_mzTransform, mzTransform_menu) silac_menu = tools_menu.Append(-1, "SILAC Analysis", "Annotate Search Results with SILAC Ratio Data") self.Bind(wx.EVT_MENU, self.on_silac, silac_menu) feature_menu = tools_menu.Append(-1, "Feature Detection", "Annotate Search Results with Spectrometric Source Feature Data") self.Bind(wx.EVT_MENU, self.on_featureDet, feature_menu) labelEv_menu = tools_menu.Append(-1, "Label Coverage Evaluation", "Evaluates the labelling efficiency of SILAC/TMT/iTRAQ.") self.Bind(wx.EVT_MENU, self.on_labelEv, labelEv_menu) tools_menu.AppendSeparator() pycomet_menu = tools_menu.Append(-1, "Comet Search", "GUI interface to the Comet database search engine.") self.Bind(wx.EVT_MENU, self.on_pycomet, pycomet_menu) xtandem_menu = tools_menu.Append(-1, "XTandem Search", "GUI interface to the XTandem database search engine.") self.Bind(wx.EVT_MENU, self.on_xtandem, xtandem_menu) mascot_menu = tools_menu.Append(-1, "Mascot Search", "GUI interface to submit searches to a Mascot server.") self.Bind(wx.EVT_MENU, self.on_mascot, mascot_menu) tools_menu.AppendSeparator() hotkeys = set() scripts_dir = os.path.join(install_dir, 'scripts') if os.path.exists(scripts_dir): print "Scripts directory found. (This feature is deprecated!)" for d in os.listdir(scripts_dir): new_dir = os.path.join(scripts_dir, d) if os.path.isdir(new_dir): # for each directory we find in scripts_dir for e in os.listdir(new_dir): # maybe in future change this to 'mz', once we have mz-import # only add files that start with 'RC_' prefix--allows user to have a 'main' file for if e.startswith('RC_') and e.endswith('.py'): # add this directory to the path (note: we don't add scripts_dir itself) # also: I'm not adding a directory if it doesn't contain an RC script if new_dir not in sys.path: sys.path.append(new_dir) # strip off prefix and extension for the menu item, assign a hotkey if possible for i,c in enumerate(e[3:-3]): if c not in hotkeys: hotkeys.add(c) item = tools_menu.Append(-1, e[3:(i+3)] + '&' + e[(i+3):-3]) break else: item = tools_menu.Append(-1, e[3:-3]) # no hotkey to use self.Bind(wx.EVT_MENU, ScriptMenuItem(e[:-3]), item) # bind the menu item to the wrapper class #else: #print 'Scripts directory %s not present.' % scripts_dir # The scripts feature is deprecated, so its not worth mentioning if # there's no scripts directory. menu_bar.Append(tools_menu, "&Tools") #logger_message(50, 'Inititalizing Help Menu...') help_menu = wx.Menu() help_menu_contents = help_menu.Append(-1, "&Help\tF1", "Multiplierz Wiki") self.Bind(wx.EVT_MENU, self.on_help, help_menu_contents) help_menu.AppendSeparator() help_menu_about = help_menu.Append(wx.ID_ABOUT, "&About", "About this program") self.Bind(wx.EVT_MENU, self.on_about, help_menu_about) menu_bar.Append(help_menu, "&Help") bug_report = help_menu.Append(-1, "Report a Bug", "Report a Bug in Multiplierz mzDesktop.") self.Bind(wx.EVT_MENU, self.on_bugrep, bug_report) self.SetMenuBar(menu_bar) # add status bar self.statusbar = self.CreateStatusBar() self.statusbar.SetFieldsCount(2) self.statusbar.SetStatusWidths([-1,-3]) self.statusbar.SetStatusText("Ready", 0) # A good idea, but will want to review all print statements to make # sure they make sense in this context (instead of, e.g., 'Generating Scan.' # just hanging out there while using the MS-MS View.) #redirector = Redirection(self.statusbar, sys.stdout) #sys.stdout = redirector #redirector2 = Redirection(self.statusbar, sys.stderr) #sys.stderr = redirector2 self.nb = wx.Treebook(self, -1, size = (-1, -1), style = wx.NB_FIXEDWIDTH) self.nb.AssignImageList(wx.ImageList(1, 1)) # Makes sidebar at least so many pixels wide? #from console import ConsolePanel from digest import DigestPanel from fragment import FragmentPanel from info_file import InfoFilePanel from mascot_report import MascotReportPanel from mascot_web import MascotWebPanel from report_format import ReportFormatPanel from isoSim import IsotopePanel from transform_viewer import TransformPanel from proteinCoverage import CoveragePanel from fasta_tools import FastaPanel from mergeResults import MergePanel from mgf_tools import MGFPanel from general_viewer import ViewPanel from label_viewer import LabelPanel from free_viewer import LabelFreePanel from peptide_tools import PeptidePanel from spectrum_tools import SpectrumPanel ## Add Panels #panels = zip((MascotReportPanel, CoveragePanel, MergePanel, #TransformPanel, #MascotWebPanel, ReportFormatPanel, IsotopePanel, FastaPanel, MGFPanel, #LabelPanel, LabelFreePanel, PeptidePanel, #SpectrumPanel), #('Download Mascot', 'Protein Coverage', 'Merge/Filter Results', #'Charge Transform', #'Mascot Web Extract', 'Reformat Reports', 'Isotope Distribution', 'FASTA Tools', 'MGF Tools', #'MS-MS View', 'Cross-MS Quant View', 'Peptide Prediction', #'Spectrum Tools')) panels = [(MascotReportPanel, 'Download Mascot'), (MascotWebPanel, 'Mascot Web Extract'), # Mostly nonfunctional due to lack of XLSX metadata and outdated Mascot webscraping. (MergePanel, 'Merge/Filter Results'), (ReportFormatPanel, 'Reformat Reports'), (CoveragePanel, 'Protein Coverage'), (TransformPanel, 'Charge Transform'), (IsotopePanel, 'Isotope Distribution'), (LabelPanel, 'MS-MS View'), #(LabelFreePanel, 'Cross-MS Quant View'), (FastaPanel, 'FASTA Tools'), (MGFPanel, 'MGF Tools'), (PeptidePanel, 'Peptide Prediction'), #(SpectrumPanel, 'Spectrum Tools') ] # for each panel: call constructor, passing in notebook as the parent for (p,t) in panels: page = p(self.nb) # This will make tooltips that appear from the entire window; # not entirely desired behavior. self.nb.AddPage(page, t) #self.nb.GetTreeCtrl().SetMinSize((150, -1)) #self.nb.GetTreeCtrl().SetSize((150, -1)) self.nb.SetDoubleBuffered(1) self.Show() self.Maximize() #self.nb.Tile() self.nb.Refresh()
def __init__(self, parent): wx.Dialog.__init__(self, parent, -1, _("Preferences"), size=(600, 440)) self._parent = parent self.treebook = wx.Treebook(self, -1) self.general = wx.Panel(self.treebook, -1) self.MinimizeToTray = wx.CheckBox(self.general, -1, _("Minimize to system tray")) self.MinimizeToTray.SetValue(parent._app.settings["MinimizeToTray"]) sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(self.MinimizeToTray, 0, wx.ALL, 2) self.general.SetSizer(sizer) self.treebook.AddPage(self.general, _("General")) self.editor = wx.Panel(self.treebook, -1) if wx.VERSION_STRING >= "2.9.1.0": box = wx.StaticBox(self.editor, -1, _("Backup")) else: box = self.editor self.BackupType = wx.CheckBox(box, -1, _("Backup files before saving them")) self.BackupType.SetValue(parent._app.settings["BackupType"] > 0) self.BackupType.Bind(wx.EVT_CHECKBOX, self.OnBackupType) self.BackupType2 = wx.CheckBox(box, -1, _("Use custom backup directory")) self.BackupType2.Enable(parent._app.settings["BackupType"] > 0) self.BackupType2.SetValue(parent._app.settings["BackupType"] == 2) self.BackupType2.Bind(wx.EVT_CHECKBOX, self.OnBackupType2) self.BackupDir = wx.DirPickerCtrl(box, -1, parent._app.settings["BackupDir"], style=wx.DIRP_DEFAULT_STYLE ^ wx.DIRP_DIR_MUST_EXIST) self.BackupDir.Enable(parent._app.settings["BackupType"] == 2) self.BackupDir.GetChildren()[0].Bind(wx.EVT_KILL_FOCUS, self.OnBackupDirKillFocus) sizer = wx.BoxSizer(wx.VERTICAL) if wx.VERSION_STRING < "2.9.1.0": box = wx.StaticBox(self.editor, -1, _("Backup")) sizer2 = wx.StaticBoxSizer(box, wx.VERTICAL) sizer2.Add(self.BackupType, 0, wx.ALL, 2) sizer2.Add(self.BackupType2, 0, wx.ALL, 2) sizer2.Add(self.BackupDir, 0, wx.ALL | wx.EXPAND, 2) sizer.Add(sizer2, 0, wx.ALL | wx.EXPAND, 2) self.editor.SetSizer(sizer) self.treebook.AddPage(self.editor, _("Editor")) self.appearance = wx.Panel(self.treebook, -1) self.FixedTabWidth = wx.CheckBox(self.appearance, -1, _("Make all tabs the same width")) self.FixedTabWidth.SetValue(parent._app.settings["FixedTabWidth"]) sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(self.FixedTabWidth, 0, wx.ALL, 2) self.appearance.SetSizer(sizer) self.treebook.AddPage(self.appearance, _("Appearance")) sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(self.treebook, 1, wx.ALL | wx.EXPAND, 2) statictext = wx.StaticText(self, -1, _("*Takes effect after you restart Write++")) statictext.SetForegroundColour("#808080") sizer.Add(statictext, 0, wx.LEFT | wx.RIGHT | wx.EXPAND, 5) sizer2 = wx.StdDialogButtonSizer() sizer2.AddButton(wx.Button(self, wx.ID_OK)) sizer2.AddButton(wx.Button(self, wx.ID_CANCEL)) sizer2.AddButton(wx.Button(self, wx.ID_APPLY)) sizer2.Realize() sizer.Add(sizer2, 0, wx.ALL | wx.EXPAND, 5) self.SetSizer(sizer) self.Bind(wx.EVT_BUTTON, self.OnOk, id=wx.ID_OK) self.Bind(wx.EVT_BUTTON, self.OnCancel, id=wx.ID_CANCEL) self.Bind(wx.EVT_BUTTON, self.OnApply, id=wx.ID_APPLY)
def test_treebook3(self): book = wx.Treebook(self.frame) book.AddPage(wx.Panel(book), 'one') book.AddPage(wx.Panel(book), 'two') book.AddSubPage(wx.Panel(book), 'three')
def __init__(self, title): super(configurationDialog, self).__init__(None, -1, title=title) self.panel = wx.Panel(self) self.sizer = wx.BoxSizer(wx.VERTICAL) self.notebook = wx.Treebook(self.panel)
def __init__(self, frame): self.frame = frame self.TreeBook = wx.Treebook(self.frame) self.page_1 = wx.Panel(self.TreeBook) self.page_2 = wx.Panel(self.TreeBook) self.page_3 = wx.Panel(self.TreeBook) # Translators: Main category name self.TreeBook.AddPage(self.page_1, _("General")) # Translators: Main category name self.TreeBook.AddPage(self.page_2, _("Favoritos")) # Translators: Main category name self.TreeBook.AddPage(self.page_3, _("Buscador")) ########## Botones Multimedia # Translators: Stop button name self.DetenerBTN = wx.Button(self.frame, wx.ID_ANY, _("&Detener")) self.DetenerBTN.Disable() # Translators: Reload button name self.RecargarBTN = wx.Button(self.frame, wx.ID_ANY, _("&Recargar")) self.RecargarBTN.Disable() # Translators: Silence button name self.SilenciarBTN = wx.Button(self.frame, wx.ID_ANY, _("&Silenciar")) self.SilenciarBTN.Disable() self.volumenBarra = wx.Slider(self.frame, wx.ID_ANY, 0, 0, 100, size=(100, -1)) ########## Botones generales # Translators: Action button name self.AccionBTN = wx.Button(self.frame, wx.ID_ANY, _("&Acción")) self.AccionBTN.Disable() self.HerramientasBTN = wx.Button(self.frame, wx.ID_ANY, "&Herramientas") self.HerramientasBTN.Disable() self.AyudaBTN = wx.Button(self.frame, wx.ID_ANY, "Ayuda F1") self.AyudaBTN.Disable() # Translators: Exit button name self.SalirBTN = wx.Button(self.frame, wx.ID_CANCEL, _("Salir Alt + F4")) sizer_TreeBook = wx.BoxSizer(wx.VERTICAL) sizer_TreeBook_BTN_multimedia = wx.BoxSizer(wx.HORIZONTAL) sizer_TreeBook_BTN_general = wx.BoxSizer(wx.HORIZONTAL) sizer_TreeBook.Add(self.TreeBook, 1, wx.ALL | wx.EXPAND, 5) sizer_TreeBook_BTN_multimedia.Add(self.DetenerBTN, 2, wx.CENTER, 5) sizer_TreeBook_BTN_multimedia.Add(self.RecargarBTN, 2, wx.CENTER, 5) sizer_TreeBook_BTN_multimedia.Add(self.SilenciarBTN, 2, wx.CENTER, 5) sizer_TreeBook_BTN_multimedia.Add(self.volumenBarra, 2, wx.CENTER, 5) sizer_TreeBook.Add(sizer_TreeBook_BTN_multimedia, 0, wx.CENTER, 5) sizer_TreeBook_BTN_general.Add(self.AccionBTN, 2, wx.CENTER, 5) sizer_TreeBook_BTN_general.Add(self.HerramientasBTN, 2, wx.CENTER, 5) sizer_TreeBook_BTN_general.Add(self.AyudaBTN, 2, wx.CENTER, 5) sizer_TreeBook_BTN_general.Add(self.SalirBTN, 2, wx.CENTER, 5) sizer_TreeBook.Add(sizer_TreeBook_BTN_general, 0, wx.CENTER, 5) self.frame.SetSizer(sizer_TreeBook)
def test_treebook2(self): book = wx.Treebook() book.Create(self.frame)
def _init_ctrls(self, prnt): # generated method, don't edit wx.Frame.__init__(self, id=wxID_GENERALINTERFACEFRAME, name=u'GeneralInterfaceFrame', parent=prnt, pos=wx.Point(504, 67), size=wx.Size(847, 721), style=wx.DEFAULT_FRAME_STYLE, title=u'General Interface') self._init_utils() self.SetClientSize(wx.Size(839, 687)) self.SetMenuBar(self.InterfaceMenuBar) self.InterfaceStatusBar = wx.StatusBar(id=wxID_GENERALINTERFACEFRAMEINTERFACESTATUSBAR, name=u'InterfaceStatusBar', parent=self, style=0) self.InterfaceStatusBar.SetHelpText(u'Status') self.InterfaceStatusBar.SetLabel(u'') self._init_coll_InterfaceStatusBar_Fields(self.InterfaceStatusBar) self.SetStatusBar(self.InterfaceStatusBar) self.InterfaceToolBar = wx.ToolBar(id=wxID_GENERALINTERFACEFRAMEINTERFACETOOLBAR, name=u'InterfaceToolBar', parent=self, pos=wx.Point(0, 0), size=wx.Size(839, 28), style=wx.TB_HORIZONTAL | wx.NO_BORDER) self.SetToolBar(self.InterfaceToolBar) self.MainPanel = wx.Panel(id=wxID_GENERALINTERFACEFRAMEMAINPANEL, name=u'MainPanel', parent=self, pos=wx.Point(1, 1), size=wx.Size(837, 685), style=wx.TAB_TRAVERSAL) self.LeftInterfacePanel = wx.Panel(id=wxID_GENERALINTERFACEFRAMELEFTINTERFACEPANEL, name=u'LeftInterfacePanel', parent=self.MainPanel, pos=wx.Point(2, 2), size=wx.Size(688, 681), style=wx.TAB_TRAVERSAL) self.RightControlPanel = wx.Panel(id=wxID_GENERALINTERFACEFRAMERIGHTCONTROLPANEL, name=u'RightControlPanel', parent=self.MainPanel, pos=wx.Point(694, 2), size=wx.Size(141, 681), style=wx.TAB_TRAVERSAL) self.RightControlPanel.SetBackgroundColour(wx.Colour(255, 128, 128)) self.LowerControlPanel = wx.Panel(id=wxID_GENERALINTERFACEFRAMELOWERCONTROLPANEL, name=u'LowerControlPanel', parent=self.LeftInterfacePanel, pos=wx.Point(2, 652), size=wx.Size(684, 27), style=wx.TAB_TRAVERSAL) self.LowerControlPanel.SetBackgroundColour(wx.Colour(0, 255, 128)) self.UpperInterfacePanel = wx.Panel(id=wxID_GENERALINTERFACEFRAMEUPPERINTERFACEPANEL, name=u'UpperInterfacePanel', parent=self.LeftInterfacePanel, pos=wx.Point(2, 2), size=wx.Size(684, 516), style=wx.TAB_TRAVERSAL) self.UpperInterfacePanel.SetBackgroundColour(wx.Colour(128, 128, 128)) self.UpperInterfacePanel.SetHelpText(u'UpperInterfacePanel') self.LowerInterfacePanel = wx.Panel(id=wxID_GENERALINTERFACEFRAMELOWERINTERFACEPANEL, name=u'LowerInterfacePanel', parent=self.LeftInterfacePanel, pos=wx.Point(2, 522), size=wx.Size(684, 126), style=wx.TAB_TRAVERSAL) self.LowerInterfacePanel.SetBackgroundColour(wx.Colour(192, 192, 192)) self.UpperInterface = wx.Notebook(id=wxID_GENERALINTERFACEFRAMEUPPERINTERFACE, name=u'UpperInterface', parent=self.UpperInterfacePanel, pos=wx.Point(2, 2), size=wx.Size(680, 512), style=0) self.LowerInterface = wx.Treebook(id=wxID_GENERALINTERFACEFRAMELOWERINTERFACE, name=u'LowerInterface', parent=self.LowerInterfacePanel, pos=wx.Point(2, 2), size=wx.Size(680, 122), style=0) self.Display = IEPanel(id=wxID_GENERALINTERFACEFRAMEDISPLAY, name=u'Display', parent=self.UpperInterface, pos=wx.Point(0, 0), size=wx.Size(672, 486), style=wx.TAB_TRAVERSAL) self.Shell = ShellPanel(id=wxID_GENERALINTERFACEFRAMESHELL, name=u'Shell', parent=self.LowerInterface, pos=wx.Point(0, 0), size=wx.Size(622, 122), style=wx.TAB_TRAVERSAL) self._init_coll_UpperInterface_Pages(self.UpperInterface) self._init_coll_LowerInterface_Pages(self.LowerInterface) self._init_sizers()