Changeset 53cf669 in sasview for sansguiframe/src/sans/guiframe/local_perspectives
- Timestamp:
- Sep 4, 2011 6:12:25 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:
- e85e2bc
- Parents:
- 37c36d9
- Location:
- sansguiframe/src/sans/guiframe/local_perspectives/plotting
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sansguiframe/src/sans/guiframe/local_perspectives/plotting/Plotter1D.py
r37c36d9 r53cf669 247 247 self.subplot.set_xlim((xlo, xhi)) 248 248 self.subplot.set_ylim((ylo, yhi)) 249 # Update Graph menu and help string 250 pos = self.parent._window_menu.FindItem(self.window_caption) 251 helpString = 'Show/Hide Graph: ' 252 for plot in self.plots.itervalues(): 253 helpString += (' ' + plot.label +';') 254 self.parent._window_menu.SetHelpString(pos, helpString) 249 255 else: 250 256 self.plots[data.id] = data … … 270 276 Display the position of the mouse on the statusbar 271 277 """ 272 PlotPanel.onLeftDown(self, event) 273 ax = event.inaxes 274 if ax != None: 275 # data coordinate position 276 pos_x = "%8.3g"% event.xdata 277 pos_y = "%8.3g"% event.ydata 278 position = "x: %s y: %s" % (pos_x, pos_y) 279 wx.PostEvent(self.parent, StatusEvent(status=position)) 278 PlotPanel.onLeftDown(self, event) 280 279 # unfocus all 281 280 self.parent.set_plot_unfocus() … … 458 457 self._slicerpop.AppendSeparator() 459 458 id = wx.NewId() 460 self._slicerpop.Append(id, '&Reset Range')459 self._slicerpop.Append(id, '&Reset Axis Ranges') 461 460 wx.EVT_MENU(self, id, self.onResetGraph) 462 461 try: … … 490 489 newLabel = dial.getText() 491 490 selected_plot.label = newLabel 491 # Updata Graph menu help string 492 pos = self.parent._window_menu.FindItem(self.window_caption) 493 helpString = 'Show/Hide Graph: ' 494 for plot in self.plots.itervalues(): 495 helpString += (' ' + plot.label +';') 496 self.parent._window_menu.SetHelpString(pos, helpString) 497 #break 492 498 dial.Destroy() 499 493 500 ## render the graph 494 501 self._onEVT_FUNC_PROPERTY() -
sansguiframe/src/sans/guiframe/local_perspectives/plotting/Plotter2D.py
r37c36d9 r53cf669 143 143 """ 144 144 # Check that the LEFT button was pressed 145 if event.button == 1: 146 self.leftdown = True 147 ax = event.inaxes 148 if ax != None: 149 self.xInit, self.yInit = event.xdata, event.ydata 145 PlotPanel.onLeftDown(self, event) 146 150 147 self.plottable_selected(self.data2D.id) 151 152 148 self._manager.set_panel_on_focus(self) 153 149 wx.PostEvent(self.parent, PanelOnFocusEvent(panel=self)) … … 251 247 self.toolbar.update() 252 248 self._is_zoomed = False 253 249 250 # Update Graph menu and help string 251 pos = self.parent._window_menu.FindItem(self.window_caption) 252 helpString = 'Show/Hide Graph: ' 253 helpString += (' ' + data.label +';') 254 self.parent._window_menu.SetHelpString(pos, helpString) 255 254 256 def _set_axis_labels(self): 255 257 """ … … 383 385 slicerpop.Append(id, '&Toggle Linear/Log Scale') 384 386 wx.EVT_MENU(self, id, self._onToggleScale) 387 388 389 slicerpop.AppendSeparator() 390 id = wx.NewId() 391 slicerpop.Append(id, '&Window Title') 392 wx.EVT_MENU(self, id, self.onChangeCaption) 393 385 394 try: 386 395 pos_evt = event.GetPosition() … … 391 400 self.PopupMenu(slicerpop, pos) 392 401 393 slicerpop.AppendSeparator()394 id = wx.NewId()395 slicerpop.Append(id, '&Window Title')396 wx.EVT_MENU(self, id, self.onChangeCaption)397 398 self.PopupMenu(self._slicerpop, pos)399 402 400 403 def onEditLabels(self, event): … … 416 419 colour = dial.getColor() 417 420 if len(newlabel) > 0: 421 # update Label 418 422 selected_plot.label = newlabel 423 self.graph.title(newlabel) 419 424 self.title_label = selected_plot.label 420 425 self.title_font = font … … 433 438 raise 434 439 dial.Destroy() 440 441 # Update Graph menu and help string 442 if self.title_label != None: 443 pos = self.parent._window_menu.FindItem(self.window_caption) 444 helpString = 'Show/Hide Graph: ' 445 helpString += (' ' + self.title_label +';') 446 self.parent._window_menu.SetHelpString(pos, helpString) 435 447 436 448 -
sansguiframe/src/sans/guiframe/local_perspectives/plotting/plotting.py
r846c724 r53cf669 158 158 if pos != -1: 159 159 self.menu.Delete(DEFAULT_MENU_ITEM_ID) 160 161 self.menu.AppendCheckItem(event_id, new_panel.window_caption,162 "Show %s plot panel" % new_panel.window_caption)163 self.menu.Check(event_id, IS_WIN)164 wx.EVT_MENU(self.parent, event_id, self._on_check_menu)165 166 wx.EVT_SHOW(new_panel, self._on_close_panel)167 168 160 # Set UID to allow us to reference the panel later 169 161 new_panel.uid = event_id … … 172 164 self.plot_panels[new_panel.group_id] = new_panel 173 165 166 # Set Graph menu and help string 167 helpString = 'Show/Hide Graph: ' 168 for plot in new_panel.plots.itervalues(): 169 helpString += (' ' + plot.label + ';') 170 self.menu.AppendCheckItem(event_id, new_panel.window_caption, 171 helpString) 172 self.menu.Check(event_id, IS_WIN) 173 wx.EVT_MENU(self.parent, event_id, self._on_check_menu) 174 175 wx.EVT_SHOW(new_panel, self._on_close_panel) 176 174 177 175 178 def create_1d_panel(self, data, group_id): … … 282 285 title = None 283 286 if hasattr(event, 'title'): 284 title = event.title287 title = 'Graph'#event.title 285 288 286 289 data = event.plot
Note: See TracChangeset
for help on using the changeset viewer.