Changeset 6d52f21d in sasview for sansguiframe/src/sans/guiframe/local_perspectives
- Timestamp:
- Aug 19, 2011 1:48:30 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:
- 65db69d2
- Parents:
- 39e52376
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansguiframe/src/sans/guiframe/local_perspectives/plotting/Plotter1D.py
rc966e1c r6d52f21d 20 20 21 21 from danse.common.plottools.PlotPanel import PlotPanel 22 from danse.common.plottools.SizeDialog import SizeDialog 23 from danse.common.plottools.LabelDialog import LabelDialog 22 24 #from danse.common.plottools.plottables import Graph 23 25 from sans.guiframe import dataFitting … … 39 41 BIN_WIDTH = 1 40 42 41 class SizeDialog(wx.Dialog):42 def __init__(self, parent, id, title):43 wx.Dialog.__init__(self, parent, id, title, size=(300, 175))44 45 #panel = wx.Panel(self, -1)46 47 mainbox = wx.BoxSizer(wx.VERTICAL)48 vbox = wx.BoxSizer(wx.VERTICAL)49 textbox = wx.BoxSizer(wx.HORIZONTAL)50 51 text1 = "Enter in a custom size (float values > 0 accepted)"52 msg = wx.StaticText(self, -1, text1,(30,15), style=wx.ALIGN_CENTRE)53 msg.SetLabel(text1)54 self.myTxtCtrl = wx.TextCtrl(self, -1, '', (100, 50))55 56 textbox.Add(self.myTxtCtrl, flag=wx.LEFT|wx.RIGHT|wx.ADJUST_MINSIZE,57 border=10, proportion=2)58 vbox.Add(msg, flag=wx.ALL, border=10, proportion=1)59 vbox.Add(textbox, flag=wx.EXPAND|wx.TOP|wx.BOTTOM|wx.ADJUST_MINSIZE,60 border=10)61 62 hbox = wx.BoxSizer(wx.HORIZONTAL)63 okButton = wx.Button(self,wx.ID_OK, 'OK', size=(70, 30))64 closeButton = wx.Button(self,wx.ID_CANCEL, 'Close', size=(70, 30))65 hbox.Add(okButton, wx.LEFT|wx.RIGHT|wx.ADJUST_MINSIZE,66 border=10)67 hbox.Add(closeButton, wx.LEFT|wx.RIGHT|wx.ADJUST_MINSIZE,68 border=10)69 70 mainbox.Add(vbox, flag=wx.ALL, border=10)71 mainbox.Add(hbox, flag=wx.EXPAND|wx.TOP|wx.BOTTOM|wx.ADJUST_MINSIZE,72 border=10)73 self.SetSizer(mainbox)74 75 def getText(self):76 return self.myTxtCtrl.GetValue()77 43 78 44 class ModelPanel1D(PlotPanel, PanelBase): … … 434 400 435 401 self._slicerpop.AppendSeparator() 436 402 403 id = wx.NewId() 404 self._slicerpop.Append(id, '&Edit Legend Label', 'Edit Legend Label') 405 wx.EVT_MENU(self, id, self.onEditLabels) 406 407 self._slicerpop.AppendSeparator() 408 437 409 id = wx.NewId() 438 410 self.hide_menu = self._slicerpop.Append(id, "Hide Error") … … 468 440 self.parent.onfreeze([plot.id]) 469 441 442 def onEditLabels(self, event): 443 """ 444 """ 445 menu = event.GetEventObject() 446 id = event.GetId() 447 label = menu.GetLabel(id) 448 selected_plot = self.plots[self.graph.selected_plottable] 449 450 dial = LabelDialog(None, -1, 'Change Plot Label') 451 if dial.ShowModal() == wx.ID_OK: 452 newLabel = dial.getText() 453 dial.Destroy() 454 455 selected_plot.name = newLabel 456 self.graph.render(self) 457 self._onEVT_FUNC_PROPERTY() 458 459 470 460 def onChangeColor(self, event): 471 461 """ … … 630 620 def _add_more_tool(self): 631 621 """ 632 Add refresh button in the tool bar622 Add refresh, add/delete button in the tool bar 633 623 """ 634 624 if self.parent.__class__.__name__ != 'ViewerFrame': … … 642 632 self.toolbar.Realize() 643 633 wx.EVT_TOOL(self, id_delete, self._on_delete) 634 635 #New toolbar option - adding text to the plot 636 self.toolbar.AddSeparator() 637 id_text = wx.NewId() 638 text = wx.ArtProvider.GetBitmap(wx.ART_PASTE, wx.ART_TOOLBAR) 639 self.toolbar.AddSimpleTool(id_text, text, 640 'Add Text to Plot', 'Adds text to plot') 641 642 self.toolbar.Realize() 643 wx.EVT_TOOL(self, id_text, self._on_addtext) 644 645 self.toolbar.AddSeparator() 646 id_text = wx.NewId() 647 text = wx.ArtProvider.GetBitmap(wx.ART_CUT, wx.ART_TOOLBAR) 648 self.toolbar.AddSimpleTool(id_text, text, 649 'Remove Text from Plot', 'Removes text from plot') 650 651 self.toolbar.Realize() 652 wx.EVT_TOOL(self, id_text, self._on_removetext) 644 653 645 654 def _on_delete(self, event): … … 653 662 action="delete")) 654 663 664
Note: See TracChangeset
for help on using the changeset viewer.