Ignore:
Timestamp:
Jun 19, 2020 4:19:13 PM (3 years ago)
Author:
toby
Message:

Add sphere of atoms arround view point; show distances to peaks and atoms around view point

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIctrlGUI.py

    r4498 r4499  
    10571057        return  # Returning without calling event.Skip, which eats the keystroke
    10581058
    1059 def G2SliderWidget(parent,loc,key,label,xmin,xmax,iscale):
     1059def G2SliderWidget(parent,loc,key,label,xmin,xmax,iscale,
     1060                       onChange=None,onChangeArgs=[]):
    10601061    '''A customized combination of a wx.Slider and a validated
    10611062    wx.TextCtrl (see :class:`ValidatedTxtCtrl`) that allows either
     
    10811082    :param float iscale: number to scale values to integers which is what the
    10821083       Scale widget uses. If the xmin=1 and xmax=4 and iscale=1 then values
    1083        only the values 1,2,3 and 4 can be set with the slider. If
     1084       only the values 1,2,3 and 4 can be set with the slider.
     1085
     1086    :param callable onChange: function to call when value is changed.
     1087       Default is None where nothing will be called.
    10841088       
     1089    :param list onChangeArgs: arguments to be passed to onChange function
     1090       when called.
    10851091    :returns: returns a wx.BoxSizer containing the widgets
    10861092    '''
     
    10891095        loc[key] = vScale.GetValue()/float(iscale)
    10901096        wx.TextCtrl.SetValue(vEntry,str(loc[key])) # will not trigger onValSet
     1097        if onChange: onChange(*onChangeArgs)
    10911098    def onValSet(*args,**kwargs):
    10921099        vScale.SetValue(int(0.5+iscale*loc[key]))       
     1100        if onChange: onChange(*onChangeArgs)
    10931101    loc[key] = min(xmax,max(xmin,loc[key]))
    10941102    hSizer = wx.BoxSizer(wx.HORIZONTAL)
Note: See TracChangeset for help on using the changeset viewer.