Changeset a5701e6 in sasview for sansview/perspectives/fitting/fitpage.py
- Timestamp:
- Mar 10, 2011 5:11:55 PM (14 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:
- c399004
- Parents:
- 7987962
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/fitpage.py
rfa65e99 ra5701e6 20 20 (Chi2UpdateEvent, EVT_CHI2_UPDATE) = wx.lib.newevent.NewEvent() 21 21 _BOX_WIDTH = 76 22 _DATA_BOX_WIDTH = 3 6622 _DATA_BOX_WIDTH = 300 23 23 SMEAR_SIZE_L = 0.005 24 24 SMEAR_SIZE_H = 0.006 … … 473 473 sizer_range.Add(wx.StaticText(self, -1, "Max: "),0, wx.LEFT, 10) 474 474 sizer_range.Add(self.maximum_q,0, wx.LEFT, 10) 475 id = wx.NewId()476 self.model_view = wx.Button(self, id,"Switch to 2D", size=(80, 23))477 self.model_view.Bind(wx.EVT_BUTTON, self._onModel2D, id=id)478 hint = "toggle view of model from 1D to 2D or 2D from 1D"479 self.model_view.SetToolTipString(hint)480 sizer_range.Add(self.model_view,0, wx.LEFT, 10)481 482 475 boxsizer1.Add(sizer_data,0, wx.ALL, 10) 483 476 boxsizer1.Add(sizer_range, 0 , wx.LEFT, 10) … … 500 493 self.model_help.Bind(wx.EVT_BUTTON, self.on_model_help_clicked,id=id) 501 494 self.model_help.SetToolTipString("Model Function Help") 502 503 ## class base method to add view 2d button 504 self._set_model_sizer(sizer=sizer, box_sizer=boxsizer1, 505 title="Model",object=self.model_help ) 495 id = wx.NewId() 496 self.model_view = wx.Button(self, id,"Switch to 2D", size=(80, 23)) 497 self.model_view.Bind(wx.EVT_BUTTON, self._onModel2D, id=id) 498 hint = "toggle view of model from 1D to 2D or 2D from 1D" 499 self.model_view.SetToolTipString(hint) 500 501 self.shape_rbutton = wx.RadioButton(self, -1, 'Shapes', style=wx.RB_GROUP) 502 self.shape_indep_rbutton = wx.RadioButton(self, -1, "Shape-Independent") 503 self.struct_rbutton = wx.RadioButton(self, -1, "Structure Factor ") 504 self.plugin_rbutton = wx.RadioButton(self, -1, "Customized Models") 505 506 self.Bind(wx.EVT_RADIOBUTTON, self._show_combox, 507 id= self.shape_rbutton.GetId()) 508 self.Bind(wx.EVT_RADIOBUTTON, self._show_combox, 509 id= self.shape_indep_rbutton.GetId()) 510 self.Bind(wx.EVT_RADIOBUTTON, self._show_combox, 511 id= self.struct_rbutton.GetId()) 512 self.Bind(wx.EVT_RADIOBUTTON, self._show_combox, 513 id= self.plugin_rbutton.GetId()) 514 #MAC needs SetValue 515 self.shape_rbutton.SetValue(True) 516 517 sizer_radiobutton = wx.GridSizer(2, 3, 5, 5) 518 sizer_radiobutton.Add(self.shape_rbutton) 519 sizer_radiobutton.Add(self.shape_indep_rbutton) 520 #sizer_radiobutton.Add((5, 5)) 521 sizer_radiobutton.Add(self.model_view,1, wx.LEFT, 20) 522 sizer_radiobutton.Add(self.plugin_rbutton) 523 sizer_radiobutton.Add(self.struct_rbutton) 524 #sizer_radiobutton.Add((5, 5)) 525 sizer_radiobutton.Add(self.model_help,1, wx.LEFT, 20) 526 527 sizer_selection = wx.BoxSizer(wx.HORIZONTAL) 528 mutifactor_selection = wx.BoxSizer(wx.HORIZONTAL) 529 530 self.text1 = wx.StaticText(self,-1,"" ) 531 self.text2 = wx.StaticText(self,-1,"P(Q)*S(Q)" ) 532 self.mutifactor_text = wx.StaticText( self,-1,"No. of Shells: ") 533 self.mutifactor_text1 = wx.StaticText( self,-1,"" ) 534 self.show_sld_button = wx.Button( self,-1,"Show SLD Profile" ) 535 self.show_sld_button.Bind(wx.EVT_BUTTON,self._on_show_sld) 536 537 self.formfactorbox = wx.ComboBox(self, -1,style=wx.CB_READONLY) 538 if self.model!= None: 539 self.formfactorbox.SetValue(self.model.name) 540 self.structurebox = wx.ComboBox(self, -1, style=wx.CB_READONLY) 541 self.multifactorbox = wx.ComboBox(self, -1, style=wx.CB_READONLY) 542 self.initialize_combox() 543 wx.EVT_COMBOBOX(self.formfactorbox, -1, self._on_select_model) 544 wx.EVT_COMBOBOX(self.structurebox, -1, self._on_select_model) 545 wx.EVT_COMBOBOX(self.multifactorbox, -1, self._on_select_model) 546 ## check model type to show sizer 547 if self.model !=None: 548 self._set_model_sizer_selection(self.model) 549 550 sizer_selection.Add(self.text1) 551 sizer_selection.Add((5, 5)) 552 sizer_selection.Add(self.formfactorbox) 553 sizer_selection.Add((5, 5)) 554 sizer_selection.Add(self.text2) 555 sizer_selection.Add((5, 5)) 556 sizer_selection.Add(self.structurebox) 557 558 mutifactor_selection.Add((10,5)) 559 mutifactor_selection.Add(self.mutifactor_text) 560 mutifactor_selection.Add(self.multifactorbox) 561 mutifactor_selection.Add((5, 5)) 562 mutifactor_selection.Add(self.mutifactor_text1) 563 mutifactor_selection.Add((10, 5)) 564 mutifactor_selection.Add(self.show_sld_button) 565 566 567 boxsizer1.Add(sizer_radiobutton) 568 boxsizer1.Add((10, 10)) 569 boxsizer1.Add(sizer_selection) 570 boxsizer1.Add((10, 10)) 571 boxsizer1.Add(mutifactor_selection) 572 573 self._set_multfactor_combobox() 574 self.multifactorbox.SetSelection(1) 575 self.show_sld_button.Hide() 576 sizer.Add(boxsizer1,0, wx.EXPAND | wx.ALL, 10) 577 sizer.Layout() 506 578 507 579 def _set_sizer_dispersion(self, dispersity): … … 1446 1518 self.enable_smearer.Enable() 1447 1519 1520 def get_view_mode(self): 1521 """ 1522 return True if the panel allow 2D or False if 1D 1523 """ 1524 return self.enable2D 1525 1448 1526 def set_data(self, data): 1449 1527 """ … … 2630 2708 self.Layout() 2631 2709 self.Refresh() 2632 self.SetupScrolling() 2633 2710 2634 2711 def _onModel2D(self, event): 2635 2712 """
Note: See TracChangeset
for help on using the changeset viewer.