Changeset 9f51c2c in sasview for sansguiframe/src
- Timestamp:
- Aug 15, 2012 6:52:34 PM (12 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:
- f866fb5
- Parents:
- 25e4dda
- Location:
- sansguiframe/src/sans/guiframe/local_perspectives/plotting
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sansguiframe/src/sans/guiframe/local_perspectives/plotting/Plotter1D.py
r3fdb68a r9f51c2c 634 634 curr_symbol = 13 635 635 636 self.appD = appearanceDialog(self, 'Modify plot properties') 637 self.appD.setDefaults(float(curr_size), 638 int(curr_color), 639 str(appearanceDialog.find_key\ 640 (self.get_symbol_label(), 641 int(curr_symbol))),curr_label) 642 if self.appD.ShowModal() == wx.ID_OK: 643 self.on_AppDialog_close() 644 645 def on_AppDialog_close(self): 646 647 info = self.appD.getCurrentValues() # returns (size,color,symbol,datalabel) 648 self.appearance_selected_plot.custom_color = self._color_labels[info[1].encode('ascii','ignore')] 649 650 self.appearance_selected_plot.markersize = float(info[0]) 651 self.appearance_selected_plot.symbol = self.get_symbol_label()[info[2]] # self._symbol_labels[info[2].encode('ascii','ignore')] 652 self.appearance_selected_plot.label = str(info[3]) 653 654 pos = self.parent._window_menu.FindItem(self.window_caption) 655 helpString = 'Show/Hide Graph: ' 656 for plot in self.plots.itervalues(): 657 helpString += (' ' + str(plot.label) + ';') 658 self.parent._window_menu.SetHelpString(pos, helpString) 659 self._is_changed_legend_label = True 636 self.appD = appearanceDialog(self, 'Modify Plot Property') 637 icon = self.parent.GetIcon() 638 self.appD.SetIcon(icon) 639 self.appD.setDefaults(float(curr_size),int(curr_color),str(appearanceDialog.find_key(self.get_symbol_label(),int(curr_symbol))),curr_label) 640 self.appD.Bind(wx.EVT_CLOSE, self.on_AppDialog_close) 641 642 def on_AppDialog_close(self,e): 643 if(self.appD.okay_clicked == True): 644 info = self.appD.getCurrentValues() # returns (size,color,symbol,datalabel) 645 self.appearance_selected_plot.custom_color = self._color_labels[info[1].encode('ascii','ignore')] 646 647 self.appearance_selected_plot.markersize = float(info[0]) 648 self.appearance_selected_plot.symbol = self.get_symbol_label()[info[2]] # self._symbol_labels[info[2].encode('ascii','ignore')] 649 self.appearance_selected_plot.label = str(info[3]) 650 651 pos = self.parent._window_menu.FindItem(self.window_caption) 652 helpString = 'Show/Hide Graph: ' 653 for plot in self.plots.itervalues(): 654 helpString += (' ' + str(plot.label) +';') 655 self.parent._window_menu.SetHelpString(pos, helpString) 656 self._is_changed_legend_label = True 660 657 661 658 self.appD.Destroy() … … 664 661 665 662 def modifyGraphAppearance(self,e): 666 self.graphApp = graphAppearance(self,'Modify graph appearance') 667 663 self.graphApp = graphAppearance(self,'Modify Graph Appearance') 664 icon = self.parent.GetIcon() 665 self.graphApp.SetIcon(icon) 668 666 669 667 … … 674 672 find_key(self.get_loc_label(),self.legendLoc), 675 673 self.xcolor,self.ycolor) 676 if self.graphApp.ShowModal() == wx.ID_OK: 677 self.on_graphApp_close() 674 self.graphApp.Bind(wx.EVT_CLOSE, self.on_graphApp_close) 678 675 679 676 680 def on_graphApp_close(self ):677 def on_graphApp_close(self, event): 681 678 """ 682 679 Gets values from graph appearance dialog and sends them off -
sansguiframe/src/sans/guiframe/local_perspectives/plotting/appearanceDialog.py
r3fdb68a r9f51c2c 7 7 8 8 /** 9 10 11 12 9 This software was developed by Institut Laue-Langevin as part of 10 Distributed Data Analysis of Neutron Scattering Experiments (DANSE). 11 12 Copyright 2012 Institut Laue-Langevin 13 13 14 14 **/ … … 24 24 25 25 26 class appearanceDialog(wx. Dialog):26 class appearanceDialog(wx.Frame): 27 27 28 28 def __init__(self,parent,title): 29 super(appearanceDialog,self).__init__(parent, title=title, 30 size=(570, 430)) 31 32 self.symbolLabels = self.get_symbol_label() 33 self.colorLabels = self.get_color_label() 29 super(appearanceDialog,self).__init__(parent, title=title,size=(570,450), style=wx.DEFAULT_FRAME_STYLE|wx.FRAME_FLOAT_ON_PARENT) 30 31 self.okay_clicked = False 32 self.parent = parent 33 self.symbolLabels = self.parent.get_symbol_label() 34 self.colorLabels = self.parent.get_color_label() 34 35 35 36 … … 64 65 symbolText = wx.StaticText(panel, label='Shape') 65 66 colorText = wx.StaticText(panel, label='Color') 66 sizeText = wx.StaticText(panel, label='Size ')67 sizeText = wx.StaticText(panel, label='Size ') 67 68 labelText = wx.StaticText(panel, label='Legend label') 68 69 … … 77 78 78 79 # buttons 79 OkButton = wx.Button(panel, wx.ID_OK, label='OK') 80 OkButton = wx.Button(panel, label='OK') 81 OkButton.Bind(wx.EVT_BUTTON,self.onOK) 80 82 cancelButton = wx.Button(panel, label='Cancel') 81 83 cancelButton.Bind(wx.EVT_BUTTON, self.CloseDlg) … … 86 88 87 89 ihbox1.Add(sizeText, flag = wx.ALL| wx.ALIGN_LEFT , border=10) 88 ihbox1.Add(self.sizeComboBox, flag = wx.ALL | wx.ALIGN_LEFT , border=10)90 ihbox1.Add(self.sizeComboBox, flag = wx.ALL|wx.RIGHT | wx.ALIGN_LEFT , border=10) 89 91 ihbox1.Add(self.sizeCustomButton, flag = wx.ALIGN_LEFT | wx.ALL, border=10) 90 92 … … 94 96 95 97 96 ivbox2.Add(ihbox1, flag = wx.ALL | wx.ALIGN_RIGHT,border=10)97 ivbox2.Add(ihbox2, flag = wx.ALL | wx.ALIGN_RIGHT,border=10)98 ivbox2.Add(ihbox1, flag =wx.ALIGN_LEFT,border=10) 99 ivbox2.Add(ihbox2, flag =wx.ALIGN_LEFT,border=10) 98 100 99 101 100 hbox1.Add(ivbox1,flag = wx.EXPAND |wx.ALIGN_LEFT ,border=10)101 hbox1.Add(ivbox2,flag = wx.EXPAND | wx.ALIGN_RIGHT ,border=10)102 hbox1.Add(ivbox1,flag =wx.ALIGN_LEFT ,border=10) 103 hbox1.Add(ivbox2,flag =wx.ALIGN_LEFT ,border=10) 102 104 103 105 … … 105 107 hbox2.Add(cancelButton, flag = wx.ALL | wx.ALIGN_RIGHT, border=10) 106 108 107 hbox3.Add(labelText, flag= wx.EXPAND | wx. ALL| wx.ALIGN_LEFT, border=10)108 hbox3.Add(self.labelTextBox, wx.EXPAND | wx. ALL|wx.ALIGN_LEFT , border=10)109 hbox3.Add(labelText, flag= wx.EXPAND | wx.RIGHT | wx.ALIGN_LEFT, border=10) 110 hbox3.Add(self.labelTextBox, wx.EXPAND | wx.RIGHT |wx.ALIGN_LEFT , border=10) 109 111 110 112 symbolStaticBoxSizer.Add(hbox1,flag = wx.ALL | wx.EXPAND,border=10) … … 154 156 self.sizeComboBox.SetSelection(4) 155 157 self.symbolListBox.SetSelection(self.sorted_sym_dic[symbol]) 156 colorname = appearanceDialog.find_key(self. get_color_label(),color)158 colorname = appearanceDialog.find_key(self.parent.get_color_label(),color) 157 159 self.colorListBox.SetStringSelection(colorname) 158 160 … … 170 172 171 173 for color in sortedcolorLabels: 172 self.colorListBox.Append(str(color[0]))174 self.colorListBox.Append(str(color[0])) 173 175 174 176 def populateSize(self): … … 258 260 return(size,color,symbol,name) 259 261 262 def onOK(self,e): 263 self.okay_clicked = True 264 265 self.Close() -
sansguiframe/src/sans/guiframe/local_perspectives/plotting/graphAppearance.py
r3fdb68a r9f51c2c 7 7 8 8 /** 9 10 11 12 9 This software was developed by Institut Laue-Langevin as part of 10 Distributed Data Analysis of Neutron Scattering Experiments (DANSE). 11 12 Copyright 2012 Institut Laue-Langevin 13 13 14 14 **/ … … 23 23 24 24 25 class graphAppearance(wx. Dialog):25 class graphAppearance(wx.Frame): 26 26 27 27 def __init__(self, parent, title, legend=True): … … 105 105 106 106 self.cancel_button = wx.Button(panel, label='Cancel') 107 self.ok_button = wx.Button(panel, wx.ID_OK,label='OK')107 self.ok_button = wx.Button(panel, label='OK') 108 108 109 109 self.cancel_button.Bind(wx.EVT_BUTTON, self.onCancel) 110 self.ok_button.Bind(wx.EVT_BUTTON, self.on_ok) 110 111 111 112 … … 180 181 if(fonty.ShowModal() == wx.ID_OK): 181 182 self.yfont = fonty.get_font() 183 184 def on_ok(self, e): 185 self.Close() 182 186 183 187 def onCancel(self, e):
Note: See TracChangeset
for help on using the changeset viewer.