Changeset 9a585d0 in sasview
- Timestamp:
- Feb 13, 2009 12:41:08 PM (16 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:
- 96f97f3
- Parents:
- ea290ee
- Location:
- guiframe/local_perspectives/plotting
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
guiframe/local_perspectives/plotting/Plotter1D.py
r96d7959 r9a585d0 175 175 # Option to save the data displayed 176 176 177 178 179 # Various plot options 180 id = wx.NewId() 181 slicerpop.Append(id,'&Save image', 'Save image as PNG') 182 wx.EVT_MENU(self, id, self.onSaveImage) 183 184 id = wx.NewId() 185 slicerpop.Append(id,'&Print image', 'Print image ') 186 wx.EVT_MENU(self, id, self.onPrint) 187 188 slicerpop.AppendSeparator() 189 item_list = self.parent.get_context_menu(self.graph) 190 #print "item_list",item_list 191 if (not item_list==None) and (not len(item_list)==0): 192 for item in item_list: 193 try: 194 id = wx.NewId() 195 slicerpop.Append(id, item[0], item[1]) 196 wx.EVT_MENU(self, id, item[2]) 197 except: 198 pass 199 #print sys.exc_value 200 #print RuntimeError, "View1DPanel.onContextMenu: bad menu item" 201 slicerpop.AppendSeparator() 177 202 #for plot in self.graph.plottables: 178 203 if self.graph.selected_plottable in self.plots: … … 189 214 self.action_ids[str(id)] = plot 190 215 wx.EVT_MENU(self, id, self._onRemove) 191 216 slicerpop.AppendSeparator() 192 217 # Option to hide 193 218 #TODO: implement functionality to hide a plottable (legend click) 194 219 195 196 # Various plot options197 id = wx.NewId()198 slicerpop.Append(id,'&Save image', 'Save image as PNG')199 wx.EVT_MENU(self, id, self.onSaveImage)200 201 slicerpop.AppendSeparator()202 item_list = self.parent.get_context_menu(self.graph)203 #print "item_list",item_list204 if (not item_list==None) and (not len(item_list)==0):205 for item in item_list:206 try:207 id = wx.NewId()208 slicerpop.Append(id, item[0], item[1])209 wx.EVT_MENU(self, id, item[2])210 except:211 pass212 #print sys.exc_value213 #print RuntimeError, "View1DPanel.onContextMenu: bad menu item"214 215 220 216 221 if self.graph.selected_plottable in self.plots: … … 232 237 wx.EVT_MENU(self, id, self.onFitting) 233 238 234 slicerpop.AppendSeparator()239 slicerpop.AppendSeparator() 235 240 id = wx.NewId() 236 241 slicerpop.Append(id, '&Change scale') … … 240 245 slicerpop.Append(id, '&Reset Graph') 241 246 wx.EVT_MENU(self, id, self.onResetGraph) 242 247 """ 243 248 slicerpop.AppendSeparator() 244 249 id = wx.NewId() … … 249 254 slicerpop.Append(id,'&Printer Preview', 'Set image size') 250 255 wx.EVT_MENU(self, id, self.onPrinterPreview) 251 252 id = wx.NewId() 253 slicerpop.Append(id,'&Print image', 'Print image ') 254 wx.EVT_MENU(self, id, self.onPrint) 256 """ 257 255 258 256 259 pos = event.GetPosition() -
guiframe/local_perspectives/plotting/Plotter2D.py
rea290ee r9a585d0 180 180 slicerpop.set_plots(self.plots) 181 181 slicerpop.set_graph(self.graph) 182 182 183 184 id = wx.NewId() 185 slicerpop.Append(id, '&Save image') 186 wx.EVT_MENU(self, id, self.onSaveImage) 187 188 id = wx.NewId() 189 slicerpop.Append(id,'&Print image', 'Print image ') 190 wx.EVT_MENU(self, id, self.onPrint) 191 192 slicerpop.AppendSeparator() 183 193 item_list = self.parent.get_context_menu(self.graph) 184 194 if (not item_list==None) and (not len(item_list)==0): … … 194 204 #print RuntimeError, "View1DPanel2D.onContextMenu: bad menu item" 195 205 196 slicerpop.AppendSeparator()206 slicerpop.AppendSeparator() 197 207 id = wx.NewId() 198 208 slicerpop.Append(id, '&Edit Detector Parameters') … … 231 241 wx.EVT_MENU(self, id, self._onEditSlicer) 232 242 slicerpop.AppendSeparator() 233 234 id = wx.NewId() 235 slicerpop.Append(id, '&Save image') 236 wx.EVT_MENU(self, id, self.onSaveImage) 237 243 244 """ 238 245 # Option to save the data displayed 239 246 id = wx.NewId() … … 244 251 slicerpop.Append(id,'&Printer Preview', 'Set image size') 245 252 wx.EVT_MENU(self, id, self.onPrinterPreview) 246 247 id = wx.NewId() 248 slicerpop.Append(id,'&Print image', 'Print image ') 249 wx.EVT_MENU(self, id, self.onPrint) 250 slicerpop.AppendSeparator() 253 """ 251 254 id = wx.NewId() 252 255 slicerpop.Append(id, '&Toggle Linear/Log scale') … … 261 264 print "edit detortor param",self.zmin_2D, self.zmax_2D 262 265 import detector_dialog 263 dialog = detector_dialog.DetectorDialog( None, -1, "")266 dialog = detector_dialog.DetectorDialog(self, -1,base=self.parent) 264 267 xnpts = len(self.data2D.x_bins) 265 268 ynpts = len(self.data2D.y_bins) -
guiframe/local_perspectives/plotting/detector_dialog.py
rea290ee r9a585d0 7 7 import wx 8 8 from sans.guiframe.utils import format_number 9 9 from sans.guicomm.events import StatusEvent ,NewPlotEvent,SlicerEvent 10 10 class DetectorDialog(wx.Dialog): 11 11 """ … … 13 13 """ 14 14 15 def __init__(self, *args, **kwds):15 def __init__(self,parent,id=1,base=None, *args, **kwds): 16 16 17 17 kwds["style"] = wx.DEFAULT_DIALOG_STYLE 18 wx.Dialog.__init__(self, *args, **kwds)19 18 wx.Dialog.__init__(self,parent,id=1, *args, **kwds) 19 self.parent=base 20 20 self.label_xnpts = wx.StaticText(self, -1, "Detector width in pixels") 21 21 self.label_ynpts = wx.StaticText(self, -1, "Detector Height in pixels") … … 66 66 if value and float( value)==0.0: 67 67 flag = False 68 wx.PostEvent(self.parent, StatusEvent(status="Enter number greater than zero")) 68 69 self.zmin_ctl.SetBackgroundColour("pink") 69 70 self.zmin_ctl.Refresh() … … 73 74 except: 74 75 flag = False 76 wx.PostEvent(self.parent, StatusEvent(status="Enter float value")) 75 77 self.zmin_ctl.SetBackgroundColour("pink") 76 78 self.zmin_ctl.Refresh() … … 79 81 if value and int(value)==0.0: 80 82 flag = False 83 wx.PostEvent(self.parent, StatusEvent(status="Enter number greater than zero")) 81 84 self.zmax_ctl.SetBackgroundColour("pink") 82 85 self.zmax_ctl.Refresh() … … 86 89 except: 87 90 flag = False 91 wx.PostEvent(self.parent, StatusEvent(status="Enter Integer value")) 88 92 self.zmax_ctl.SetBackgroundColour("pink") 89 93 self.zmax_ctl.Refresh()
Note: See TracChangeset
for help on using the changeset viewer.