Changeset 8a687cfd in sasview for sansguiframe/src/sans/guiframe/local_perspectives/plotting/graphAppearance.py
- Timestamp:
- Jul 5, 2012 2:26:59 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:
- 7c755888
- Parents:
- 8f59e95
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansguiframe/src/sans/guiframe/local_perspectives/plotting/graphAppearance.py
r8f59e95 r8a687cfd 26 26 class graphAppearance(wx.Frame): 27 27 28 def __init__(self,parent,title ):28 def __init__(self,parent,title,legend=True): 29 29 super(graphAppearance,self).__init__(parent, title=title,size=(520,435)) 30 31 self.legend = legend 30 32 31 33 self.InitUI() … … 51 53 52 54 53 legendLocText = wx.StaticText(panel, label='Legend location: ') 54 self.legendLocCombo = wx.ComboBox(panel,style = wx.CB_READONLY, size=(180,-1)) 55 self.fillLegendLocs() 56 57 self.toggleLegend = wx.CheckBox(panel, label='Toggle legend on/off') 55 56 if self.legend: 57 legendLocText = wx.StaticText(panel, label='Legend location: ') 58 self.legendLocCombo = wx.ComboBox(panel,style = wx.CB_READONLY, size=(180,-1)) 59 self.fillLegendLocs() 60 else: 61 self.legendLocCombo = None 62 63 64 if self.legend: 65 self.toggleLegend = wx.CheckBox(panel, label='Toggle legend on/off') 66 else: 67 self.toggleLegend = None 68 58 69 self.toggleGrid = wx.CheckBox(panel, label='Toggle grid on/off') 59 70 … … 119 130 yhbox2.Add(yfontButton,flag=wx.ALL | wx.ALIGN_RIGHT, border=5) 120 131 121 122 hbox1.Add(legendLocText, flag = wx.ALL | wx.EXPAND | wx.ALIGN_LEFT, border=5) 123 hbox1.Add(self.legendLocCombo, flag = wx.ALL | wx.EXPAND | wx.ALIGN_LEFT, border=5) 124 hbox1.Add((5,-1)) 125 hbox1.Add(self.toggleLegend, flag = wx.ALL | wx.EXPAND | wx.ALIGN_LEFT, border=5) 132 if self.legend: 133 hbox1.Add(legendLocText, flag = wx.ALL | wx.EXPAND | wx.ALIGN_LEFT, border=5) 134 hbox1.Add(self.legendLocCombo, flag = wx.ALL | wx.EXPAND | wx.ALIGN_LEFT, border=5) 135 136 if self.legend: 137 hbox1.Add((5,-1)) 138 hbox1.Add(self.toggleLegend, flag = wx.ALL | wx.EXPAND | wx.ALIGN_LEFT, border=5) 126 139 127 140 hbox2.Add(self.okButton, flag = wx.ALL | wx.ALIGN_RIGHT, border=5) … … 223 236 xcolor,ycolor): 224 237 self.toggleGrid.SetValue(grid) 225 self.toggleLegend.SetValue(legend) 238 if self.legend: 239 self.toggleLegend.SetValue(legend) 226 240 self.xaxisText.SetValue(xlab) 227 241 self.yaxisText.SetValue(ylab) … … 242 256 243 257 244 245 self.legendLocCombo.SetStringSelection(legend_loc) 246 247 248 def getAppInfo(self): 249 grid_on = self.toggleGrid.GetValue() 250 legend_on = self.toggleLegend.GetValue() 251 xlab = self.xaxisText.GetValue() 252 ylab = self.yaxisText.GetValue() 253 xunit = self.xaxisUnitText.GetValue() 254 yunit = self.yaxisUnitText.GetValue() 255 legend_loc = self.get_loc_label()[self.legendLocCombo.GetStringSelection()] 256 xcolor = self.xfontColor.GetValue() 257 ycolor = self.yfontColor.GetValue() 258 259 260 return [grid_on,legend_on,xlab,ylab,xunit,yunit, 261 self.xfont,self.yfont, 262 xcolor,ycolor,legend_loc] 263 264 258 if self.legend: 259 self.legendLocCombo.SetStringSelection(legend_loc) 260 261 262 # get whether grid is toggled on/off 263 def get_togglegrid(self): 264 return self.toggleGrid.GetValue() 265 266 # get whether legend is toggled on/off 267 def get_togglelegend(self): 268 return self.toggleLegend.GetValue() 269 270 # get x label 271 def get_xlab(self): 272 return self.xaxisText.GetValue() 273 274 # get y label 275 def get_ylab(self): 276 return self.yaxisText.GetValue() 277 278 # get x unit 279 def get_xunit(self): 280 return self.xaxisUnitText.GetValue() 281 282 # get y unit 283 def get_yunit(self): 284 return self.yaxisUnitText.GetValue() 285 286 # get legend location 287 def get_legend_loc(self): 288 return self.get_loc_label()[self.legendLocCombo.GetStringSelection()] 289 290 # get x axis label color 291 def get_xcolor(self): 292 return self.xfontColor.GetValue() 293 294 # get y axis label color 295 def get_ycolor(self): 296 return self.yfontColor.GetValue() 297 298 # get x axis font (type is FontProperties) 299 def get_xfont(self): 300 return self.xfont 301 302 # get y axis font 303 def get_yfont(self): 304 return self.yfont 305 265 306 266 307 if __name__ == '__main__':
Note: See TracChangeset
for help on using the changeset viewer.