Changeset 683 for trunk/GSASIIIO.py
- Timestamp:
- Jul 10, 2012 10:23:32 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIIO.py
r678 r683 998 998 # select one or more from a from list 999 999 choices = [i.filename for i in zinfo] 1000 dlg = wx.MultiChoiceDialog( 1001 parent, 1002 'Select file(s) to extract from zip file'+str(filename), 1003 'Choose file(s)', 1004 choices, 1005 wx.CHOICEDLG_STYLE, 1006 ) 1000 dlg = wx.MultiChoiceDialog(parent,'Select file(s) to extract from zip file'+str(filename), 1001 'Choose file(s)',choices,wx.CHOICEDLG_STYLE,) 1007 1002 if dlg.ShowModal() == wx.ID_OK: 1008 1003 zlist = dlg.GetSelections() 1009 dlg.Destroy()1010 1004 else: 1011 dlg.Destroy()1012 1005 zlist = [] 1006 dlg.Destroy() 1013 1007 else: 1014 1008 # select one from a from list 1015 1009 choices = [i.filename for i in zinfo] 1016 dlg = wx.SingleChoiceDialog( 1017 parent, 1018 'Select file to extract from zip file'+str(filename), 1019 'Choose file', 1020 choices, 1021 ) 1010 dlg = wx.SingleChoiceDialog(parent, 1011 'Select file to extract from zip file'+str(filename),'Choose file', 1012 choices,) 1022 1013 if dlg.ShowModal() == wx.ID_OK: 1023 1014 zlist = [dlg.GetSelection()] 1024 dlg.Destroy()1025 1015 else: 1026 dlg.Destroy()1027 1016 zlist = [-1] 1017 dlg.Destroy() 1028 1018 1029 1019 outlist = [] … … 1033 1023 if os.path.exists(efil) and confirmoverwrite: 1034 1024 result = wx.ID_NO 1035 dlg = wx.MessageDialog( 1036 parent, 1025 dlg = wx.MessageDialog(parent, 1037 1026 'File '+str(efil)+' already exists. OK to overwrite it?', 1038 'Confirm overwrite', 1039 wx.YES_NO | wx.ICON_QUESTION) 1027 'Confirm overwrite',wx.YES_NO | wx.ICON_QUESTION) 1040 1028 try: 1041 1029 result = dlg.ShowModal() … … 1099 1087 #print 'created',self.__class__ 1100 1088 1101 def BlockSelector(self, ChoiceList, ParentFrame=None, 1102 title='Select a block', 1103 size=None, header='Block Selector'): 1089 def BlockSelector(self, ChoiceList, ParentFrame=None,itle='Select a block', 1090 size=None, header='Block Selector'): 1104 1091 ''' Provide a wx dialog to select a block if the file contains more 1105 1092 than one set of data and one must be selected 1106 1093 ''' 1107 dlg = wx.SingleChoiceDialog( 1108 ParentFrame, 1109 title, header, 1110 ChoiceList, 1111 ) 1094 dlg = wx.SingleChoiceDialog(ParentFrame,title, header,ChoiceList,) 1112 1095 if size: dlg.SetSize(size) 1113 1096 if dlg.ShowModal() == wx.ID_OK: 1114 1097 sel = dlg.GetSelection() 1115 dlg.Destroy()1116 1098 return sel 1117 1099 else: 1118 dlg.Destroy()1119 1100 return None 1101 dlg.Destroy() 1120 1102 1121 1103 def MultipleBlockSelector(self, ChoiceList, ParentFrame=None, 1122 title='Select a block', 1123 size=None, header='Block Selector'): 1104 title='Select a block',size=None, header='Block Selector'): 1124 1105 ''' Provide a wx dialog to select a block of data if the file contains more 1125 1106 than one set of data and one must be selected. 1126 1107 Returns a list of the selected blocks 1127 1108 ''' 1128 dlg = wx.MultiChoiceDialog( 1129 ParentFrame, 1130 title, header, 1131 ChoiceList+['Select all'], 1132 wx.CHOICEDLG_STYLE 1133 ) 1109 dlg = wx.MultiChoiceDialog(ParentFrame,title, header,ChoiceList+['Select all'], 1110 wx.CHOICEDLG_STYLE) 1134 1111 if size: dlg.SetSize(size) 1135 1112 if dlg.ShowModal() == wx.ID_OK: 1136 1113 sel = dlg.GetSelections() 1137 dlg.Destroy()1138 1114 else: 1139 dlg.Destroy()1140 1115 return [] 1116 dlg.Destroy() 1141 1117 selected = [] 1142 1118 if len(ChoiceList) in sel: … … 1157 1133 result = None 1158 1134 dlg = MultipleChoicesDialog(choicelist,headinglist, 1159 1135 parent=ParentFrame, **kwargs) 1160 1136 if dlg.ShowModal() == wx.ID_OK: 1161 1137 result = dlg.chosen
Note: See TracChangeset
for help on using the changeset viewer.