Changeset ff8f99b in sasview
- Timestamp:
- Oct 14, 2009 8:00:19 PM (15 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:
- 448e69c
- Parents:
- 860afc1
- Location:
- sansview/perspectives/fitting
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/basepage.py
r9170547 rff8f99b 318 318 self.Bind(wx.EVT_RADIOBUTTON, self._set_dipers_Param, id=self.disable_disp.GetId()) 319 319 self.Bind(wx.EVT_RADIOBUTTON, self._set_dipers_Param, id=self.enable_disp.GetId()) 320 320 #MAC needs SetValue 321 self.disable_disp.SetValue(True) 321 322 sizer_dispersion = wx.BoxSizer(wx.HORIZONTAL) 322 323 sizer_dispersion.Add((20,20)) … … 1208 1209 1209 1210 1210 def _set_model_sizer(self, 1211 def _set_model_sizer(self,sizer, box_sizer, title="", object=None): 1211 1212 """ 1212 1213 Use lists to fill a sizer for model info … … 1214 1215 1215 1216 sizer.Clear(True) 1216 box_description= wx.StaticBox(self, -1,str(title)) 1217 boxsizer1 = wx.StaticBoxSizer(box_description, wx.VERTICAL) 1217 ##For MAC, this should defined here. 1218 if box_sizer == None: 1219 box_description= wx.StaticBox(self, -1,str(title)) 1220 boxsizer1 = wx.StaticBoxSizer(box_description, wx.VERTICAL) 1221 else: 1222 boxsizer1 = box_sizer 1223 1218 1224 #-------------------------------------------------------- 1219 1225 self.shape_rbutton = wx.RadioButton(self, -1, 'Shapes', style=wx.RB_GROUP) … … 1230 1236 self.Bind( wx.EVT_RADIOBUTTON, self._show_combox, 1231 1237 id= self.plugin_rbutton.GetId() ) 1232 1238 #MAC needs SetValue 1239 self.shape_rbutton.SetValue(True) 1233 1240 1234 1241 sizer_radiobutton = wx.GridSizer(2, 2,5, 5) … … 1373 1380 self.disp_cb_dict ={} 1374 1381 f_id = self.formfactorbox.GetCurrentSelection() 1375 1376 form_factor = self.formfactorbox.GetClientData( f_id ) 1382 #For MAC 1383 form_factor = None 1384 if f_id >= 0: 1385 form_factor = self.formfactorbox.GetClientData( f_id ) 1386 1377 1387 if not form_factor in self.model_list_box["multiplication"]: 1378 1388 self.structurebox.Hide() … … 1603 1613 disp_model = GaussianDispersion() 1604 1614 1605 1606 1615 self._disp_obj_dict[p] = disp_model 1616 # Set the new model as the dispersion object for the selected parameter 1607 1617 try: 1608 1618 self.model.set_dispersion(p, disp_model) 1609 1619 except: 1610 1620 pass 1611 1621 # Redraw the model 1612 1622 #self._draw_model() 1613 1623 ## save state into … … 1683 1693 self.noDisper_rbox = wx.RadioButton(self, -1,"None", (10, 10),style= wx.RB_GROUP) 1684 1694 self.Bind(wx.EVT_RADIOBUTTON,self.select_disp_angle , id=self.noDisper_rbox.GetId()) 1695 #MAC needs SetValue 1696 self.noDisper_rbox.SetValue(True) 1685 1697 self.sizer4_4.Add(self.noDisper_rbox, (iy, ix), 1686 1698 (1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) … … 1746 1758 1747 1759 1748 def _set_range_sizer(self, title, object1=None,object=None):1749 """ 1750 Fill the 1760 def _set_range_sizer(self, title, box_sizer=None, object1=None,object=None): 1761 """ 1762 Fill the Q range sizer 1751 1763 """ 1752 1764 self.sizer5.Clear(True) 1753 box_description= wx.StaticBox(self, -1,str(title))1754 boxsizer1 = wx.StaticBoxSizer(box_description, wx.VERTICAL)1755 1765 #-------------------------------------------------------------- 1766 if box_sizer == None: 1767 box_description= wx.StaticBox(self, -1,str(title)) 1768 boxsizer1 = wx.StaticBoxSizer(box_description, wx.VERTICAL) 1769 else: 1770 #for MAC 1771 boxsizer1 = box_sizer 1772 1756 1773 self.qmin = BasicPage.ModelTextCtrl(self, -1,size=(_BOX_WIDTH,20)) 1757 1774 self.qmin.SetValue(str(self.qmin_x)) -
sansview/perspectives/fitting/fitpage.py
r9170547 rff8f99b 44 44 ## default fitengine type 45 45 self.engine_type = None 46 #self.smearer = None 46 47 ## draw sizer 47 48 self._fill_datainfo_sizer() … … 146 147 add access to npts 147 148 """ 149 title = "Fitting" 150 box_description_range = wx.StaticBox(self, -1,str(title)) 151 boxsizer_range = wx.StaticBoxSizer(box_description_range, wx.VERTICAL) 152 148 153 sizer_fit = wx.GridSizer(1, 1,0, 0) 149 154 … … 155 160 sizer_fit.Add((5,5),1, wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 5) 156 161 sizer_fit.Add(self.btFit,0, wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 35) 157 162 sizer_fit.Layout() 158 163 sizer_smearer = wx.BoxSizer(wx.HORIZONTAL) 159 164 #Filling the sizer containing instruments smearing info. … … 162 167 self.Bind(wx.EVT_RADIOBUTTON, self.onSmear, id=self.disable_smearer.GetId()) 163 168 self.Bind(wx.EVT_RADIOBUTTON, self.onSmear, id=self.enable_smearer.GetId()) 169 self.disable_smearer.SetValue(True) 164 170 165 171 sizer_smearer.Add(wx.StaticText(self,-1,'Instrument Smearing? ')) … … 168 174 sizer_smearer.Add((10,10)) 169 175 sizer_smearer.Add( self.disable_smearer ) 170 171 176 #Display Chi^2/dof 172 177 sizer_smearer.Add((90,10)) … … 184 189 185 190 #Set sizer for Fitting section 186 self._set_range_sizer( title= "Fitting",object1=sizer_smearer, object= sizer_fit)191 self._set_range_sizer( title=title,box_sizer=boxsizer_range, object1=sizer_smearer, object= sizer_fit) 187 192 188 193 … … 250 255 """ 251 256 ##Add model function Details button in fitpanel. 257 ##The following 3 lines are for Mac. Let JHC know before modifying... 258 title = "Model" 259 box_description= wx.StaticBox(self, -1,str(title)) 260 boxsizer1 = wx.StaticBoxSizer(box_description, wx.VERTICAL) 261 252 262 id = wx.NewId() 253 263 self.model_help =wx.Button(self,id,'Details') … … 256 266 257 267 ## class base method to add view 2d button 258 self._set_model_sizer(sizer=sizer, title="Model",object=self.model_help )268 self._set_model_sizer(sizer=sizer, box_sizer=boxsizer1, title="Model",object=self.model_help ) 259 269 260 270 -
sansview/perspectives/fitting/modelpage.py
ra720d1f rff8f99b 83 83 add access to npts 84 84 """ 85 sizer_npts= wx.GridSizer(1, 1,5, 5) 86 85 ##The following 3 lines are for Mac. Let JHC know before modifying.. 86 title = "Plotted Q Range" 87 box_description= wx.StaticBox(self, -1,str(title)) 88 boxsizer1 = wx.StaticBoxSizer(box_description, wx.VERTICAL) 89 90 sizer_npts= wx.GridSizer(1, 1,5, 5) 87 91 self.npts = BasicPage.ModelTextCtrl(self, -1,size=(_BOX_WIDTH,20)) 88 92 self.npts.SetValue(format_number(self.num_points)) … … 91 95 sizer_npts.Add(wx.StaticText(self, -1, 'Npts'),1, wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 5) 92 96 sizer_npts.Add(self.npts,1, wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 5) 93 self._set_range_sizer( title= "Plotted Q Range", object= sizer_npts)97 self._set_range_sizer( title=title, box_sizer=boxsizer1, object= sizer_npts) 94 98 95 99 … … 108 112 fill sizer containing model info 109 113 """ 114 ##The following 3 lines are for Mac. Let JHC know before modifying.. 115 title = "Model" 116 box_description= wx.StaticBox(self, -1,str(title)) 117 boxsizer1 = wx.StaticBoxSizer(box_description, wx.VERTICAL) 118 110 119 id = wx.NewId() 111 120 self.model_view =wx.Button(self,id,'View 2D') … … 114 123 115 124 ## class base method to add view 2d button 116 self._set_model_sizer(sizer=sizer, title="Model",object= self.model_view )125 self._set_model_sizer(sizer=sizer,box_sizer=boxsizer1, title=title,object= self.model_view ) 117 126 118 127 … … 397 406 self.Bind( wx.EVT_RADIOBUTTON, self._on_display_description, 398 407 id=self.description_show.GetId() ) 408 #MAC needs SetValue 409 self.description_hide.SetValue(True) 399 410 400 411 self.model_description = wx.Button(self,-1, label="Details") … … 405 416 sizer_selection.Add( (20,20)) 406 417 sizer_selection.Add( self.description_hide ) 407 sizer_selection.Add((20,20),0, wx.LEFT|wx.RIGHT|wx.EXPAND, 67)418 sizer_selection.Add((20,20),0, wx.LEFT|wx.RIGHT|wx.EXPAND,75) 408 419 sizer_selection.Add( self.model_description ) 409 420
Note: See TracChangeset
for help on using the changeset viewer.