Changeset 63dc6e5 in sasview for sansguiframe/src/sans


Ignore:
Timestamp:
Oct 3, 2011 7:22:33 AM (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:
342dc442
Parents:
7bd6cfae
Message:

working on display plot

File:
1 edited

Legend:

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

    r5425990 r63dc6e5  
    101101        self._cols = 50 
    102102        self._rows = 51 
     103        self.last_selected_row = -1 
     104        self.last_selected_col = -1 
    103105        col_with = 30 
    104106        row_height = 20 
     
    108110        self.selected_cells = [] 
    109111        self.selected_cols = [] 
     112        self.selected_row = [] 
     113        self.plottable_list = [] 
     114        self.plottable_flag = False 
    110115        self.SetColMinimalAcceptableWidth(col_with) 
    111116        self.SetRowMinimalAcceptableHeight(row_height) 
     
    133138        row, col = event.GetRow(), event.GetCol() 
    134139        cell = (row, col) 
     140        event.Skip() 
    135141        if not flag: 
    136142            self.selected_cells = [] 
    137143            self.axis_value = [] 
    138144            self.axis_label = "" 
     145        if col >= 0: 
     146             self.axis_label = self.GetCellValue(0, col) 
    139147        if cell not in self.selected_cells: 
    140148            if row > 0: 
     
    147155            if cell_row > 0 and cell_row < self.max_row_touse: 
    148156                self.axis_value.append(self.GetCellValue(cell_row, cell_col)) 
    149         self.axis_label = self.GetCellValue(0, col) 
    150         event.Skip() 
    151        
     157         
     158    def set_plottable_list(self, prev_row, next_row, prev_col, next_col): 
     159        """ 
     160        """ 
     161        if (prev_col == -1  and next_col != -1 and prev_row != -1 ) or \ 
     162            (prev_row == -1 and  next_row !=-1 and prev_col != -1): 
     163            self.plottable_flag = True 
     164        if self.plottable_flag: 
     165            print "special case" 
     166                 
    152167    def on_left_click(self, event): 
    153168        """ 
     
    157172        flag = event.CmdDown() or event.ControlDown() 
    158173        col = event.GetCol() 
     174        row = event.GetRow() 
     175        print "on left click", row, col, flag 
     176     
    159177        if not flag: 
    160178            self.selected_cols = [] 
    161179            self.selected_cells = [] 
    162180            self.axis_label = "" 
     181            self.plottable_list = [] 
     182            self.plottable_flag = False 
     183        else: 
     184            self.set_plottable_list(prev_row=self.last_selected_row, 
     185                                     next_row=row,  
     186                                     prev_col=self.last_selected_col, 
     187                                      next_col=col) 
     188             
     189        self.last_selected_col = col 
     190        self.last_selected_row = row 
    163191        if col != -1: 
    164192            for row in range(1, self.GetNumberRows()+ 1): 
Note: See TracChangeset for help on using the changeset viewer.