Index: sansguiframe/src/sans/guiframe/data_processor.py
===================================================================
--- sansguiframe/src/sans/guiframe/data_processor.py	(revision 63dc6e5783d726bf7c2a74071fd90d34be73571a)
+++ sansguiframe/src/sans/guiframe/data_processor.py	(revision 75790dc35aed00d84a1ba6dd0a80bb7273785864)
@@ -33,5 +33,5 @@
         self.col = -1
         self.row = -1
-        self.object = None
+        self.object = []
         
 
@@ -110,6 +110,6 @@
         self.selected_cells = []
         self.selected_cols = []
-        self.selected_row = []
-        self.plottable_list = []
+        self.selected_rows = []
+        self.plottable_cells = []
         self.plottable_flag = False
         self.SetColMinimalAcceptableWidth(col_with)
@@ -156,12 +156,5 @@
                 self.axis_value.append(self.GetCellValue(cell_row, cell_col))
         
-    def set_plottable_list(self, prev_row, next_row, prev_col, next_col):
-        """
-        """
-        if (prev_col == -1  and next_col != -1 and prev_row != -1 ) or \
-            (prev_row == -1 and  next_row !=-1 and prev_col != -1):
-            self.plottable_flag = True
-        if self.plottable_flag:
-            print "special case"
+    
                 
     def on_left_click(self, event):
@@ -173,20 +166,18 @@
         col = event.GetCol()
         row = event.GetRow()
-        print "on left click", row, col, flag
-    
         if not flag:
             self.selected_cols = []
+            self.selected_rows = []
             self.selected_cells = []
             self.axis_label = ""
             self.plottable_list = []
+            self.plottable_cells = []
             self.plottable_flag = False
-        else:
-            self.set_plottable_list(prev_row=self.last_selected_row,
-                                     next_row=row, 
-                                     prev_col=self.last_selected_col,
-                                      next_col=col)
-            
+       
         self.last_selected_col = col
         self.last_selected_row = row
+        if row != -1 and row not in self.selected_rows:
+             self.selected_rows.append(row)
+             
         if col != -1:
             for row in range(1, self.GetNumberRows()+ 1):
@@ -200,4 +191,9 @@
                 self.axis_value.append(self.GetCellValue(cell_row, cell_col))
             self.axis_label = self.GetCellValue(0, col)
+        
+            
+            
+            
+            
        
 
@@ -586,8 +582,10 @@
         
         self.plotting_sizer = wx.FlexGridSizer(3, 7, 10, 5)
+        self.button_sizer = wx.BoxSizer(wx.HORIZONTAL)
         self.grid_sizer = wx.BoxSizer(wx.HORIZONTAL)
         self.vbox.AddMany([(self.grid_sizer, 1, wx.EXPAND, 0),
                            (wx.StaticLine(self, -1), 0, wx.EXPAND, 0),
-                           (self.plotting_sizer)])
+                           (self.plotting_sizer),
+                           (self.button_sizer)])
         self.parent = parent
         self._data_inputs = data_inputs
@@ -601,4 +599,5 @@
         self.x_axis_unit = None
         self.y_axis_unit = None
+        self.view_button = None
         self.plot_button = None
         self.notebook = None
@@ -645,5 +644,5 @@
                                                                     str(col))
                         wx.PostEvent(self.parent.parent, 
-                             SatusEvent(status=msg, info="error")) 
+                             StatusEvent(status=msg, info="error")) 
             else:
                 axis.append(None) 
@@ -660,4 +659,59 @@
                                                details=self.details)
         
+    def on_view(self, event):
+        """
+        Get object represented buy the given cell and plot them.
+        """
+        pos = self.notebook.GetSelection()
+        grid = self.notebook.GetPage(pos)
+        title = self.notebook.GetPageText(pos)
+        
+        
+        group_id = wx.NewId()
+        for cell in grid.selected_cells:
+            row, col = cell
+            label_row = 0
+            label = grid.GetCellValue(label_row, col)
+            if label in grid.data:
+                values = grid.data[label]
+                value = values[row -1]
+                if issubclass(value.__class__, BatchCell):
+                    for new_plot in value.object:
+                        if new_plot is None:
+                            msg = "Row %s , " % str(row)
+                            msg += "Column %s doesn't have a view" % str(label)
+                            #raise ValueError, msg
+                            wx.PostEvent(self.parent.parent, 
+                                 StatusEvent(status=msg, info="error")) 
+                            return
+                        if issubclass(new_plot.__class__, Data1D):
+                            new_plot.group_id = group_id
+                            new_plot.list_group_id .append(group_id)
+                        else:
+                            if label.lower() == "data":
+                                if len(grid.selected_cells) != 1:
+                                    msg = "Can only view one"
+                                    msg += " selected data at once"
+                                    wx.PostEvent(self.parent.parent, 
+                                                 StatusEvent(status=msg,
+                                                              info="error")) 
+                                    return
+                                
+                        wx.PostEvent(self.parent.parent, 
+                                     NewPlotEvent(plot=new_plot, 
+                                  group_id=str(new_plot.group_id),
+                                   title =title))  
+                else:
+                   
+                    msg = "Row %s , " % str(row)
+                    msg += "Column %s doesn't have a view" % str(label)
+                    #raise ValueError, msg
+                    wx.PostEvent(self.parent.parent, 
+                         StatusEvent(status=msg, info="error")) 
+                    return
+    
+        
+     
+    
     def on_plot(self, event):
         """
@@ -713,5 +767,5 @@
         except:
              wx.PostEvent(self.parent.parent, 
-                             SatusEvent(status=msg, info="error")) 
+                             StatusEvent(status=msg, info="error")) 
         
     def layout_grid(self):
@@ -727,4 +781,5 @@
         Draw area containing options to plot
         """
+       
         self.x_axis_title = wx.TextCtrl(self, -1)
         self.y_axis_title = wx.TextCtrl(self, -1)
@@ -739,5 +794,11 @@
         self.x_axis_unit = wx.TextCtrl(self, -1)
         self.y_axis_unit = wx.TextCtrl(self, -1)
+        self.view_button = wx.Button(self, -1, "View")
+        wx.EVT_BUTTON(self, self.view_button.GetId(), self.on_view)
         self.plot_button = wx.Button(self, -1, "Plot")
+        self.button_sizer.AddMany( [ (500, 30),
+                                (self.view_button, 0, wx.RIGHT|wx.BOTTOM, 10),
+                                (self.plot_button, 0, wx.RIGHT|wx.BOTTOM, 10)])
+        
         wx.EVT_BUTTON(self, self.plot_button.GetId(), self.on_plot)
         self.plotting_sizer.AddMany([
@@ -767,5 +828,5 @@
                       (-1, -1),
                       (-1, -1),
-                      (self.plot_button, 1, wx.LEFT|wx.BOTTOM, 10)])
+                      (-1, 1)])
    
     def on_edit_axis(self, event):
