- Timestamp:
- Feb 2, 2010 10:17:26 AM (15 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 629e8b9
- Parents:
- c1469ebe
- Location:
- sansview
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/fitting.py
r25e3fc9 r9455d77 478 478 if fitproblem_count == 1: 479 479 #qmin, qmax= self.current_pg.get_range() 480 print "went here fitproblem_count == 1",fitproblem_count == 1480 #print "went here fitproblem_count == 1",fitproblem_count == 1 481 481 calc_fit=FitThread(parent =self.parent, 482 482 fn= self.fitter, … … 634 634 self.fitter.set_data(data=metadata,Uid=self.fit_id, 635 635 smearer=smearer,qmin= qmin,qmax=qmax ) 636 print "self.fitter.set_data"636 #print "self.fitter.set_data" 637 637 self.fitter.select_problem_for_fit(Uid= self.fit_id, 638 638 value= value.get_scheduled()) -
sansview/sansview.py
r6e0e2d85 r9455d77 42 42 #from gui_manager import ViewApp 43 43 self.gui = SansViewApp(0) 44 44 # Set the application manager for the GUI 45 self.gui.set_manager(self) 45 46 # Add perspectives to the basic application 46 47 # Additional perspectives can still be loaded … … 53 54 try: 54 55 import sans.perspectives.pr as module 55 fitting_plug = module.Plugin(standalone=False)56 self.gui.add_perspective( fitting_plug)56 self.fitting_plug = module.Plugin(standalone=False) 57 self.gui.add_perspective(self.fitting_plug) 57 58 except: 58 59 logging.error("SansView: could not find P(r) plug-in module") … … 76 77 # Fitting perspective 77 78 import perspectives.fitting as module 78 fitting_plug = module.Plugin()79 self.gui.add_perspective( fitting_plug)80 79 self.fitting_plug = module.Plugin() 80 self.gui.add_perspective(self.fitting_plug) 81 81 82 # Add welcome page 82 83 self.gui.set_welcome_panel(WelcomePanel) … … 85 86 self.gui.build_gui() 86 87 87 # Set the application manager for the GUI88 self.gui.set_manager(self)89 90 88 # Start the main loop 91 89 self.gui.MainLoop() 92 90 91 def on_close_welcome_panel(self): 92 """ 93 When closing the welcome panel, set to the default perspective 94 """ 95 default_perspective = self.fitting_plug.get_perspective() 96 return 97 self.fitting_plug.on_perspective(event=None) 98 93 99 94 100 if __name__ == "__main__": -
sansview/welcome_panel.py
rf1aa385 r9455d77 13 13 14 14 import wx 15 import wx.aui 15 16 import wx.lib.hyperlink 16 17 import os.path … … 23 24 else: 24 25 FONT_VARIANT = 1 26 27 class WelcomePanel(wx.aui.AuiNotebook): 28 """ 29 Panel created like about box as a welcome page 30 Shows product name, current version, authors, and link to the product page. 31 """ 32 ## Internal nickname for the window, used by the AUI manager 33 window_name = "default" 34 ## Name to appear on the window title bar 35 window_caption = "Welcome panel" 36 ## Flag to tell the AUI manager to put this panel in the center pane 37 CENTER_PANE = True 38 25 39 26 class WelcomePanel(wx.Panel): 40 def __init__(self,parent,manager=None, *args, **kwds): 41 42 kwds["style"] = wx.aui.AUI_NB_DEFAULT_STYLE 43 44 wx.aui.AuiNotebook.__init__(self, parent, *args, **kwds) 45 #For sansview the parent is guiframe 46 self.parent = parent 47 #For sansview the manager is sansview application 48 self.manager = manager 49 welcome_page = WelcomePage(self) 50 self.AddPage(page=welcome_page, caption="Welcome") 51 52 pageClosedEvent = wx.aui.EVT_AUINOTEBOOK_PAGE_CLOSE 53 self.Bind(wx.aui.EVT_AUINOTEBOOK_PAGE_CLOSE, self.on_close_page) 54 self.Center() 55 56 def set_manager(self, manager): 57 """ 58 the manager of the panel in this case the application itself 59 """ 60 self.manager = manager 61 62 def on_close_page(self, event): 63 """ 64 65 """ 66 if self.parent is not None: 67 self.parent.on_close_welcome_panel() 68 if self.manager is not None: 69 self.manager.on_close_welcome_panel() 70 event.Veto() 71 72 class WelcomePage(wx.Panel): 27 73 """ 28 74 Panel created like about box as a welcome page
Note: See TracChangeset
for help on using the changeset viewer.