Changeset 2f4b430 in sasview for src/sas/perspectives/fitting/simfitpage.py
- Timestamp:
- Mar 4, 2015 3:39:45 PM (10 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:
- 74f419d
- Parents:
- 2f732b0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/perspectives/fitting/simfitpage.py
r386ffe1 r2f4b430 2 2 Simultaneous fit page 3 3 """ 4 import sys, re,string, wx4 import sys, re, string, wx 5 5 import wx.lib.newevent 6 from sas.guiframe.events import StatusEvent 6 from sas.guiframe.events import StatusEvent 7 7 from sas.guiframe.panel_base import PanelBase 8 8 from wx.lib.scrolledpanel import ScrolledPanel … … 15 15 PANEL_WID = 490 16 16 FONT_VARIANT = 1 17 18 17 18 19 19 def get_fittableParam(model): 20 20 """ 21 21 return list of fittable parameters name of a model 22 22 23 23 :param model: the model used 24 24 25 25 """ 26 26 fittable_param = [] … … 29 29 if not item in model.non_fittable: 30 30 fittable_param.append(item) 31 31 32 32 for item in model.fixed: 33 33 fittable_param.append(item) 34 34 35 35 return fittable_param 36 36 … … 46 46 ## Title to appear on top of the window 47 47 window_caption = "Simultaneous Fit Page" 48 49 def __init__(self, parent, page_finder={}, id= -1, batch_on=False,48 49 def __init__(self, parent, page_finder={}, id= -1, batch_on=False, 50 50 *args, **kwargs): 51 51 ScrolledPanel.__init__(self, parent, id=id, … … 84 84 self.set_layout() 85 85 self._set_save_flag(False) 86 86 87 87 def define_page_structure(self): 88 88 """ … … 100 100 self.vbox.Add(self.sizer2) 101 101 self.vbox.Add(self.sizer3) 102 102 103 103 def set_scroll(self): 104 104 """ 105 105 """ 106 106 self.Layout() 107 107 108 108 def set_layout(self): 109 109 """ … … 115 115 self.set_scroll() 116 116 self.Centre() 117 117 118 118 def onRemove(self, event): 119 119 """ … … 140 140 141 141 #self._onAdd_constraint(None) 142 142 143 143 def onFit(self, event): 144 144 """ 145 145 signal for fitting 146 146 147 147 """ 148 148 flag = False … … 161 161 for item in self.model_list: 162 162 if item[0].GetValue(): 163 self.manager.schedule_for_fit(value=1, uid=item[2]) 163 self.manager.schedule_for_fit(value=1, uid=item[2]) 164 164 try: 165 165 if not self.manager.onFit(uid=self.uid): … … 171 171 msg = "Select at least one model check box to fit " 172 172 wx.PostEvent(self.parent.parent, StatusEvent(status=msg)) 173 173 174 174 def set_manager(self, manager): 175 175 """ 176 176 set panel manager 177 177 178 178 :param manager: instance of plugin fitting 179 179 180 180 """ 181 181 self.manager = manager 182 182 183 183 def check_all_model_name(self, event=None): 184 184 """ … … 191 191 item[0].SetValue(True) 192 192 self.model_toFit.append(item) 193 193 194 194 ## constraint info 195 195 self._store_model() … … 198 198 if self.show_constraint.GetValue() and\ 199 199 len(self.constraints_list) == 0: 200 self._show_all_constraint() 200 self._show_all_constraint() 201 201 self._show_constraint() 202 202 else: 203 203 for item in self.model_list: 204 item[0].SetValue(False) 205 204 item[0].SetValue(False) 205 206 206 self.model_toFit = [] 207 207 if not self.batch_on: 208 208 ##constraint info 209 209 self._hide_constraint() 210 210 211 211 self._update_easy_setup_cb() 212 212 self.Layout() 213 213 self.Refresh() 214 214 215 215 def check_model_name(self, event): 216 216 """ … … 226 226 self.model_toFit.remove(item) 227 227 self.cb1.SetValue(False) 228 228 229 229 ## display constraint fields 230 230 if len(self.model_toFit) >= 1: … … 238 238 ##constraint info 239 239 self._hide_constraint() 240 240 241 241 self._update_easy_setup_cb() 242 242 ## set the value of the main check button … … 248 248 self.cb1.SetValue(False) 249 249 self.Layout() 250 250 251 251 def _update_easy_setup_cb(self): 252 252 """ … … 276 276 self.sizer2.Layout() 277 277 self.sizer3.Layout() 278 278 279 279 def draw_page(self): 280 280 """ 281 Draw a sizer containing couples of data and model 281 Draw a sizer containing couples of data and model 282 282 """ 283 283 self.model_list = [] … … 288 288 self.model_cbox_left = None 289 289 self.model_cbox_right = None 290 290 291 291 if len(self.model_list) > 0: 292 292 for item in self.model_list: 293 293 item[0].SetValue(False) 294 294 self.manager.schedule_for_fit(value=0, uid=item[2]) 295 295 296 296 self.sizer1.Clear(True) 297 297 box_description = wx.StaticBox(self, -1, "Fit Combinations") … … 308 308 ## store model 309 309 self._store_model() 310 310 311 311 self.cb1 = wx.CheckBox(self, -1, 'Select all') 312 312 self.cb1.SetValue(False) 313 313 314 314 wx.EVT_CHECKBOX(self, self.cb1.GetId(), self.check_all_model_name) 315 315 316 316 sizer_title.Add((10, 10), 0, 317 wx.TOP |wx.BOTTOM|wx.EXPAND|wx.ADJUST_MINSIZE, border=5)317 wx.TOP | wx.BOTTOM | wx.EXPAND | wx.ADJUST_MINSIZE, border=5) 318 318 sizer_title.Add(self.cb1, 0, 319 wx.TOP |wx.BOTTOM|wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, border=5)320 319 wx.TOP | wx.BOTTOM | wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, border=5) 320 321 321 ## draw list of model and data name 322 322 self._fill_sizer_model_list(sizer_couples) … … 327 327 self._fill_sizer_fit() 328 328 #-------------------------------------------------------- 329 boxsizer1.Add(sizer_title, flag = wx.TOP|wx.BOTTOM, border=5)330 boxsizer1.Add(sizer_couples, 1, flag = wx.TOP|wx.BOTTOM, border=5)331 329 boxsizer1.Add(sizer_title, flag=wx.TOP | wx.BOTTOM, border=5) 330 boxsizer1.Add(sizer_couples, 1, flag=wx.TOP | wx.BOTTOM, border=5) 331 332 332 self.sizer1.Add(boxsizer1, 1, wx.EXPAND | wx.ALL, 10) 333 333 self.sizer1.Layout() … … 335 335 self.AdjustScrollbars() 336 336 self.Layout() 337 337 338 338 def _store_model(self): 339 339 """ … … 346 346 page_id = item[2] 347 347 self.constraint_dict[page_id] = model 348 348 349 349 def _display_constraint(self, event): 350 350 """ … … 366 366 self.Layout() 367 367 return 368 368 369 369 def _show_all_constraint(self): 370 370 """ 371 371 Show constraint fields 372 372 """ 373 box_description = wx.StaticBox(self, -1, "Easy Setup ")374 boxsizer = wx.StaticBoxSizer(box_description, wx.HORIZONTAL) 373 box_description = wx.StaticBox(self, -1, "Easy Setup ") 374 boxsizer = wx.StaticBoxSizer(box_description, wx.HORIZONTAL) 375 375 sizer_constraint = wx.BoxSizer(wx.HORIZONTAL) 376 376 self.model_cbox_left = wx.ComboBox(self, -1, style=wx.CB_READONLY) … … 388 388 self.set_button.SetToolTipString(set_tip) 389 389 self.set_button.Disable() 390 390 391 391 for id, model in self.constraint_dict.iteritems(): 392 392 ## check if all parameters have been selected for constraint … … 399 399 self.model_cbox_right.Append(str(model.name), model) 400 400 boxsizer.Add(self.model_cbox_left, 401 flag=wx.RIGHT |wx.EXPAND, border=10)401 flag=wx.RIGHT | wx.EXPAND, border=10) 402 402 boxsizer.Add(wx.StaticText(self, -1, ".parameters"), 403 flag=wx.RIGHT |wx.EXPAND, border=5)404 boxsizer.Add(egal_txt, flag= wx.RIGHT|wx.EXPAND, border=5)403 flag=wx.RIGHT | wx.EXPAND, border=5) 404 boxsizer.Add(egal_txt, flag=wx.RIGHT | wx.EXPAND, border=5) 405 405 boxsizer.Add(self.model_cbox_right, 406 flag=wx.RIGHT |wx.EXPAND, border=10)406 flag=wx.RIGHT | wx.EXPAND, border=10) 407 407 boxsizer.Add(wx.StaticText(self, -1, ".parameters"), 408 flag=wx.RIGHT |wx.EXPAND,border=5)408 flag=wx.RIGHT | wx.EXPAND, border=5) 409 409 boxsizer.Add((20, -1)) 410 boxsizer.Add(self.set_button, flag=wx.RIGHT |wx.EXPAND, border=5)411 sizer_constraint.Add(boxsizer, flag=wx.RIGHT |wx.EXPAND, border=5)410 boxsizer.Add(self.set_button, flag=wx.RIGHT | wx.EXPAND, border=5) 411 sizer_constraint.Add(boxsizer, flag=wx.RIGHT | wx.EXPAND, border=5) 412 412 self.sizer_all_constraints.Insert(before=0, 413 413 item=sizer_constraint, 414 flag=wx.TOP |wx.BOTTOM|wx.EXPAND, border=5)414 flag=wx.TOP | wx.BOTTOM | wx.EXPAND, border=5) 415 415 416 416 self.sizer_all_constraints.Layout() 417 417 self.sizer2.Layout() 418 418 #self.SetScrollbars(20,20,25,65) 419 419 420 420 def _on_select_modelcb(self, event): 421 421 """ … … 428 428 if self.model_cbox_right.GetValue().strip() == '': 429 429 flag = False 430 if self.model_cbox_left.GetValue() == \430 if self.model_cbox_left.GetValue() == \ 431 431 self.model_cbox_right.GetValue(): 432 432 flag = False 433 433 self.set_button.Enable(flag) 434 434 435 435 def _on_set_all_equal(self, event): 436 436 """ … … 471 471 break 472 472 self._show_constraint() 473 473 474 474 self.sizer_constraints.Layout() 475 475 self.sizer2.Layout() … … 509 509 self.sizer2.Layout() 510 510 return 511 511 512 512 sizer_constraint = wx.BoxSizer(wx.HORIZONTAL) 513 513 model_cbox = wx.ComboBox(self, -1, style=wx.CB_READONLY) 514 514 model_cbox.Clear() 515 param_cbox = wx.ComboBox(self, -1, style=wx.CB_READONLY, size=(100, -1),)515 param_cbox = wx.ComboBox(self, -1, style=wx.CB_READONLY, size=(100, -1),) 516 516 param_cbox.Hide() 517 517 518 518 #This is for GetCLientData() _on_select_param: Was None return on MAC. 519 519 self.param_cbox = param_cbox 520 521 wx.EVT_COMBOBOX(param_cbox, -1, self._on_select_param)520 521 wx.EVT_COMBOBOX(param_cbox, -1, self._on_select_param) 522 522 self.ctl2 = wx.TextCtrl(self, -1) 523 523 egal_txt = wx.StaticText(self, -1, " = ") 524 self.btRemove = wx.Button(self, wx.NewId(),'Remove')525 self.btRemove.Bind(wx.EVT_BUTTON, self.onRemove, 524 self.btRemove = wx.Button(self, wx.NewId(), 'Remove') 525 self.btRemove.Bind(wx.EVT_BUTTON, self.onRemove, 526 526 id=self.btRemove.GetId()) 527 527 self.btRemove.SetToolTipString("Remove constraint.") … … 533 533 ## then do not allow add constraint on parameters 534 534 model_cbox.Append(str(model.name), model) 535 535 536 536 #This is for GetCLientData() passing to self._on_select_param: Was None return on MAC. 537 537 self.model_cbox = model_cbox 538 538 539 539 wx.EVT_COMBOBOX(model_cbox, -1, self._on_select_model) 540 540 sizer_constraint.Add((5, -1)) 541 sizer_constraint.Add(model_cbox, flag=wx.RIGHT |wx.EXPAND, border=10)542 sizer_constraint.Add(param_cbox, flag=wx.RIGHT |wx.EXPAND, border=5)543 sizer_constraint.Add(egal_txt, flag=wx.RIGHT |wx.EXPAND, border=5)544 sizer_constraint.Add(self.ctl2, flag=wx.RIGHT |wx.EXPAND, border=10)545 sizer_constraint.Add(self.btRemove, flag=wx.RIGHT |wx.EXPAND, border=10)546 541 sizer_constraint.Add(model_cbox, flag=wx.RIGHT | wx.EXPAND, border=10) 542 sizer_constraint.Add(param_cbox, flag=wx.RIGHT | wx.EXPAND, border=5) 543 sizer_constraint.Add(egal_txt, flag=wx.RIGHT | wx.EXPAND, border=5) 544 sizer_constraint.Add(self.ctl2, flag=wx.RIGHT | wx.EXPAND, border=10) 545 sizer_constraint.Add(self.btRemove, flag=wx.RIGHT | wx.EXPAND, border=10) 546 547 547 self.sizer_constraints.Insert(before=self.nb_constraint, 548 item=sizer_constraint, flag=wx.TOP |wx.BOTTOM|wx.EXPAND,548 item=sizer_constraint, flag=wx.TOP | wx.BOTTOM | wx.EXPAND, 549 549 border=5) 550 550 self.constraints_list.append([model_cbox, param_cbox, egal_txt, 551 551 self.ctl2, self.btRemove, sizer_constraint]) 552 552 553 553 self.nb_constraint += 1 554 554 self.sizer_constraints.Layout() 555 555 self.sizer2.Layout() 556 556 557 557 def _hide_constraint(self): 558 558 """ … … 561 561 for id in self.page_finder.iterkeys(): 562 562 self.page_finder[id].clear_model_param() 563 563 564 564 self.nb_constraint = 0 565 565 self.constraint_dict = {} … … 585 585 self.sizer_constraints.Layout() 586 586 self.sizer2.Layout() 587 587 588 588 def _on_select_model(self, event): 589 589 """ … … 611 611 self.btAdd.Show(True) 612 612 self.sizer2.Layout() 613 613 614 614 def _on_select_param(self, event): 615 615 """ … … 620 620 #model = self.param_cbox.GetClientData(n) 621 621 #param = event.GetString() 622 622 623 623 length = len(self.constraints_list) 624 624 if length < 1: … … 626 626 egal_txt = self.constraints_list[length - 1][2] 627 627 egal_txt.Show(True) 628 628 629 629 ctl2 = self.constraints_list[length - 1][3] 630 630 ctl2.Show(True) 631 631 632 632 def _onAdd_constraint(self, event): 633 633 """ … … 645 645 msg = " Select a model Name! " 646 646 wx.PostEvent(self.parent.parent, StatusEvent(status=msg)) 647 return 647 return 648 648 param_cbox = item[1] 649 649 if param_cbox.GetString(0) == "": 650 650 msg = " Select a parameter Name! " 651 651 wx.PostEvent(self.parent.parent, StatusEvent(status=msg)) 652 return 652 return 653 653 ctl2 = item[3] 654 654 if ctl2.GetValue().lstrip().rstrip() == "": … … 656 656 param_cbox.GetCurrentSelection()) 657 657 if model != None: 658 msg = " Enter a constraint for %s.%s! " %(model.name,658 msg = " Enter a constraint for %s.%s! " % (model.name, 659 659 param_cbox.GetString(0)) 660 660 else: … … 667 667 self.Layout() 668 668 self.Refresh() 669 669 670 670 def _fill_sizer_fit(self): 671 671 """ … … 673 673 """ 674 674 self.sizer3.Clear(True) 675 box_description = wx.StaticBox(self, -1, "Fit ")675 box_description = wx.StaticBox(self, -1, "Fit ") 676 676 boxsizer1 = wx.StaticBoxSizer(box_description, wx.VERTICAL) 677 677 sizer_button = wx.BoxSizer(wx.HORIZONTAL) 678 678 679 679 self.btFit = wx.Button(self, wx.NewId(), 'Fit', size=wx.DefaultSize) 680 680 self.btFit.Bind(wx.EVT_BUTTON, self.onFit, id=self.btFit.GetId()) … … 686 686 text = " and a model for fitting." 687 687 text_hint = wx.StaticText(self, -1, text) 688 689 sizer_button.Add(text_hint, wx.RIGHT |wx.EXPAND, 10)690 sizer_button.Add(self.btFit, 0, wx.LEFT |wx.ADJUST_MINSIZE, 10)691 692 boxsizer1.Add(sizer_button, flag= wx.TOP|wx.BOTTOM,border=10)688 689 sizer_button.Add(text_hint, wx.RIGHT | wx.EXPAND, 10) 690 sizer_button.Add(self.btFit, 0, wx.LEFT | wx.ADJUST_MINSIZE, 10) 691 692 boxsizer1.Add(sizer_button, flag=wx.TOP | wx.BOTTOM, border=10) 693 693 self.sizer3.Add(boxsizer1, 0, wx.EXPAND | wx.ALL, 10) 694 694 self.sizer3.Layout() 695 695 696 696 def _fill_sizer_constraint(self): 697 697 """ … … 700 700 msg = "Select at least 2 model to add constraint " 701 701 wx.PostEvent(self.parent.parent, StatusEvent(status=msg)) 702 702 703 703 self.sizer2.Clear(True) 704 704 if self.batch_on: … … 706 706 self.sizer2.Show(False) 707 707 return 708 box_description = wx.StaticBox(self, -1, "Fit Constraints")708 box_description = wx.StaticBox(self, -1, "Fit Constraints") 709 709 boxsizer1 = wx.StaticBoxSizer(box_description, wx.VERTICAL) 710 710 sizer_title = wx.BoxSizer(wx.HORIZONTAL) … … 712 712 self.sizer_constraints = wx.BoxSizer(wx.VERTICAL) 713 713 sizer_button = wx.BoxSizer(wx.HORIZONTAL) 714 714 715 715 self.hide_constraint = wx.RadioButton(self, -1, 'No', (10, 10), 716 716 style=wx.RB_GROUP) … … 725 725 self.hide_constraint.SetValue(True) 726 726 self.show_constraint.SetValue(False) 727 727 728 728 sizer_title.Add(wx.StaticText(self, -1, " Model")) 729 729 sizer_title.Add((10, 10)) 730 730 sizer_title.Add(wx.StaticText(self, -1, " Parameter")) 731 731 sizer_title.Add((10, 10)) 732 sizer_title.Add( wx.StaticText(self,-1," Add Constraint?"))732 sizer_title.Add(wx.StaticText(self, -1, " Add Constraint?")) 733 733 sizer_title.Add((10, 10)) 734 734 sizer_title.Add(self.show_constraint) 735 735 sizer_title.Add(self.hide_constraint) 736 736 sizer_title.Add((10, 10)) 737 737 738 738 self.btAdd = wx.Button(self, wx.NewId(), 'Add') 739 739 self.btAdd.Bind(wx.EVT_BUTTON, self._onAdd_constraint, … … 741 741 self.btAdd.SetToolTipString("Add another constraint?") 742 742 self.btAdd.Hide() 743 743 744 744 text_hint = wx.StaticText(self, -1, 745 745 "Example: [M0][paramter] = M1.parameter") 746 sizer_button.Add(text_hint, 0 , wx.LEFT |wx.EXPAND|wx.ADJUST_MINSIZE, 10)747 sizer_button.Add(self.btAdd, 0, wx.LEFT |wx.EXPAND|wx.ADJUST_MINSIZE, 10)748 749 boxsizer1.Add(sizer_title, flag=wx.TOP |wx.BOTTOM,border=10)750 boxsizer1.Add(self.sizer_all_constraints, flag=wx.TOP |wx.BOTTOM,746 sizer_button.Add(text_hint, 0 , wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 10) 747 sizer_button.Add(self.btAdd, 0, wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 10) 748 749 boxsizer1.Add(sizer_title, flag=wx.TOP | wx.BOTTOM, border=10) 750 boxsizer1.Add(self.sizer_all_constraints, flag=wx.TOP | wx.BOTTOM, 751 751 border=10) 752 boxsizer1.Add(self.sizer_constraints, flag=wx.TOP |wx.BOTTOM,752 boxsizer1.Add(self.sizer_constraints, flag=wx.TOP | wx.BOTTOM, 753 753 border=10) 754 boxsizer1.Add(sizer_button, flag=wx.TOP |wx.BOTTOM, border=10)755 754 boxsizer1.Add(sizer_button, flag=wx.TOP | wx.BOTTOM, border=10) 755 756 756 self.sizer2.Add(boxsizer1, 0, wx.EXPAND | wx.ALL, 10) 757 757 self.sizer2.Layout() 758 758 759 759 #self.SetScrollbars(20,20,25,65) 760 760 761 761 def _set_constraint(self): 762 762 """ … … 805 805 StatusEvent(info="error", status=msg)) 806 806 return False 807 807 808 808 for fid in self.page_finder[id].iterkeys(): 809 809 # wrap in param/constraint in str() to remove unicode … … 812 812 break 813 813 return True 814 814 815 815 def _fill_sizer_model_list(self, sizer): 816 816 """ … … 821 821 list = [] 822 822 sizer.Clear(True) 823 823 824 824 new_name = wx.StaticText(self, -1, ' Model Title ', 825 825 style=wx.ALIGN_CENTER) 826 826 new_name.SetBackgroundColour('orange') 827 827 new_name.SetForegroundColour(wx.WHITE) 828 sizer.Add(new_name, (iy, ix),(1,1),829 wx.LEFT |wx.EXPAND|wx.ADJUST_MINSIZE, 15)828 sizer.Add(new_name, (iy, ix), (1, 1), 829 wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15) 830 830 ix += 2 831 831 model_type = wx.StaticText(self, -1, ' Model ') … … 833 833 model_type.SetForegroundColour(wx.WHITE) 834 834 sizer.Add(model_type, (iy, ix), (1, 1), 835 wx.EXPAND |wx.ADJUST_MINSIZE, 0)835 wx.EXPAND | wx.ADJUST_MINSIZE, 0) 836 836 ix += 1 837 837 data_used = wx.StaticText(self, -1, ' Data ') … … 839 839 data_used.SetForegroundColour(wx.WHITE) 840 840 sizer.Add(data_used, (iy, ix), (1, 1), 841 wx.EXPAND |wx.ADJUST_MINSIZE, 0)841 wx.EXPAND | wx.ADJUST_MINSIZE, 0) 842 842 ix += 1 843 843 tab_used = wx.StaticText(self, -1, ' FitPage ') … … 845 845 tab_used.SetForegroundColour(wx.WHITE) 846 846 sizer.Add(tab_used, (iy, ix), (1, 1), 847 wx.EXPAND |wx.ADJUST_MINSIZE, 0)847 wx.EXPAND | wx.ADJUST_MINSIZE, 0) 848 848 for id, value in self.page_finder.iteritems(): 849 849 if id not in self.parent.opened_pages: … … 852 852 if self.batch_on != self.parent.get_page_by_id(id).batch_on: 853 853 continue 854 854 855 855 data_list = [] 856 856 model_list = [] 857 857 # get data name and model objetta 858 858 for fitproblem in value.get_fit_problem(): 859 859 860 860 data = fitproblem.get_fit_data() 861 861 if not data.is_data: … … 865 865 name = str(data.name) 866 866 data_list.append(name) 867 867 868 868 model = fitproblem.get_model() 869 869 if model is None: 870 870 continue 871 871 model_list.append(model) 872 872 873 873 if len(model_list) == 0: 874 874 continue … … 883 883 cb.SetValue(False) 884 884 cb.Enable(model is not None and data.is_data) 885 sizer.Add(cb, (iy, ix), (1, 1), 886 wx.LEFT |wx.EXPAND|wx.ADJUST_MINSIZE, 15)885 sizer.Add(cb, (iy, ix), (1, 1), 886 wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15) 887 887 wx.EVT_CHECKBOX(self, cb.GetId(), self.check_model_name) 888 ix += 2 888 ix += 2 889 889 type = model.__class__.__name__ 890 890 model_type = wx.StaticText(self, -1, str(type)) 891 891 sizer.Add(model_type, (iy, ix), (1, 1), 892 wx.EXPAND |wx.ADJUST_MINSIZE, 0)892 wx.EXPAND | wx.ADJUST_MINSIZE, 0) 893 893 if self.batch_on: 894 894 data_used = wx.ComboBox(self, -1, style=wx.CB_READONLY) … … 897 897 else: 898 898 data_used = wx.StaticText(self, -1, data_list[0]) 899 899 900 900 ix += 1 901 901 sizer.Add(data_used, (iy, ix), (1, 1), 902 wx.EXPAND |wx.ADJUST_MINSIZE, 0)902 wx.EXPAND | wx.ADJUST_MINSIZE, 0) 903 903 ix += 1 904 904 caption = value.get_fit_tab_caption() 905 905 tab_caption_used = wx.StaticText(self, -1, str(caption)) 906 906 sizer.Add(tab_caption_used, (iy, ix), (1, 1), 907 wx.EXPAND |wx.ADJUST_MINSIZE, 0)908 907 wx.EXPAND | wx.ADJUST_MINSIZE, 0) 908 909 909 self.model_list.append([cb, value, id, model]) 910 910 911 911 iy += 1 912 912 sizer.Add((20, 20), (iy, ix), (1, 1), 913 wx.LEFT |wx.EXPAND|wx.ADJUST_MINSIZE, 15)913 wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15) 914 914 sizer.Layout() 915 915 916 916 def on_set_focus(self, event=None): 917 917 """
Note: See TracChangeset
for help on using the changeset viewer.