Changeset 35c9d31 in sasview


Ignore:
Timestamp:
Nov 13, 2009 12:12:43 PM (14 years ago)
Author:
Jae Cho <jhjcho@…>
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:
c13b8cc
Parents:
c69b6d5
Message:

removed evt_left_up only for mac and added parameter value checking before fitting.

File:
1 edited

Legend:

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

    rc69b6d5 r35c9d31  
    2121    PANEL_WIDTH = 450 
    2222    FONT_VARIANT = 0 
     23    ON_MAC = False 
    2324else: 
    2425    PANEL_WIDTH = 500 
    2526    FONT_VARIANT = 1 
     27    ON_MAC = True 
    2628     
    2729class BasicPage(wx.ScrolledWindow): 
     
    171173            self.Bind(wx.EVT_TEXT_ENTER, parent._onparamEnter \ 
    172174                      if text_enter_callback is None else text_enter_callback) 
    173             self.Bind(wx.EVT_LEFT_UP,    self._highlight_text \ 
    174                       if mouse_up_callback is None else mouse_up_callback) 
     175            if not ON_MAC : 
     176                self.Bind(wx.EVT_LEFT_UP,    self._highlight_text \ 
     177                          if mouse_up_callback is None else mouse_up_callback) 
    175178             
    176179        def _on_set_focus(self, event): 
     
    180183                @param event: mouse event 
    181184            """ 
     185             
    182186            event.Skip() 
    183187            self.full_selection = True 
    184188            return self._on_set_focus_callback(event) 
    185189         
     190  
     191             
    186192        def _highlight_text(self, event): 
    187193            """ 
     
    10001006                self.state_change= True 
    10011007                self._draw_model()  
    1002                   
     1008                 
     1009    def _update_paramv_on_fit(self): 
     1010        """ 
     1011             make sure that update param values just before the fitting 
     1012        """ 
     1013        from sans.guiframe.utils import check_value  
     1014        #flag for qmin qmax check values 
     1015        flag =False 
     1016        is_modified = False 
     1017        ##So make sure that update param values on_Fit. 
     1018        #self._undo.Enable(True) 
     1019        if self.model !=None:            
     1020            ##Check the values 
     1021            self._check_value_enter( self.fittable_param ,is_modified) 
     1022            self._check_value_enter( self.fixed_param ,is_modified) 
     1023            self._check_value_enter( self.parameters ,is_modified)  
     1024 
     1025            # If qmin and qmax have been modified, update qmin and qmax and  
     1026            if check_value( self.qmin, self.qmax): 
     1027                if float(self.qmin.GetValue()) != self.qmin_x: 
     1028                    self.qmin_x = float(self.qmin.GetValue()) 
     1029 
     1030                if float(self.qmax.GetValue()) != self.qmax_x: 
     1031                    self.qmax_x = float(self.qmax.GetValue()) 
     1032                flag = True 
     1033                 
     1034            if self.npts != None: 
     1035                if check_float(self.npts): 
     1036                    if float(self.npts.GetValue()) !=  self.num_points: 
     1037                        self.num_points = float(self.npts.GetValue()) 
     1038 
     1039        else: 
     1040            msg= "Cannot Fit :Must select a model!!!  " 
     1041            wx.PostEvent(self.parent.parent, StatusEvent(status = msg )) 
     1042         
     1043        return flag                            
    10031044                
    10041045    def _is_modified(self, is_modified): 
     
    15151556                    self.model.details[name][1:]= param_min,param_max 
    15161557                 
    1517                                      
    1518                 ## hide statictext +/-     
    1519                 #if item[3]!=None and item[3].IsShown(): 
    1520                 #    item[3].Hide() 
    1521                 ## hide textcrtl  for error after fit 
    1522                 #if item[4]!=None and item[4].IsShown(): 
    1523                 #    item[4].Clear() 
    1524                 #    item[4].Hide() 
    1525  
    15261558                value= float(item[2].GetValue()) 
    15271559 
Note: See TracChangeset for help on using the changeset viewer.