Changeset 6f16e25 in sasview for src/sas/perspectives/fitting/fitpage.py
- Timestamp:
- Oct 21, 2015 8:35:00 AM (9 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:
- 85130cb
- Parents:
- 2d88fc4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/perspectives/fitting/fitpage.py
r225aca8 r6f16e25 93 93 fill sizer 0 with data info 94 94 """ 95 self.data_box_description = wx.StaticBox(self, -1, 'I(q) Data Source') 95 self.data_box_description = wx.StaticBox(self, wx.ID_ANY, 96 'I(q) Data Source') 96 97 if check_data_validity(self.data): 97 98 dname_color = wx.BLUE … … 102 103 #---------------------------------------------------------- 103 104 sizer_data = wx.BoxSizer(wx.HORIZONTAL) 104 self.dataSource = wx.ComboBox(self, -1, style=wx.CB_READONLY)105 wx.EVT_COMBOBOX(self.dataSource, -1, self.on_select_data)105 self.dataSource = wx.ComboBox(self, wx.ID_ANY, style=wx.CB_READONLY) 106 wx.EVT_COMBOBOX(self.dataSource, wx.ID_ANY, self.on_select_data) 106 107 self.dataSource.SetMinSize((_DATA_BOX_WIDTH, -1)) 107 sizer_data.Add(wx.StaticText(self, -1, 'Name : '))108 sizer_data.Add(wx.StaticText(self, wx.ID_ANY, 'Name : ')) 108 109 sizer_data.Add(self.dataSource) 109 110 sizer_data.Add((0, 5)) … … 221 222 222 223 #Sizers 223 box_description_range = wx.StaticBox(self, -1, str(title))224 box_description_range = wx.StaticBox(self, wx.ID_ANY, str(title)) 224 225 box_description_range.SetForegroundColour(wx.BLUE) 225 226 boxsizer_range = wx.StaticBoxSizer(box_description_range, wx.VERTICAL) … … 229 230 self.sizer_set_masking = wx.BoxSizer(wx.HORIZONTAL) 230 231 sizer_chi2 = wx.BoxSizer(wx.VERTICAL) 231 smear_set_box = wx.StaticBox(self, -1, 'Set Instrumental Smearing') 232 smear_set_box = wx.StaticBox(self, wx.ID_ANY, 233 'Set Instrumental Smearing') 232 234 sizer_smearer_box = wx.StaticBoxSizer(smear_set_box, wx.HORIZONTAL) 233 235 sizer_smearer_box.SetMinSize((_DATA_BOX_WIDTH, 60)) 234 236 235 weighting_set_box = wx.StaticBox(self, -1, \237 weighting_set_box = wx.StaticBox(self, wx.ID_ANY, 236 238 'Set Weighting by Selecting dI Source') 237 239 weighting_box = wx.StaticBoxSizer(weighting_set_box, wx.HORIZONTAL) … … 239 241 weighting_box.SetMinSize((_DATA_BOX_WIDTH, 40)) 240 242 #Filling the sizer containing weighting info. 241 self.dI_noweight = wx.RadioButton(self, -1, 'No Weighting',242 style=wx.RB_GROUP)243 self.dI_didata = wx.RadioButton(self, -1, 'Use dI Data')244 self.dI_sqrdata = wx.RadioButton(self, -1, 'Use |sqrt(I Data)|')245 self.dI_idata = wx.RadioButton(self, -1, 'Use |I Data|')243 self.dI_noweight = wx.RadioButton(self, wx.ID_ANY, 244 'No Weighting', style=wx.RB_GROUP) 245 self.dI_didata = wx.RadioButton(self, wx.ID_ANY, 'Use dI Data') 246 self.dI_sqrdata = wx.RadioButton(self, wx.ID_ANY, 'Use |sqrt(I Data)|') 247 self.dI_idata = wx.RadioButton(self, wx.ID_ANY, 'Use |I Data|') 246 248 self.Bind(wx.EVT_RADIOBUTTON, self.onWeighting, 247 249 id=self.dI_noweight.GetId()) … … 269 271 270 272 # combobox for smear2d accuracy selection 271 self.smear_accuracy = wx.ComboBox(self, -1, size=(50, -1),272 s tyle=wx.CB_READONLY)273 self.smear_accuracy = wx.ComboBox(self, wx.ID_ANY, 274 size=(50, -1), style=wx.CB_READONLY) 273 275 self._set_accuracy_list() 274 276 self.smear_accuracy.SetValue(self.smear2d_accuracy) 275 277 self.smear_accuracy.SetSelection(0) 276 self.smear_accuracy.SetToolTipString( \278 self.smear_accuracy.SetToolTipString( 277 279 "'Higher' uses more Gaussian points for smearing computation.") 278 280 279 wx.EVT_COMBOBOX(self.smear_accuracy, -1, self._on_select_accuracy) 281 wx.EVT_COMBOBOX(self.smear_accuracy, wx.ID_ANY, 282 self._on_select_accuracy) 280 283 281 284 #Fit button 282 self.btFit = wx.Button(self, wx.NewId(), 'Fit')285 self.btFit = wx.Button(self, self._ids.next(), 'Fit') 283 286 self.default_bt_colour = self.btFit.GetDefaultAttributes() 284 287 self.btFit.Bind(wx.EVT_BUTTON, self._onFit, id=self.btFit.GetId()) … … 286 289 287 290 #General Help button 288 self.btFitHelp = wx.Button(self, -1, 'Help')291 self.btFitHelp = wx.Button(self, wx.ID_ANY, 'Help') 289 292 self.btFitHelp.SetToolTipString("General fitting help.") 290 293 self.btFitHelp.Bind(wx.EVT_BUTTON, self._onFitHelp) … … 299 302 else: 300 303 size_q = (30, 20) #on MAC 301 self.btSmearHelp = wx.Button(self, -1, '?', style=wx.BU_EXACTFIT,\302 s ize=size_q)304 self.btSmearHelp = wx.Button(self, wx.ID_ANY, '?', 305 style=wx.BU_EXACTFIT, size=size_q) 303 306 self.btSmearHelp.SetToolTipString("Resolution smearing help.") 304 307 self.btSmearHelp.Bind(wx.EVT_BUTTON, self._onSmearHelp) 305 308 306 309 #textcntrl for custom resolution 307 self.smear_pinhole_max = ModelTextCtrl(self, -1,310 self.smear_pinhole_max = ModelTextCtrl(self, wx.ID_ANY, 308 311 size=(_BOX_WIDTH - 25, 20), 309 312 style=wx.TE_PROCESS_ENTER, 310 313 text_enter_callback=self.onPinholeSmear) 311 self.smear_pinhole_min = ModelTextCtrl(self, -1,314 self.smear_pinhole_min = ModelTextCtrl(self, wx.ID_ANY, 312 315 size=(_BOX_WIDTH - 25, 20), 313 316 style=wx.TE_PROCESS_ENTER, 314 317 text_enter_callback=self.onPinholeSmear) 315 self.smear_slit_height = ModelTextCtrl(self, -1,318 self.smear_slit_height = ModelTextCtrl(self, wx.ID_ANY, 316 319 size=(_BOX_WIDTH - 25, 20), 317 320 style=wx.TE_PROCESS_ENTER, 318 321 text_enter_callback=self.onSlitSmear) 319 self.smear_slit_width = ModelTextCtrl(self, -1,322 self.smear_slit_width = ModelTextCtrl(self, wx.ID_ANY, 320 323 size=(_BOX_WIDTH - 25, 20), 321 324 style=wx.TE_PROCESS_ENTER, … … 323 326 324 327 ## smear 325 self.smear_data_left = BGTextCtrl(self, -1,328 self.smear_data_left = BGTextCtrl(self, wx.ID_ANY, 326 329 size=(_BOX_WIDTH - 25, 20), style=0) 327 330 self.smear_data_left.SetValue(str(self.dq_l)) 328 self.smear_data_right = BGTextCtrl(self, -1,331 self.smear_data_right = BGTextCtrl(self, wx.ID_ANY, 329 332 size=(_BOX_WIDTH - 25, 20), style=0) 330 333 self.smear_data_right.SetValue(str(self.dq_r)) … … 337 340 338 341 #Filling the sizer containing instruments smearing info. 339 self.disable_smearer = wx.RadioButton(self, -1,342 self.disable_smearer = wx.RadioButton(self, wx.ID_ANY, 340 343 'None', style=wx.RB_GROUP) 341 self.enable_smearer = wx.RadioButton(self, -1, 342 'Use dQ Data') 344 self.enable_smearer = wx.RadioButton(self, wx.ID_ANY, 'Use dQ Data') 343 345 #self.enable_smearer.SetToolTipString( 344 346 #"Click to use the loaded dQ data for smearing.") 345 self.pinhole_smearer = wx.RadioButton(self, -1,347 self.pinhole_smearer = wx.RadioButton(self, wx.ID_ANY, 346 348 'Custom Pinhole Smear') 347 349 #self.pinhole_smearer.SetToolTipString 348 350 #("Click to input custom resolution for pinhole smearing.") 349 self.slit_smearer = wx.RadioButton(self, -1, 'Custom Slit Smear')351 self.slit_smearer = wx.RadioButton(self, wx.ID_ANY, 'Custom Slit Smear') 350 352 #self.slit_smearer.SetToolTipString 351 353 #("Click to input custom resolution for slit smearing.") … … 368 370 369 371 # StaticText for chi2, N(for fitting), Npts + Log/linear spacing 370 self.tcChi = BGTextCtrl(self, -1, "-", size=(75, 20), style=0)372 self.tcChi = BGTextCtrl(self, wx.ID_ANY, "-", size=(75, 20), style=0) 371 373 self.tcChi.SetToolTipString("Chi2/Npts(Fit)") 372 self.Npts_fit = BGTextCtrl(self, -1, "-", size=(75, 20), style=0)373 self.Npts_fit.SetToolTipString( \374 self.Npts_fit = BGTextCtrl(self, wx.ID_ANY, "-", size=(75, 20), style=0) 375 self.Npts_fit.SetToolTipString( 374 376 " Npts : number of points selected for fitting") 375 self.Npts_total = ModelTextCtrl(self, -1, 376 size=(_BOX_WIDTH, 20), 377 self.Npts_total = ModelTextCtrl(self, wx.ID_ANY, size=(_BOX_WIDTH, 20), 377 378 style=wx.TE_PROCESS_ENTER, 378 379 text_enter_callback=self._onQrangeEnter) … … 382 383 383 384 # Update and Draw button 384 self.draw_button = wx.Button(self, wx.NewId(), 'Compute')385 self.draw_button.Bind(wx.EVT_BUTTON, \385 self.draw_button = wx.Button(self, self._ids.next(), 'Compute') 386 self.draw_button.Bind(wx.EVT_BUTTON, 386 387 self._onDraw, id=self.draw_button.GetId()) 387 388 self.draw_button.SetToolTipString("Compute and Draw.") 388 389 389 390 self.points_sizer = wx.BoxSizer(wx.HORIZONTAL) 390 self.pointsbox = wx.CheckBox(self, -1, 'Log?', (10, 10))391 self.pointsbox = wx.CheckBox(self, wx.ID_ANY, 'Log?', (10, 10)) 391 392 self.pointsbox.SetValue(False) 392 393 self.pointsbox.SetToolTipString("Check mark to use log spaced points") 393 394 wx.EVT_CHECKBOX(self, self.pointsbox.GetId(), self.select_log) 394 395 395 self.points_sizer.Add(wx.StaticText(self, -1, 'Npts '))396 self.points_sizer.Add(wx.StaticText(self, wx.ID_ANY, 'Npts ')) 396 397 self.points_sizer.Add(self.pointsbox) 397 398 398 box_description_1 = wx.StaticText(self, -1, ' Chi2/Npts')399 box_description_2 = wx.StaticText(self, -1, 'Npts(Fit)')399 box_description_1 = wx.StaticText(self, wx.ID_ANY, ' Chi2/Npts') 400 box_description_2 = wx.StaticText(self, wx.ID_ANY, 'Npts(Fit)') 400 401 401 402 # StaticText for smear 402 self.smear_description_none = wx.StaticText(self, -1,403 self.smear_description_none = wx.StaticText(self, wx.ID_ANY, 403 404 smear_message_none, style=wx.ALIGN_LEFT) 404 self.smear_description_dqdata = wx.StaticText(self, 405 - 1,smear_message_dqdata, style=wx.ALIGN_LEFT)406 self.smear_description_type = wx.StaticText(self, 407 - 1,"Type:", style=wx.ALIGN_LEFT)408 self.smear_description_accuracy_type = wx.StaticText(self, -1,409 410 self.smear_description_smear_type = BGTextCtrl(self, -1,405 self.smear_description_dqdata = wx.StaticText(self, wx.ID_ANY, 406 smear_message_dqdata, style=wx.ALIGN_LEFT) 407 self.smear_description_type = wx.StaticText(self, wx.ID_ANY, 408 "Type:", style=wx.ALIGN_LEFT) 409 self.smear_description_accuracy_type = wx.StaticText(self, wx.ID_ANY, 410 "Accuracy:", style=wx.ALIGN_LEFT) 411 self.smear_description_smear_type = BGTextCtrl(self, wx.ID_ANY, 411 412 size=(57, 20), style=0) 412 413 self.smear_description_smear_type.SetValue(str(self.dq_l)) 413 414 self.SetBackgroundColour(self.GetParent().GetBackgroundColour()) 414 self.smear_description_2d = wx.StaticText(self, -1,415 self.smear_description_2d = wx.StaticText(self, wx.ID_ANY, 415 416 smear_message_2d, style=wx.ALIGN_LEFT) 416 self.smear_message_new_s = wx.StaticText(self, -1,417 self.smear_message_new_s = wx.StaticText(self, wx.ID_ANY, 417 418 smear_message_new_ssmear, style=wx.ALIGN_LEFT) 418 self.smear_message_new_p = wx.StaticText(self, -1,419 self.smear_message_new_p = wx.StaticText(self, wx.ID_ANY, 419 420 smear_message_new_psmear, style=wx.ALIGN_LEFT) 420 self.smear_description_2d_x = wx.StaticText(self, -1,421 self.smear_description_2d_x = wx.StaticText(self, wx.ID_ANY, 421 422 smear_message_2d_x_title, style=wx.ALIGN_LEFT) 422 self.smear_description_2d_x.SetToolTipString( \423 self.smear_description_2d_x.SetToolTipString( 423 424 " dQp(parallel) in q_r direction.") 424 self.smear_description_2d_y = wx.StaticText(self, -1,425 self.smear_description_2d_y = wx.StaticText(self, wx.ID_ANY, 425 426 smear_message_2d_y_title, style=wx.ALIGN_LEFT) 426 427 self.smear_description_2d_y.SetToolTipString(\ 427 428 " dQs(perpendicular) in q_phi direction.") 428 self.smear_description_pin_min = wx.StaticText(self, -1,429 self.smear_description_pin_min = wx.StaticText(self, wx.ID_ANY, 429 430 smear_message_pinhole_min_title, style=wx.ALIGN_LEFT) 430 self.smear_description_pin_max = wx.StaticText(self, -1,431 self.smear_description_pin_max = wx.StaticText(self, wx.ID_ANY, 431 432 smear_message_pinhole_max_title, style=wx.ALIGN_LEFT) 432 self.smear_description_slit_height = wx.StaticText(self, -1,433 self.smear_description_slit_height = wx.StaticText(self, wx.ID_ANY, 433 434 smear_message_slit_height_title, style=wx.ALIGN_LEFT) 434 self.smear_description_slit_width = wx.StaticText(self, -1,435 self.smear_description_slit_width = wx.StaticText(self, wx.ID_ANY, 435 436 smear_message_slit_width_title, style=wx.ALIGN_LEFT) 436 437 … … 519 520 self.sizer5.Clear(True) 520 521 521 self.qmin = ModelTextCtrl(self, -1, size=(_BOX_WIDTH, 20),522 self.qmin = ModelTextCtrl(self, wx.ID_ANY, size=(_BOX_WIDTH, 20), 522 523 style=wx.TE_PROCESS_ENTER, 523 524 set_focus_callback=self.qrang_set_focus, … … 530 531 self.qmin.SetToolTipString(qmin_tip) 531 532 532 self.qmax = ModelTextCtrl(self, -1, size=(_BOX_WIDTH, 20),533 self.qmax = ModelTextCtrl(self, wx.ID_ANY, size=(_BOX_WIDTH, 20), 533 534 style=wx.TE_PROCESS_ENTER, 534 535 set_focus_callback=self.qrang_set_focus, … … 545 546 self.qmin.Bind(wx.EVT_TEXT, self.on_qrange_text) 546 547 self.qmax.Bind(wx.EVT_TEXT, self.on_qrange_text) 547 wx_id = wx.NewId()548 wx_id = self._ids.next() 548 549 self.reset_qrange = wx.Button(self, wx_id, 'Reset') 549 550 … … 553 554 sizer = wx.GridSizer(5, 5, 2, 6) 554 555 555 self.btEditMask = wx.Button(self, wx.NewId(), 'Editor')556 self.btEditMask = wx.Button(self, self._ids.next(), 'Editor') 556 557 self.btEditMask.Bind(wx.EVT_BUTTON, self._onMask, 557 558 id=self.btEditMask.GetId()) 558 559 self.btEditMask.SetToolTipString("Edit Mask.") 559 self.EditMask_title = wx.StaticText(self, -1, ' Masking(2D)')560 561 sizer.Add(wx.StaticText(self, -1, ' Q range'))562 sizer.Add(wx.StaticText(self, -1, ' Min[1/A]'))563 sizer.Add(wx.StaticText(self, -1, ' Max[1/A]'))560 self.EditMask_title = wx.StaticText(self, wx.ID_ANY, ' Masking(2D)') 561 562 sizer.Add(wx.StaticText(self, wx.ID_ANY, ' Q range')) 563 sizer.Add(wx.StaticText(self, wx.ID_ANY, ' Min[1/A]')) 564 sizer.Add(wx.StaticText(self, wx.ID_ANY, ' Max[1/A]')) 564 565 sizer.Add(self.EditMask_title) 565 566 sizer.Add((-1,5)) … … 618 619 619 620 ## fill a sizer with the combobox to select dispersion type 620 model_disp = wx.StaticText(self, -1, 'Function')621 model_disp = wx.StaticText(self, wx.ID_ANY, 'Function') 621 622 CHECK_STATE = self.cb1.GetValue() 622 623 import sas.models.dispersion_models … … 625 626 ix = 0 626 627 iy = 0 627 disp = wx.StaticText(self, -1, ' ')628 disp = wx.StaticText(self, wx.ID_ANY, ' ') 628 629 self.sizer4_4.Add(disp, (iy, ix), (1, 1), 629 630 wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15) 630 631 ix += 1 631 values = wx.StaticText(self, -1, 'PD[ratio]')632 values = wx.StaticText(self, wx.ID_ANY, 'PD[ratio]') 632 633 polytext = "Polydispersity (= STD/mean); " 633 634 polytext += "the standard deviation over the mean value." … … 641 642 else: 642 643 err_text = '' 643 self.text_disp_1 = wx.StaticText(self, -1, err_text)644 self.text_disp_1 = wx.StaticText(self, wx.ID_ANY, err_text) 644 645 self.sizer4_4.Add(self.text_disp_1, (iy, ix), (1, 1), \ 645 646 wx.EXPAND | wx.ADJUST_MINSIZE, 0) 646 647 647 648 ix += 1 648 self.text_disp_min = wx.StaticText(self, -1, 'Min')649 self.text_disp_min = wx.StaticText(self, wx.ID_ANY, 'Min') 649 650 self.sizer4_4.Add(self.text_disp_min, (iy, ix), (1, 1), \ 650 651 wx.EXPAND | wx.ADJUST_MINSIZE, 0) 651 652 652 653 ix += 1 653 self.text_disp_max = wx.StaticText(self, -1, 'Max')654 self.text_disp_max = wx.StaticText(self, wx.ID_ANY, 'Max') 654 655 self.sizer4_4.Add(self.text_disp_max, (iy, ix), (1, 1), 655 656 wx.EXPAND | wx.ADJUST_MINSIZE, 0) 656 657 657 658 ix += 1 658 npts = wx.StaticText(self, -1, 'Npts')659 npts = wx.StaticText(self, wx.ID_ANY, 'Npts') 659 660 npts.SetToolTipString("Number of sampling points for the numerical\n\ 660 661 integration over the distribution function.") … … 662 663 wx.EXPAND | wx.ADJUST_MINSIZE, 0) 663 664 ix += 1 664 nsigmas = wx.StaticText(self, -1, 'Nsigs')665 nsigmas = wx.StaticText(self, wx.ID_ANY, 'Nsigs') 665 666 nsigmas.SetToolTipString("Number of sigmas between which the range\n\ 666 667 of the distribution function will be used for weighting. \n\ … … 695 696 if p == "width": 696 697 ix = 0 697 cb = wx.CheckBox(self, -1, name0, (10, 10))698 cb = wx.CheckBox(self, wx.ID_ANY, name0, (10, 10)) 698 699 cb.SetValue(CHECK_STATE) 699 700 cb.SetToolTipString("Check mark to fit") … … 703 704 ix = 1 704 705 value = self.model.getParam(name1) 705 ctl1 = ModelTextCtrl(self, -1,706 ctl1 = ModelTextCtrl(self, wx.ID_ANY, 706 707 size=(_BOX_WIDTH / 1.3, 20), 707 708 style=wx.TE_PROCESS_ENTER) … … 715 716 ## text to show error sign 716 717 ix = 2 717 text2 = wx.StaticText(self, -1, '+/-')718 text2 = wx.StaticText(self, wx.ID_ANY, '+/-') 718 719 self.sizer4_4.Add(text2, (iy, ix), (1, 1), 719 720 wx.EXPAND | wx.ADJUST_MINSIZE, 0) … … 722 723 723 724 ix = 3 724 ctl2 = wx.TextCtrl(self, -1,725 ctl2 = wx.TextCtrl(self, wx.ID_ANY, 725 726 size=(_BOX_WIDTH / 1.3, 20), 726 727 style=0) … … 732 733 733 734 ix = 4 734 ctl3 = ModelTextCtrl(self, -1,735 ctl3 = ModelTextCtrl(self, wx.ID_ANY, 735 736 size=(_BOX_WIDTH / 2, 20), 736 737 style=wx.TE_PROCESS_ENTER, … … 741 742 742 743 ix = 5 743 ctl4 = ModelTextCtrl(self, -1,744 ctl4 = ModelTextCtrl(self, wx.ID_ANY, 744 745 size=(_BOX_WIDTH / 2, 20), 745 746 style=wx.TE_PROCESS_ENTER, … … 755 756 ix = 6 756 757 value = self.model.getParam(name2) 757 Tctl = ModelTextCtrl(self, -1,758 Tctl = ModelTextCtrl(self, wx.ID_ANY, 758 759 size=(_BOX_WIDTH / 2.2, 20), 759 760 style=wx.TE_PROCESS_ENTER) … … 767 768 ix = 7 768 769 value = self.model.getParam(name3) 769 Tct2 = ModelTextCtrl(self, -1,770 Tct2 = ModelTextCtrl(self, wx.ID_ANY, 770 771 size=(_BOX_WIDTH / 2.2, 20), 771 772 style=wx.TE_PROCESS_ENTER) … … 779 780 780 781 ix = 8 781 disp_box = wx.ComboBox(self, -1, size=(65, -1),782 disp_box = wx.ComboBox(self, wx.ID_ANY, size=(65, -1), 782 783 style=wx.CB_READONLY, name='%s' % name1) 783 784 for key, value in self.polydisp.iteritems(): … … 785 786 disp_box.Append(name_disp, value) 786 787 disp_box.SetStringSelection("gaussian") 787 wx.EVT_COMBOBOX(disp_box, -1, self._on_disp_func)788 wx.EVT_COMBOBOX(disp_box, wx.ID_ANY, self._on_disp_func) 788 789 self.sizer4_4.Add(disp_box, (iy, ix), (1, 1), wx.EXPAND) 789 790 self.fittable_param.append([cb, name1, ctl1, text2, … … 815 816 if p == "width": 816 817 ix = 0 817 cb = wx.CheckBox(self, -1, name0, (10, 10))818 cb = wx.CheckBox(self, wx.ID_ANY, name0, (10, 10)) 818 819 cb.SetValue(CHECK_STATE) 819 820 cb.SetToolTipString("Check mark to fit") … … 828 829 ix = 1 829 830 value = self.model.getParam(name1) 830 ctl1 = ModelTextCtrl(self, -1,831 ctl1 = ModelTextCtrl(self, wx.ID_ANY, 831 832 size=(_BOX_WIDTH / 1.3, 20), 832 833 style=wx.TE_PROCESS_ENTER) … … 854 855 ## text to show error sign 855 856 ix = 2 856 text2 = wx.StaticText(self, -1, '+/-')857 text2 = wx.StaticText(self, wx.ID_ANY, '+/-') 857 858 self.sizer4_4.Add(text2, (iy, ix), (1, 1), 858 859 wx.EXPAND | wx.ADJUST_MINSIZE, 0) … … 861 862 862 863 ix = 3 863 ctl2 = wx.TextCtrl(self, -1,864 ctl2 = wx.TextCtrl(self, wx.ID_ANY, 864 865 size=(_BOX_WIDTH / 1.3, 20), 865 866 style=0) … … 876 877 877 878 ix = 4 878 ctl3 = ModelTextCtrl(self, -1,879 ctl3 = ModelTextCtrl(self, wx.ID_ANY, 879 880 size=(_BOX_WIDTH / 2, 20), 880 881 style=wx.TE_PROCESS_ENTER, … … 887 888 888 889 ix = 5 889 ctl4 = ModelTextCtrl(self, -1,890 ctl4 = ModelTextCtrl(self, wx.ID_ANY, 890 891 size=(_BOX_WIDTH / 2, 20), 891 892 style=wx.TE_PROCESS_ENTER, … … 903 904 ix = 6 904 905 value = self.model.getParam(name2) 905 Tctl = ModelTextCtrl(self, -1,906 Tctl = ModelTextCtrl(self, wx.ID_ANY, 906 907 size=(_BOX_WIDTH / 2.2, 20), 907 908 style=wx.TE_PROCESS_ENTER) … … 923 924 ix = 7 924 925 value = self.model.getParam(name3) 925 Tct2 = ModelTextCtrl(self, -1,926 Tct2 = ModelTextCtrl(self, wx.ID_ANY, 926 927 size=(_BOX_WIDTH / 2.2, 20), 927 928 style=wx.TE_PROCESS_ENTER) … … 943 944 944 945 ix = 8 945 disp_box = wx.ComboBox(self, -1, size=(65, -1),946 disp_box = wx.ComboBox(self, wx.ID_ANY, size=(65, -1), 946 947 style=wx.CB_READONLY, name='%s' % name1) 947 948 for key, value in self.polydisp.iteritems(): … … 949 950 disp_box.Append(name_disp, value) 950 951 disp_box.SetStringSelection("gaussian") 951 wx.EVT_COMBOBOX(disp_box, -1, self._on_disp_func)952 wx.EVT_COMBOBOX(disp_box, wx.ID_ANY, self._on_disp_func) 952 953 self.sizer4_4.Add(disp_box, (iy, ix), (1, 1), wx.EXPAND) 953 954 self.fittable_param.append([cb, name1, ctl1, text2, … … 1079 1080 1080 1081 _TreeLocation = "user/perspectives/fitting/fitting_help.html" 1081 _doc_viewer = DocumentationWindow(self, -1, _TreeLocation, "",1082 _doc_viewer = DocumentationWindow(self, wx.ID_ANY, _TreeLocation, "", 1082 1083 "General Fitting Help") 1083 1084 … … 1098 1099 1099 1100 _TreeLocation = "user/perspectives/fitting/sm_help.html" 1100 _doc_viewer = DocumentationWindow(self, -1, _TreeLocation, "",1101 _doc_viewer = DocumentationWindow(self, wx.ID_ANY, _TreeLocation, "", 1101 1102 "Instrumental Resolution Smearing \ 1102 1103 Help") … … 1182 1183 self._keep.Enable(False) 1183 1184 self._set_save_flag(False) 1185 # TODO: why do we have to variables for one flag?? 1184 1186 self.enable_disp.SetValue(False) 1185 1187 self.disable_disp.SetValue(True) 1188 # TODO: should not have an untrapped exception when displaying disperser 1189 # TODO: do we need to create the disperser panel on every model change? 1190 # Note: if we fix this, then remove ID_DISPERSER_HELP from basepage 1186 1191 try: 1187 1192 self.set_dispers_sizer() … … 2831 2836 return 2832 2837 2833 box_description = wx.StaticBox(self, -1, str("Model Parameters"))2838 box_description = wx.StaticBox(self, wx.ID_ANY, str("Model Parameters")) 2834 2839 boxsizer1 = wx.StaticBoxSizer(box_description, wx.VERTICAL) 2835 2840 sizer = wx.GridBagSizer(5, 5) … … 2898 2903 ix = 0 2899 2904 select_text = "Select All" 2900 self.cb1 = wx.CheckBox(self, -1, str(select_text), (10, 10))2905 self.cb1 = wx.CheckBox(self, wx.ID_ANY, str(select_text), (10, 10)) 2901 2906 wx.EVT_CHECKBOX(self, self.cb1.GetId(), self.select_all_param) 2902 2907 self.cb1.SetToolTipString("To check/uncheck all the boxes below.") … … 2906 2911 wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 5) 2907 2912 ix += 1 2908 self.text2_2 = wx.StaticText(self, -1, 'Value')2913 self.text2_2 = wx.StaticText(self, wx.ID_ANY, 'Value') 2909 2914 sizer.Add(self.text2_2, (iy, ix), (1, 1), \ 2910 2915 wx.EXPAND | wx.ADJUST_MINSIZE, 0) 2911 2916 ix += 2 2912 self.text2_3 = wx.StaticText(self, -1, 'Error')2917 self.text2_3 = wx.StaticText(self, wx.ID_ANY, 'Error') 2913 2918 sizer.Add(self.text2_3, (iy, ix), (1, 1), \ 2914 2919 wx.EXPAND | wx.ADJUST_MINSIZE, 0) … … 2916 2921 self.text2_3.Hide() 2917 2922 ix += 1 2918 self.text2_min = wx.StaticText(self, -1, 'Min')2923 self.text2_min = wx.StaticText(self, wx.ID_ANY, 'Min') 2919 2924 sizer.Add(self.text2_min, (iy, ix), (1, 1), \ 2920 2925 wx.EXPAND | wx.ADJUST_MINSIZE, 0) 2921 2926 #self.text2_min.Hide() 2922 2927 ix += 1 2923 self.text2_max = wx.StaticText(self, -1, 'Max')2928 self.text2_max = wx.StaticText(self, wx.ID_ANY, 'Max') 2924 2929 sizer.Add(self.text2_max, (iy, ix), (1, 1), \ 2925 2930 wx.EXPAND | wx.ADJUST_MINSIZE, 0) 2926 2931 #self.text2_max.Hide() 2927 2932 ix += 1 2928 self.text2_4 = wx.StaticText(self, -1, '[Units]')2933 self.text2_4 = wx.StaticText(self, wx.ID_ANY, '[Units]') 2929 2934 sizer.Add(self.text2_4, (iy, ix), (1, 1), \ 2930 2935 wx.EXPAND | wx.ADJUST_MINSIZE, 0) … … 2947 2952 self.temp_multi_functional)\ 2948 2953 and (item in self.model.non_fittable): 2949 non_fittable_name = wx.StaticText(self, -1, item)2954 non_fittable_name = wx.StaticText(self, wx.ID_ANY, item) 2950 2955 sizer.Add(non_fittable_name, (iy, ix), (1, 1), \ 2951 2956 wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 21) … … 2955 2960 if len(self.model.fun_list) > 0: 2956 2961 #num = item.split('_')[1][5:7] 2957 fun_box = wx.ComboBox(self, -1, size=(100, -1),2962 fun_box = wx.ComboBox(self, wx.ID_ANY, size=(100, -1), 2958 2963 style=wx.CB_READONLY, name='%s' % item) 2959 2964 self._set_fun_box_list(fun_box) … … 2961 2966 #self.fun_box.SetToolTipString("A function 2962 2967 # describing the interface") 2963 wx.EVT_COMBOBOX(fun_box, -1, self._on_fun_box)2968 wx.EVT_COMBOBOX(fun_box, wx.ID_ANY, self._on_fun_box) 2964 2969 else: 2965 fun_box = ModelTextCtrl(self, -1,2970 fun_box = ModelTextCtrl(self, wx.ID_ANY, 2966 2971 size=(_BOX_WIDTH, 20), 2967 2972 style=wx.TE_PROCESS_ENTER, name='%s' % item) … … 2975 2980 else: 2976 2981 ## add parameters name with checkbox for selecting to fit 2977 cb = wx.CheckBox(self, -1, item)2982 cb = wx.CheckBox(self, wx.ID_ANY, item) 2978 2983 cb.SetValue(CHECK_STATE) 2979 2984 cb.SetToolTipString(" Check mark to fit.") … … 2987 2992 ix += 1 2988 2993 value = self.model.getParam(item) 2989 ctl1 = ModelTextCtrl(self, -1, size=(_BOX_WIDTH, 20),2994 ctl1 = ModelTextCtrl(self, wx.ID_ANY, size=(_BOX_WIDTH, 20), 2990 2995 style=wx.TE_PROCESS_ENTER) 2991 2996 ctl1.SetToolTipString(\ … … 2995 3000 ## text to show error sign 2996 3001 ix += 1 2997 text2 = wx.StaticText(self, -1, '+/-')3002 text2 = wx.StaticText(self, wx.ID_ANY, '+/-') 2998 3003 sizer.Add(text2, (iy, ix), (1, 1), \ 2999 3004 wx.EXPAND | wx.ADJUST_MINSIZE, 0) … … 3001 3006 text2.Hide() 3002 3007 ix += 1 3003 ctl2 = wx.TextCtrl(self, -1,3008 ctl2 = wx.TextCtrl(self, wx.ID_ANY, 3004 3009 size=(_BOX_WIDTH / 1.2, 20), style=0) 3005 3010 sizer.Add(ctl2, (iy, ix), (1, 1), … … 3009 3014 3010 3015 ix += 1 3011 ctl3 = ModelTextCtrl(self, -1,3016 ctl3 = ModelTextCtrl(self, wx.ID_ANY, 3012 3017 size=(_BOX_WIDTH / 1.9, 20), 3013 3018 style=wx.TE_PROCESS_ENTER, … … 3021 3026 3022 3027 ix += 1 3023 ctl4 = ModelTextCtrl(self, -1,3028 ctl4 = ModelTextCtrl(self, wx.ID_ANY, 3024 3029 size=(_BOX_WIDTH / 1.9, 20), 3025 3030 style=wx.TE_PROCESS_ENTER, … … 3034 3039 # Units 3035 3040 if item in self.model.details: 3036 units = wx.StaticText(self, -1,3041 units = wx.StaticText(self, wx.ID_ANY, 3037 3042 self.model.details[item][0], style=wx.ALIGN_LEFT) 3038 3043 else: 3039 units = wx.StaticText(self, -1, "",3044 units = wx.StaticText(self, wx.ID_ANY, "", 3040 3045 style=wx.ALIGN_LEFT) 3041 3046 sizer.Add(units, (iy, ix), (1, 1), … … 3060 3065 for item in keys: 3061 3066 if item in self.model.orientation_params: 3062 orient_angle = wx.StaticText(self, -1, '[For 2D only]:')3063 mag_on_button = wx.Button(self, -1, "Magnetic ON")3067 orient_angle = wx.StaticText(self, wx.ID_ANY, '[For 2D only]:') 3068 mag_on_button = wx.Button(self, wx.ID_ANY, "Magnetic ON") 3064 3069 mag_on_button.SetToolTipString("Turn Pol Beam/Mag scatt on/off") 3065 3070 mag_on_button.Bind(wx.EVT_BUTTON, self._on_mag_on) 3066 mag_angle_help_button = wx.Button(self, -1, "Magnetic angles?")3071 mag_angle_help_button = wx.Button(self, wx.ID_ANY, "Magnetic angles?") 3067 3072 mag_angle_help_button.SetToolTipString("see angle definitions") 3068 mag_help_button = wx.Button(self, -1, "Mag HELP")3073 mag_help_button = wx.Button(self, wx.ID_ANY, "Mag HELP") 3069 3074 mag_help_button.SetToolTipString("Help on pol beam/mag fitting") 3070 3075 mag_help_button.Bind(wx.EVT_BUTTON, self._on_mag_help) … … 3124 3129 ix = 0 3125 3130 ## add parameters name with checkbox for selecting to fit 3126 cb = wx.CheckBox(self, -1, item)3131 cb = wx.CheckBox(self, wx.ID_ANY, item) 3127 3132 cb.SetValue(CHECK_STATE) 3128 3133 cb.SetToolTipString("Check mark to fit")
Note: See TracChangeset
for help on using the changeset viewer.