Changeset 4868 for trunk/GSASIIctrlGUI.py
- Timestamp:
- Mar 30, 2021 5:45:34 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIctrlGUI.py
r4852 r4868 183 183 pass 184 184 185 if 'phoenix' in wx.version(): 186 wxValidator = wx.Validator 187 else: 188 wxValidator = wx.pyValidator 189 185 190 #### Fixed definitions for wx Ids ################################################################################ 186 191 def Define_wxId(*args): … … 542 547 val = loc[key] 543 548 if 'style' in kw: # add a "Process Enter" to style 544 kw['style'] += kw['style'] |wx.TE_PROCESS_ENTER549 kw['style'] |= wx.TE_PROCESS_ENTER 545 550 else: 546 551 kw['style'] = wx.TE_PROCESS_ENTER … … 646 651 s = '' 647 652 for c in val: 648 if ord(c) < 128: s += c 653 if ord(c) < 128: 654 s += c 655 else: 656 s += '!' 649 657 if val != s: 650 658 val = s … … 715 723 self.OKcontrol(True) 716 724 # always store the result 717 if self.CIFinput : # for CIFmake results ASCII725 if self.CIFinput and '2' in platform.python_version_tuple()[0]: # CIF/Py2 make results ASCII 718 726 self.result[self.key] = val.encode('ascii','replace') 719 727 else: … … 730 738 val = self.GetValue().strip() 731 739 # always store the result 732 if self.CIFinput : # forCIF make results ASCII740 if self.CIFinput and '2' in platform.python_version_tuple()[0]: # Py2/CIF make results ASCII 733 741 self.result[self.key] = val.encode('ascii','replace') 734 742 else: … … 777 785 pass 778 786 ################################################################################ 779 class NumberValidator(wx .PyValidator):787 class NumberValidator(wxValidator): 780 788 '''A validator to be used with a TextCtrl to prevent 781 789 entering characters other than digits, signs, and for float … … 816 824 result=None, key=None, OKcontrol=None, CIFinput=False): 817 825 'Create the validator' 818 if 'phoenix' in wx.version(): 819 wx.Validator.__init__(self) 820 else: 821 wx.PyValidator.__init__(self) 826 wxValidator.__init__(self) 822 827 # save passed parameters 823 828 self.typ = typ … … 978 983 979 984 ################################################################################ 980 class ASCIIValidator(wx .PyValidator):985 class ASCIIValidator(wxValidator): 981 986 '''A validator to be used with a TextCtrl to prevent 982 987 entering characters other than ASCII characters. … … 994 999 'Create the validator' 995 1000 import string 996 wx .PyValidator.__init__(self)1001 wxValidator.__init__(self) 997 1002 # save passed parameters 998 1003 self.result = result … … 1020 1025 is associated with. 1021 1026 ''' 1022 self.result[self.key] = tc.GetValue().encode('ascii','replace') 1027 if '2' in platform.python_version_tuple()[0]: 1028 self.result[self.key] = tc.GetValue().encode('ascii','replace') 1029 else: 1030 self.result[self.key] = tc.GetValue() 1023 1031 log.LogVarChange(self.result,self.key) 1024 1032
Note: See TracChangeset
for help on using the changeset viewer.