Changeset 1177 for trunk/GSASIIgrid.py


Ignore:
Timestamp:
Dec 19, 2013 1:34:54 PM (9 years ago)
Author:
vondreele
Message:

try to add more control over number format from ValidatedTxtCtrl?
not entirely successful so far

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIgrid.py

    r1172 r1177  
    175175      type of int, float, str or unicode; the TextCrtl will be initialized
    176176      from this value.
     177     
     178    :param list [nDig,nPlc]: number of digits & places after decimal to use
     179      for display of float (default=[10,2])
    177180
    178181    :param bool notBlank: if True (default) blank values are invalid
     
    223226
    224227    '''
    225     def __init__(self,parent,loc,key,notBlank=True,min=None,max=None,
     228    def __init__(self,parent,loc,key,nDig=[10,2],notBlank=True,min=None,max=None,
    226229                 OKcontrol=None,OnLeave=None,typeHint=None,
    227230                 CIFinput=False, **kw):
     
    229232        self.result = loc
    230233        self.key = key
     234        self.nDig = nDig
    231235        self.OKcontrol=OKcontrol
    232236        self.OnLeave = OnLeave
     
    314318                else:
    315319                    self.invalid = True
    316             wx.TextCtrl.SetValue(self,str(G2py3.FormatValue(val)))
     320            wx.TextCtrl.SetValue(self,str(G2py3.FormatValue(val,self.nDig)))
    317321        else:
    318322            wx.TextCtrl.SetValue(self,str(val))
Note: See TracChangeset for help on using the changeset viewer.