Changeset fe496eeb in sasview for sansview/perspectives


Ignore:
Timestamp:
Jun 9, 2009 5:56:59 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:
240b9966
Parents:
330573d
Message:

working on saving option undo and redo

Location:
sansview/perspectives/fitting
Files:
2 edited

Legend:

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

    r330573d rfe496eeb  
    142142        """ 
    143143        print "enable redo" 
    144         event = NextStateEvent(page= sent) 
     144        event = NextStateEvent(page= self) 
    145145        wx.PostEvent(self.parent, event) 
    146146         
     
    576576     
    577577     
    578     def reset_page_helper(self, state): 
     578    def reset_page_helper(self, state, forward=False): 
    579579        """ 
    580580            Use page_state and change the state of existing page 
  • sansview/perspectives/fitting/fitpanel.py

    r330573d rfe496eeb  
    7272         
    7373    def getNextItem(self): 
    74         position = self.iterator.next() 
     74        position = self.iterator.next(max= len(self)-1) 
    7575        if position >= len(self): 
    7676            return None 
     
    172172        self.Bind(basepage.EVT_PAGE_INFO, self._onGetstate) 
    173173        self.Bind(basepage.EVT_PREVIOUS_STATE, self._onUndo) 
    174         #(NextStateEvent, EVT_NEXT_STATE)   = wx.lib.neweve 
     174        self.Bind(basepage.EVT_NEXT_STATE, self._onRedo) 
     175        
    175176        # increment number for model name 
    176177        self.count=0 
     
    406407            else: 
    407408                state = self.fit_page_name[page.window_name].getPreviousItem() 
     409                page._redo.Enable(True) 
    408410            page.reset_page(state) 
    409                  
    410            
     411         
     412    def _onRedo(self, event ):  
     413        """ 
     414            return the next state available 
     415        """        
     416        page = event.page  
     417        if page.window_name in self.fit_page_name: 
     418            length= len(self.fit_page_name[page.window_name]) 
     419            if self.fit_page_name[page.window_name].getCurrentPosition()== length -1: 
     420                state = None 
     421                page._redo.Enable(False) 
     422            else: 
     423                state = self.fit_page_name[page.window_name].getNextItem() 
     424            page.reset_page(state)   
    411425                 
    412426    def _help_add_model_page(self,model,page_title="Model", qmin=0.0001,  
Note: See TracChangeset for help on using the changeset viewer.