Changeset 4e0dfe4 in sasview
- Timestamp:
- Mar 16, 2012 6:47:46 PM (13 years ago)
- 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:
- ae56c90
- Parents:
- 25b7bf9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansguiframe/src/sans/guiframe/data_processor.py
r25b7bf9 r4e0dfe4 151 151 """ 152 152 flag = event.CmdDown() or event.ControlDown() 153 flag_shift = event.ShiftDown() 153 154 row, col = event.GetRow(), event.GetCol() 154 155 cell = (row, col) 155 156 event.Skip() 156 if not flag :157 if not flag and not flag_shift: 157 158 self.selected_cols = [] 158 159 self.selected_rows = [] … … 169 170 self.axis_label = self.GetCellValue(label_row, col) 170 171 self.selected_cols.append(col) 171 if cell not in self.selected_cells: 172 if row > 0: 173 self.selected_cells.append(cell) 174 self.selected_rows.append(row) 172 if flag_shift: 173 if not self.selected_rows: 174 min_r = 1 175 else: 176 min_r = min(self.selected_rows) 177 for row_s in range(min_r, row+1): 178 cel = (row_s, col) 179 if cel not in self.selected_cells: 180 if row > 0: 181 self.selected_cells.append(cel) 182 self.selected_rows.append(row) 183 for row_s in self.selected_rows: 184 cel = (row_s, col) 185 if row_s > row: 186 try: 187 self.selected_cells.remove(cel) 188 except: 189 pass 190 try: 191 self.selected_rows.remove(row_s) 192 except: 193 pass 194 elif flag: 195 if cell not in self.selected_cells: 196 if row > 0 : 197 self.selected_cells.append(cell) 198 self.selected_rows.append(row) 199 else: 200 try: 201 self.selected_cells.remove(cell) 202 except: 203 pass 204 try: 205 self.selected_rows.remove(row) 206 except: 207 pass 175 208 else: 176 if flag:177 self.selected_cells.remove(cell)209 self.selected_cells.append(cell) 210 self.selected_rows.append(row) 178 211 self.axis_value = [] 179 212 for cell_row, cell_col in self.selected_cells: 180 213 if cell_row > 0 and cell_row < self.max_row_touse: 181 214 self.axis_value.append(self.GetCellValue(cell_row, cell_col)) 182 183 215 184 216 def on_left_click(self, event): 185 217 """ … … 188 220 event.Skip() 189 221 flag = event.CmdDown() or event.ControlDown() 222 190 223 col = event.GetCol() 191 224 row = event.GetRow() 192 if not flag:225 if not (flag): 193 226 self.selected_cols = [] 194 227 self.selected_rows = [] … … 217 250 self.axis_value = [] 218 251 for cell_row, cell_col in self.selected_cells: 219 self.axis_value.append(self.GetCellValue(cell_row, cell_col)) 252 val = self.GetCellValue(cell_row, cell_col) 253 if not val: 254 self.axis_value.append(self.GetCellValue(cell_row, cell_col)) 220 255 self.axis_label = self.GetCellValue(0, col) 221 256 if not self.axis_label: … … 549 584 pos = self.GetSelection() 550 585 grid = self.GetPage(pos) 586 #grid.selected_cols = [grid.GetSelectedRows()]# 551 587 if len(grid.selected_cols) >= 1: 552 588 col = grid.selected_cols[0] … … 599 635 """ 600 636 """ 601 result = " "637 result = " " 602 638 if row_min is not None or row_max is not None: 603 639 if row_min is None: … … 633 669 if index -1 >= 0: 634 670 new_row, _ = temp_list[index-1] 635 label += create_label(col_name, None, new_row +1) 671 if not new_row==None and new_row!=' ' : 672 label += create_label(col_name, None, int(new_row) +1) 673 else: 674 label += "]" 636 675 label += "," 637 676 if index + 1 < len(temp_list): 638 677 new_row, _ = temp_list[index + 1] 639 label += create_label(col_name, new_row+1, None) 640 if index == 0: 641 label += create_label(col_name, row_min+1, None) 642 elif index == len(temp_list)-1: 643 label += create_label(col_name, None, row_max+1) 678 if not new_row==None: 679 label += create_label(col_name, int(new_row)+1, None) 680 if row_min != None and row_max != None: 681 if index == 0: 682 label += create_label(col_name, int(row_min)+1, None) 683 elif index == len(temp_list)-1: 684 label += create_label(col_name, None, int(row_max)+1) 644 685 index += 1 645 return label, col_title 686 # clean up the list 687 label_out = '' 688 for item in label.split(','): 689 if item.split(":")[1]=="]": 690 continue 691 else: 692 label_out += item + "," 693 694 return label_out, col_title 646 695 647 696 def on_close_page(self, event): … … 858 907 if len(grid.selected_cells) != 1: 859 908 msg = "2D View: Please select one data set" 860 msg += " at a time for View Results."909 msg += " at a time for View Fit Results." 861 910 wx.PostEvent(self.parent.parent, 862 911 StatusEvent(status=msg, … … 874 923 group_id=str(new_plot.group_id), 875 924 title=title)) 876 msg = "Plotting the View Results completed!"925 msg = "Plotting the View Fit Results completed!" 877 926 wx.PostEvent( self.parent.parent, 878 927 StatusEvent(status=msg)) … … 993 1042 self.x_axis_unit = wx.TextCtrl(self, -1) 994 1043 self.y_axis_unit = wx.TextCtrl(self, -1) 995 self.view_button = wx.Button(self, -1, "View Results")1044 self.view_button = wx.Button(self, -1, "View Fits") 996 1045 view_tip = "Highlight the data set or the Chi2 column first." 997 1046 self.view_button.SetToolTipString(view_tip)
Note: See TracChangeset
for help on using the changeset viewer.