Changeset 943cacb in sasview for calculatorview/perspectives


Ignore:
Timestamp:
Jan 20, 2011 8:05:18 AM (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:
8dc02d8b
Parents:
19637b1
Message:

Added callback(textEnter) method on param value changes

Location:
calculatorview/perspectives/calculator
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • calculatorview/perspectives/calculator/calculator_widgets.py

    rb0ab6cb r943cacb  
    1616        Binds the appropriate events for user interactions. 
    1717    """ 
    18     def __init__(self, *args, **kwds): 
     18    def __init__(self, parent = None, *args, **kwds): 
    1919         
    20         wx.TextCtrl.__init__(self, *args, **kwds) 
     20        wx.TextCtrl.__init__(self, parent, *args, **kwds) 
    2121         
    2222        ## Set to True when the mouse is clicked while the whole  
     
    2828        self.Bind(wx.EVT_LEFT_UP, self._highlight_text) 
    2929        self.Bind(wx.EVT_SET_FOCUS, self._on_set_focus) 
     30        self.Bind(wx.EVT_TEXT_ENTER, parent._onparamEnter ) 
    3031 
    3132    def _on_set_focus(self, event): 
  • calculatorview/perspectives/calculator/kiessig_calculator_panel.py

    re696e0a r943cacb  
    2828    FONT_VARIANT = 1 
    2929  
    30 class KiessigThicknessCalculatorPanel(wx.Panel, PanleBase): 
     30class KiessigThicknessCalculatorPanel(wx.Panel, PanelBase): 
    3131    """ 
    3232    Provides the Kiessig thickness calculator GUI. 
     
    183183        output = "%-7.4g" % value 
    184184        return output.lstrip().rstrip()    
    185       
     185     
     186    def _onparamEnter(self, event = None): 
     187        """ 
     188        On Text_enter_callback, perform compute 
     189        """ 
     190        self.on_compute(event) 
     191              
    186192class KiessigWindow(wx.Frame): 
    187193    def __init__(self, parent=None, title="Kiessig Thickness Calculator", 
  • calculatorview/perspectives/calculator/resolution_calculator_panel.py

    r5cc393b8 r943cacb  
    958958        self.sigma_r_txt.SetLabel('Sigma_x:') 
    959959        self.sigma_phi_txt.SetLabel('Sigma_y:') 
     960        self._onparamEnter() 
    960961         
    961962    def _on_rp_coordinate(self,event=None): 
     
    969970        self.sigma_r_txt.SetLabel('Sigma_r:   ') 
    970971        self.sigma_phi_txt.SetLabel('Sigma_phi:') 
     972        self._onparamEnter() 
    971973         
    972974    def _status_info(self, msg = '', type = "update"): 
     
    978980                             StatusEvent(status = msg, type = type )) 
    979981 
    980                    
     982 
     983    def _onparamEnter(self, event = None): 
     984        """ 
     985        On Text_enter_callback, perform compute 
     986        """ 
     987        self.on_compute() 
     988         
     989         
    981990class ResolutionWindow(wx.Frame): 
    982991    def __init__(self, parent = None, title = "SANS Resolution Estimator", 
Note: See TracChangeset for help on using the changeset viewer.