Changeset 647df0d1 in sasview


Ignore:
Timestamp:
Sep 30, 2011 2:43:22 PM (13 years ago)
Author:
Gervaise Alina <gervyh@…>
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:
b7c6a4a
Parents:
62f851f
Message:

fix select row on grid

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sansguiframe/src/sans/guiframe/data_processor.py

    r71fa9028 r647df0d1  
    142142        Catch the left click on label mouse event 
    143143        """ 
     144        event.Skip() 
    144145        flag = event.CmdDown() or event.ControlDown() 
    145146        col = event.GetCol() 
     
    148149            self.selected_cells = [] 
    149150            self.axis_label = "" 
    150         for row in range(1, self.GetNumberRows()+ 1): 
    151             cell = (row, col) 
    152             if row > 0 and row < self.max_row_touse: 
    153                 if cell not in self.selected_cells: 
    154                     self.selected_cells.append(cell) 
    155         self.selected_cols.append(col) 
    156         self.axis_value = [] 
    157         for cell_row, cell_col in self.selected_cells: 
    158             self.axis_value.append(self.GetCellValue(cell_row, cell_col)) 
    159         self.axis_label = self.GetCellValue(0, col) 
    160         event.Skip() 
    161          
    162          
     151        if col != -1: 
     152            for row in range(1, self.GetNumberRows()+ 1): 
     153                cell = (row, col) 
     154                if row > 0 and row < self.max_row_touse: 
     155                    if cell not in self.selected_cells: 
     156                        self.selected_cells.append(cell) 
     157            self.selected_cols.append(col) 
     158            self.axis_value = [] 
     159            for cell_row, cell_col in self.selected_cells: 
     160                self.axis_value.append(self.GetCellValue(cell_row, cell_col)) 
     161            self.axis_label = self.GetCellValue(0, col) 
     162        
     163 
    163164    def on_right_click(self, event): 
    164165        """ 
     
    187188        pos = self.ScreenToClient(pos) 
    188189        self.PopupMenu(slicerpop, pos) 
     190        event.Skip() 
    189191         
    190192    def insert_col_menu(self, menu, label, window): 
Note: See TracChangeset for help on using the changeset viewer.