Changeset b5847bd8 in sasview
- Timestamp:
- Nov 19, 2008 5:23:57 PM (16 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:
- a644dc4
- Parents:
- 52ac10b
- Location:
- sansview/perspectives/fitting
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/fitpage1D.py
r55e13ab rb5847bd8 44 44 Initialization of the Panel 45 45 """ 46 self.scroll = wx.ScrolledWindow(self) 47 46 48 self.manager = None 47 49 self.parent = parent 48 self.event_owner =None50 self.event_owner = None 49 51 #panel interface 50 52 self.vbox = wx.BoxSizer(wx.VERTICAL) … … 56 58 57 59 58 self.DataSource =wx.StaticText(self , -1,str(data.name))59 60 self.modelbox = wx.ComboBox(self , -1)60 self.DataSource =wx.StaticText(self.scroll, -1,str(data.name)) 61 62 self.modelbox = wx.ComboBox(self.scroll, -1) 61 63 id = wx.NewId() 62 self.btFit =wx.Button(self ,id,'Fit')64 self.btFit =wx.Button(self.scroll,id,'Fit') 63 65 self.btFit.Bind(wx.EVT_BUTTON, self.onFit,id=id) 64 66 self.btFit.SetToolTipString("Perform fit.") 65 self.static_line_1 = wx.StaticLine(self , -1)67 self.static_line_1 = wx.StaticLine(self.scroll, -1) 66 68 67 69 self.vbox.Add(self.sizer3) … … 75 77 76 78 id = wx.NewId() 77 self.btClose =wx.Button(self ,id,'Close')79 self.btClose =wx.Button(self.scroll,id,'Close') 78 80 self.btClose.Bind(wx.EVT_BUTTON, self.onClose,id=id) 79 81 self.btClose.SetToolTipString("Close page.") 80 82 ix = 0 81 83 iy = 1 82 self.sizer3.Add(wx.StaticText(self , -1, 'Data Source Name : '),(iy,ix),\84 self.sizer3.Add(wx.StaticText(self.scroll, -1, 'Data Source Name : '),(iy,ix),\ 83 85 (1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 84 86 ix += 1 … … 88 90 ix = 0 89 91 iy += 1 90 self.sizer3.Add(wx.StaticText(self ,-1,'Model'),(iy,ix),(1,1)\92 self.sizer3.Add(wx.StaticText(self.scroll,-1,'Model'),(iy,ix),(1,1)\ 91 93 , wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 92 94 ix += 1 … … 96 98 iy = 1 97 99 #set maximum range for x in linear scale 98 self.text4_3 = wx.StaticText(self , -1, 'Maximum Data Range(Linear)', style=wx.ALIGN_LEFT)100 self.text4_3 = wx.StaticText(self.scroll, -1, 'Maximum Data Range(Linear)', style=wx.ALIGN_LEFT) 99 101 self.sizer4.Add(self.text4_3,(iy,ix),(1,1),\ 100 102 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 101 103 ix += 1 102 self.sizer4.Add(wx.StaticText(self , -1, 'Min'),(iy, ix),(1,1),\104 self.sizer4.Add(wx.StaticText(self.scroll, -1, 'Min'),(iy, ix),(1,1),\ 103 105 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 104 106 ix += 2 105 self.sizer4.Add(wx.StaticText(self , -1, 'Max'),(iy, ix),(1,1),\107 self.sizer4.Add(wx.StaticText(self.scroll, -1, 'Max'),(iy, ix),(1,1),\ 106 108 wx.EXPAND|wx.ADJUST_MINSIZE, 0) 107 109 ix = 0 108 110 iy += 1 109 self.sizer4.Add(wx.StaticText(self , -1, 'x range'),(iy, ix),(1,1),\111 self.sizer4.Add(wx.StaticText(self.scroll, -1, 'x range'),(iy, ix),(1,1),\ 110 112 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 111 113 ix += 1 112 self.xmin = wx.TextCtrl(self , -1,size=(_BOX_WIDTH,20))114 self.xmin = wx.TextCtrl(self.scroll, -1,size=(_BOX_WIDTH,20)) 113 115 self.xmin.SetValue(format_number(numpy.min(data.x))) 114 116 self.xmin.SetToolTipString("Minimun value of x in linear scale.") … … 120 122 121 123 ix += 2 122 self.xmax = wx.TextCtrl(self , -1,size=(_BOX_WIDTH,20))124 self.xmax = wx.TextCtrl(self.scroll, -1,size=(_BOX_WIDTH,20)) 123 125 self.xmax.SetValue(format_number(numpy.max(data.x))) 124 126 self.xmax.SetToolTipString("Maximum value of x in linear scale.") … … 133 135 ix = 0 134 136 iy = 1 135 self.smear= wx.CheckBox(self , -1, "Fit with Smear", (10, 10))136 wx.EVT_CHECKBOX(self , self.smear.GetId(), self.onSmear)137 self.smear= wx.CheckBox(self.scroll, -1, "Fit with Smear", (10, 10)) 138 wx.EVT_CHECKBOX(self.scroll, self.smear.GetId(), self.onSmear) 137 139 self.sizer1.Add(self.smear,(iy,ix),(1,1),\ 138 140 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 139 141 iy+=1 140 self.text1_1 = wx.StaticText(self , -1, 'Chi2/dof', style=wx.ALIGN_LEFT)142 self.text1_1 = wx.StaticText(self.scroll, -1, 'Chi2/dof', style=wx.ALIGN_LEFT) 141 143 #self.sizer1.Add(self.text1_1,1) 142 144 self.sizer1.Add(self.text1_1,(iy,ix),(1,1),\ 143 145 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 144 146 ix += 1 145 self.tcChi = wx.TextCtrl(self , -1,size=(_BOX_WIDTH,20))147 self.tcChi = wx.TextCtrl(self.scroll, -1,size=(_BOX_WIDTH,20)) 146 148 self.tcChi.SetToolTipString("Chi^2 over degrees of freedom.") 147 149 #self.sizer1.Add(self.tcChi, 1, wx.R | wx.BOTTOM , 5) … … 168 170 self.data = data 169 171 self.vbox.Layout() 172 173 bs = wx.BoxSizer(wx.VERTICAL) 174 bs.Add(self.scroll, 1, wx.EXPAND) 175 176 self.SetSizer(bs) 177 178 self.scroll.SetSizer(self.vbox) 179 180 self.scroll.SetScrollbars(20,20,55,40) 181 182 self.Centre() 183 self.Layout() 170 184 self.GrandParent.GetSizer().Layout() 171 self.vbox.Fit(self) 172 self.SetSizer(self.vbox) 173 #self.scrollbar= wx.ScrollBar(self, -1,pos = wx.DefaultPosition,style = wx.VERTICAL) 174 self.Centre() 185 print self.GetSize() 186 print self.scroll.GetSize() 187 188 189 190 175 191 176 192 … … 362 378 iq=1 363 379 if len(disp_list)>0: 364 disp = wx.StaticText(self , -1, 'Dispersion')380 disp = wx.StaticText(self.scroll, -1, 'Dispersion') 365 381 self.sizer5.Add(disp,( iq, ip),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 366 382 ip += 1 367 values = wx.StaticText(self , -1, 'Values')383 values = wx.StaticText(self.scroll, -1, 'Values') 368 384 self.sizer5.Add(values,( iq, ip),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) 369 385 … … 371 387 iy = 1 372 388 ix = 0 373 self.cb1 = wx.CheckBox(self , -1,'Parameters', (10, 10))374 wx.EVT_CHECKBOX(self , self.cb1.GetId(), self.select_all_param)389 self.cb1 = wx.CheckBox(self.scroll, -1,'Parameters', (10, 10)) 390 wx.EVT_CHECKBOX(self.scroll, self.cb1.GetId(), self.select_all_param) 375 391 self.sizer2.Add(self.cb1,(iy, ix),(1,1),\ 376 392 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 377 393 ix +=1 378 self.text2_2 = wx.StaticText(self , -1, 'Values')394 self.text2_2 = wx.StaticText(self.scroll, -1, 'Values') 379 395 self.sizer2.Add(self.text2_2,(iy, ix),(1,1),\ 380 396 wx.EXPAND|wx.ADJUST_MINSIZE, 0) 381 397 ix +=2 382 self.text2_3 = wx.StaticText(self , -1, 'Errors')398 self.text2_3 = wx.StaticText(self.scroll, -1, 'Errors') 383 399 self.sizer2.Add(self.text2_3,(iy, ix),(1,1),\ 384 400 wx.EXPAND|wx.ADJUST_MINSIZE, 0) 385 401 self.text2_3.Hide() 386 402 ix +=1 387 self.text2_4 = wx.StaticText(self , -1, 'Units')403 self.text2_4 = wx.StaticText(self.scroll, -1, 'Units') 388 404 self.sizer2.Add(self.text2_4,(iy, ix),(1,1),\ 389 405 wx.EXPAND|wx.ADJUST_MINSIZE, 0) … … 395 411 ix = 0 396 412 397 cb = wx.CheckBox(self , -1, item, (10, 10))413 cb = wx.CheckBox(self.scroll, -1, item, (10, 10)) 398 414 cb.SetValue(False) 399 415 self.sizer2.Add( cb,( iy, ix),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 400 wx.EVT_CHECKBOX(self , cb.GetId(), self.select_param)416 wx.EVT_CHECKBOX(self.scroll, cb.GetId(), self.select_param) 401 417 402 418 ix += 1 403 419 value= self.model.getParam(item) 404 ctl1 = wx.TextCtrl(self , -1, size=(_BOX_WIDTH,20), style=wx.TE_PROCESS_ENTER)420 ctl1 = wx.TextCtrl(self.scroll, -1, size=(_BOX_WIDTH,20), style=wx.TE_PROCESS_ENTER) 405 421 ctl1.SetValue(str (format_number(value))) 406 422 ctl1.Bind(wx.EVT_KILL_FOCUS, self._onparamEnter) … … 408 424 self.sizer2.Add(ctl1, (iy,ix),(1,1), wx.EXPAND) 409 425 ix += 1 410 text2=wx.StaticText(self , -1, '+/-')426 text2=wx.StaticText(self.scroll, -1, '+/-') 411 427 self.sizer2.Add(text2,(iy, ix),(1,1),\ 412 428 wx.EXPAND|wx.ADJUST_MINSIZE, 0) 413 429 text2.Hide() 414 430 ix += 1 415 ctl2 = wx.TextCtrl(self , -1, size=(_BOX_WIDTH,20), style=wx.TE_PROCESS_ENTER)431 ctl2 = wx.TextCtrl(self.scroll, -1, size=(_BOX_WIDTH,20), style=wx.TE_PROCESS_ENTER) 416 432 self.sizer2.Add(ctl2, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) 417 433 ctl2.Hide() … … 419 435 # Units 420 436 try: 421 units = wx.StaticText(self , -1, self.model.details[item][0], style=wx.ALIGN_LEFT)437 units = wx.StaticText(self.scroll, -1, self.model.details[item][0], style=wx.ALIGN_LEFT) 422 438 except: 423 units = wx.StaticText(self , -1, "", style=wx.ALIGN_LEFT)439 units = wx.StaticText(self.scroll, -1, "", style=wx.ALIGN_LEFT) 424 440 self.sizer2.Add(units, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) 425 441 else: 426 442 ip = 0 427 443 iq += 1 428 cb = wx.CheckBox(self , -1, item, (10, 10))444 cb = wx.CheckBox(self.scroll, -1, item, (10, 10)) 429 445 cb.SetValue(False) 430 446 self.sizer5.Add( cb,( iq, ip),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 431 wx.EVT_CHECKBOX(self , cb.GetId(), self.select_param)447 wx.EVT_CHECKBOX(self.scroll, cb.GetId(), self.select_param) 432 448 433 449 ip += 1 434 450 value= self.model.getParam(item) 435 ctl1 = wx.TextCtrl(self , -1, size=(_BOX_WIDTH,20), style=wx.TE_PROCESS_ENTER)451 ctl1 = wx.TextCtrl(self.scroll, -1, size=(_BOX_WIDTH,20), style=wx.TE_PROCESS_ENTER) 436 452 ctl1.SetValue(str (format_number(value))) 437 453 ctl1.Bind(wx.EVT_KILL_FOCUS, self._onparamEnter) -
sansview/perspectives/fitting/fitpanel.py
r55e13ab rb5847bd8 83 83 panel = FitPage2D(self.nb,data, -1) 84 84 else: 85 85 86 from fitpage1D import FitPage1D 86 87 panel = FitPage1D(self.nb,data, -1) 88 87 89 panel.set_manager(self.manager) 88 90 panel.set_owner(self.event_owner)
Note: See TracChangeset
for help on using the changeset viewer.