Changeset 3fdb68a in sasview for sansguiframe
- Timestamp:
- Aug 9, 2012 5:33:31 AM (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:
- 96277b9
- Parents:
- 443b1b8
- Location:
- sansguiframe/src/sans/guiframe/local_perspectives/plotting
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sansguiframe/src/sans/guiframe/local_perspectives/plotting/Plotter1D.py
r83d9120 r3fdb68a 634 634 curr_symbol = 13 635 635 636 self.appD = appearanceDialog(self,'Modify plot properties') 637 self.appD.setDefaults(float(curr_size),int(curr_color),str(appearanceDialog.find_key(self.get_symbol_label(),int(curr_symbol))),curr_label) 638 self.appD.Bind(wx.EVT_CLOSE, self.on_AppDialog_close) 639 640 def on_AppDialog_close(self,e): 641 if(self.appD.okay_clicked == True): 642 info = self.appD.getCurrentValues() # returns (size,color,symbol,datalabel) 643 self.appearance_selected_plot.custom_color = self._color_labels[info[1].encode('ascii','ignore')] 644 645 self.appearance_selected_plot.markersize = float(info[0]) 646 self.appearance_selected_plot.symbol = self.get_symbol_label()[info[2]] # self._symbol_labels[info[2].encode('ascii','ignore')] 647 self.appearance_selected_plot.label = str(info[3]) 648 649 pos = self.parent._window_menu.FindItem(self.window_caption) 650 helpString = 'Show/Hide Graph: ' 651 for plot in self.plots.itervalues(): 652 helpString += (' ' + str(plot.label) +';') 653 self.parent._window_menu.SetHelpString(pos, helpString) 654 self._is_changed_legend_label = True 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 655 660 656 661 self.appD.Destroy() … … 669 674 find_key(self.get_loc_label(),self.legendLoc), 670 675 self.xcolor,self.ycolor) 671 self.graphApp.Bind(wx.EVT_CLOSE, self.on_graphApp_close) 676 if self.graphApp.ShowModal() == wx.ID_OK: 677 self.on_graphApp_close() 672 678 673 679 674 def on_graphApp_close(self , event):680 def on_graphApp_close(self): 675 681 """ 676 682 Gets values from graph appearance dialog and sends them off -
sansguiframe/src/sans/guiframe/local_perspectives/plotting/appearanceDialog.py
r6c4130a r3fdb68a 24 24 25 25 26 class appearanceDialog(wx. Frame):26 class appearanceDialog(wx.Dialog): 27 27 28 28 def __init__(self,parent,title): 29 super(appearanceDialog,self).__init__(parent, title=title,size=(570,430)) 30 31 self.okay_clicked = False 29 super(appearanceDialog,self).__init__(parent, title=title, 30 size=(570, 430)) 32 31 33 32 self.symbolLabels = self.get_symbol_label() … … 78 77 79 78 # buttons 80 OkButton = wx.Button(panel, label='OK') 81 OkButton.Bind(wx.EVT_BUTTON,self.onOK) 79 OkButton = wx.Button(panel, wx.ID_OK, label='OK') 82 80 cancelButton = wx.Button(panel, label='Cancel') 83 81 cancelButton.Bind(wx.EVT_BUTTON, self.CloseDlg) … … 172 170 173 171 for color in sortedcolorLabels: 174 172 self.colorListBox.Append(str(color[0])) 175 173 176 174 def populateSize(self): … … 260 258 return(size,color,symbol,name) 261 259 262 def onOK(self,e):263 self.okay_clicked = True264 265 self.Close() -
sansguiframe/src/sans/guiframe/local_perspectives/plotting/graphAppearance.py
r67fb83b r3fdb68a 23 23 24 24 25 class graphAppearance(wx. Frame):25 class graphAppearance(wx.Dialog): 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, label='OK')107 self.ok_button = wx.Button(panel, wx.ID_OK, 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)111 110 112 111 … … 181 180 if(fonty.ShowModal() == wx.ID_OK): 182 181 self.yfont = fonty.get_font() 183 184 def on_ok(self, e):185 self.Close()186 182 187 183 def onCancel(self, e):
Note: See TracChangeset
for help on using the changeset viewer.