Changeset 7c845cb in sasview


Ignore:
Timestamp:
Apr 8, 2009 6:31:37 PM (16 years ago)
Author:
Gervaise Alina <gervyh@…>
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:
892f246
Parents:
6999659
Message:

open and closing page and simpage update

Location:
sansview/perspectives/fitting
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • sansview/perspectives/fitting/basepage.py

    r6999659 r7c845cb  
    461461        wx.PostEvent(self.parent, event) 
    462462     
    463     def reset_page(self, state): 
     463    def reset_page_helper(self, state): 
    464464        """ 
    465465            Use page_state and change the state of existing page 
  • sansview/perspectives/fitting/fitpage.py

    r3b605bb r7c845cb  
    406406        wx.PostEvent(self.event_owner, evt)    
    407407         
    408      
     408    def reset_page(self, state): 
     409        """ 
     410            reset the state 
     411        """ 
     412        self.reset_page_helper(state) 
     413        evt = ModelEventbox(model=self.model) 
     414        wx.PostEvent(self.event_owner, evt)    
     415         
     416         
    409417    def _onparamEnter(self,event): 
    410418        """  
  • sansview/perspectives/fitting/fitpanel.py

    r6999659 r7c845cb  
    9595             close page and remove all references to the closed page 
    9696        """ 
    97         state = self.get_current_page().createMemento() 
    98         page_name = self.get_current_page().window_name 
     97        selected_page = self.GetPage(self.GetSelection()) 
     98        ## removing about page 
     99        if selected_page==self.about_page: 
     100            self.about_page=None 
     101            return  
     102        ## removing sim_page 
     103        if selected_page == self.sim_page: 
     104            self.manager.sim_page=None  
     105            return 
     106         
     107        ## closing other pages 
     108        state = selected_page.createMemento() 
     109        page_name = selected_page.window_name 
    99110        page_finder = self.manager.get_page_finder()  
    100111        fitproblem = None 
    101          
    102         if self.get_current_page() in page_finder: 
    103             fitproblem= page_finder[self.get_current_page()] 
    104              
    105          
    106         selected_page = self.GetPage(self.GetSelection()) 
    107         page_number = self.GetSelection() 
    108          
    109         if self.sim_page != selected_page and selected_page!=self.about_page: 
    110             # remove the check box link to the model name of this page (selected_page) 
    111             if self.sim_page !=None : 
     112        ## removing model page 
     113        if selected_page == self.model_page: 
     114            fitproblem = selected_page.model.clone() 
     115            self.model_page = None 
     116            ## page on menu 
     117            self.manager._add_page_onmenu(page_name, fitproblem) 
     118        else: 
     119            if selected_page in page_finder: 
     120        
     121                fitproblem= page_finder[selected_page].clone() 
     122                ## page on menu 
     123                self.manager._add_page_onmenu(page_name, fitproblem) 
     124                del page_finder[selected_page] 
     125            ##remove the check box link to the model name of this page (selected_page) 
     126            try: 
    112127                self.sim_page.draw_page() 
    113              
    114             #Delete the page from notebook 
    115             if selected_page.window_name in self.list_fitpage_name: 
    116                 self.list_fitpage_name.remove(selected_page.window_name) 
    117             
    118             if selected_page.window_name== "Model": 
    119                 fitproblem = self.get_current_page().model.clone() 
    120                 self.model_page=None 
     128            except: 
     129                ## that page is already deleted no need to remove check box on 
     130                ##non existing page 
     131                pass 
    121132                 
    122             if  page_number == 1: 
    123                 self.model_page=None 
    124                  
    125              
    126         elif selected_page==self.about_page: 
    127             self.about_page=None 
    128         else: 
    129             self.manager.sim_page=None  
    130         ## page on menu 
    131         self.manager._add_page_onmenu(page_name, fitproblem) 
     133        #Delete the name of the page into the list of open page 
     134        if selected_page.window_name in self.list_fitpage_name: 
     135            self.list_fitpage_name.remove(selected_page.window_name) 
     136     
     137         
    132138         
    133139         
  • sansview/perspectives/fitting/fitproblem.py

    r9853ad0 r7c845cb  
    3535        """ 
    3636        import copy  
    37         obj          = FitProblem( self.parent,model= model ) 
     37        obj          = FitProblem() 
     38        model= None 
     39        if self.model!=None: 
     40            model = self.model.clone() 
     41        obj.model = model 
    3842        obj.fit_data = copy.deepcopy(self.fit_data) 
    3943        obj.model = copy.deepcopy(self.model) 
  • sansview/perspectives/fitting/fitting.py

    rb787e68c r7c845cb  
    476476                    if fitproblem != None: 
    477477                        self.page_finder[page]=fitproblem 
     478                        if self.sim_page != None: 
     479                            self.sim_page.draw_page() 
     480                             
    478481                else: 
    479482                    model = fitproblem 
  • sansview/perspectives/fitting/modelpage.py

    r3b605bb r7c845cb  
    225225        self.SetScrollbars(20,20,200,100) 
    226226              
     227              
     228    def reset_page(self, state): 
     229        """ 
     230            reset the state 
     231        """ 
     232        self.reset_page_helper(state) 
     233         
     234         
    227235    def _onModel2D(self, event): 
    228236        """ 
Note: See TracChangeset for help on using the changeset viewer.