Changeset 49ad00b in sasview for sansguiframe/src/sans
- Timestamp:
- Sep 1, 2011 5:05:08 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:
- dc51a7f
- Parents:
- 7022fdc
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansguiframe/src/sans/guiframe/data_processor.py
r9680906d r49ad00b 32 32 col_with = 30 33 33 row_height = 20 34 self.axis_value = [] 35 self.axis_label = "" 36 self.selected_cells = [] 37 self.selected_cols = [] 34 38 self.SetColMinimalAcceptableWidth(col_with) 35 39 self.SetRowMinimalAcceptableHeight(row_height) 36 40 self.SetNumberRows(self._cols) 37 41 self.SetNumberCols(self._rows) 42 self.Bind(wx.grid.EVT_GRID_LABEL_LEFT_CLICK, self.on_left_click) 38 43 self.Bind(wx.grid.EVT_GRID_LABEL_RIGHT_CLICK, self.on_right_click) 39 self. axis_value = []40 self.axis_label = ""44 self.Bind(wx.grid.EVT_GRID_CELL_LEFT_CLICK, self.on_selected_cell) 45 41 46 47 def on_selected_cell(self, event): 48 """ 49 Handler catching cell selection 50 """ 51 flag = event.CmdDown() or event.ControlDown() 52 cell = (event.GetRow(), event.GetCol()) 53 if not flag: 54 self.selected_cells = [] 55 if cell in self.selected_cells: 56 self.selected_cells.remove(cell) 57 else: 58 self.selected_cells.append(cell) 59 event.Skip() 60 61 def on_left_click(self, event): 62 """ 63 Catch the left click on label mouse event 64 """ 65 flag = event.CmdDown() or event.ControlDown() 66 col = event.GetCol() 67 if not flag: 68 self.selected_cols = [] 69 if col not in self.selected_cols: 70 self.selected_cols.append(col) 71 event.Skip() 72 42 73 def on_right_click(self, event): 43 74 """ … … 158 189 pos = self.GetSelection() 159 190 grid = self.GetPage(pos) 160 print "selected column",grid.GetSelectedCols(), grid.GetSelectionMode() 161 162 print "selected cell", grid.GetSelectedCells() 163 164 print "notebook on_edit_axis()" 191 if len(grid.selected_cols) > 1: 192 msg = "Edit axis doesn't understand this selection.\n" 193 msg += "Please select only one column" 194 raise ValueError, msg 195 list_of_cells = [] 196 if len(grid.selected_cols) == 1: 197 col = grid.selected_cols[0] 198 for row in range(grid.GetNumberRows()): 199 list_of_cells.append((row, col)) 200 201 print "selected cell", grid.selected_cells.sort(), grid.selected_cells 202 165 203 166 204 def on_close_page(self, event): … … 272 310 new_plot.yaxis(self.y_axis_label.GetValue(), self.y_axis_unit.GetValue()) 273 311 wx.PostEvent(self.parent.parent, 274 NewPlotEvent(plot=new_plot, group_id=str(new_plot.group_id), title ="batch")) 312 NewPlotEvent(plot=new_plot, 313 group_id=str(new_plot.group_id), title ="batch")) 275 314 def layout_grid(self): 276 315 """
Note: See TracChangeset
for help on using the changeset viewer.