Changeset 3f36675 in sasview for sansview/perspectives/fitting/fitting_widgets.py
- Timestamp:
- Aug 1, 2011 10:36:34 AM (13 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:
- 0fd2f27
- Parents:
- d6a3cf0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/fitting_widgets.py
rcfcb7207 r3f36675 17 17 HEIGHT = 300 18 18 MAX_NBR_DATA = 4 19 20 class BatchDataDialog(wx.Dialog): 21 """ 22 The current design of Batch fit allows only of type of data in the data 23 set. This allows the user to make a quick selection of the type of data 24 to use in fit tab. 25 """ 26 def __init__(self, parent=None, *args, **kwds): 27 wx.Dialog.__init__(self, parent, *args, **kwds) 28 self.SetSize((WIDTH, 250)) 29 self.data_1d_selected = None 30 self.data_2d_selected = None 31 self._do_layout() 32 33 def _do_layout(self): 34 """ 35 Draw the content of the current dialog window 36 """ 37 vbox = wx.BoxSizer(wx.VERTICAL) 38 box_description= wx.StaticBox(self, -1,str("Hint")) 39 hint_sizer = wx.StaticBoxSizer(box_description, wx.VERTICAL) 40 selection_sizer = wx.GridBagSizer(5,5) 41 button_sizer = wx.BoxSizer(wx.HORIZONTAL) 42 self.data_1d_selected = wx.RadioButton(self, -1, 'Data1D', 43 style=wx.RB_GROUP) 44 self.data_2d_selected = wx.RadioButton(self, -1, 'Data2D') 45 self.data_1d_selected.SetValue(True) 46 self.data_2d_selected.SetValue(False) 47 button_cancel = wx.Button(self, wx.ID_CANCEL, "Cancel") 48 button_OK = wx.Button(self, wx.ID_OK, "Ok") 49 button_OK.SetFocus() 50 hint = "Selected Data set contains both 1D and 2D Data.\n" 51 hint += "Please select on type of analysis before proceeding.\n" 52 hint_sizer.Add(wx.StaticText(self, -1, hint)) 53 #draw area containing radio buttons 54 ix = 0 55 iy = 0 56 selection_sizer.Add(self.data_1d_selected, (iy, ix), 57 (1, 1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 58 iy += 1 59 selection_sizer.Add(self.data_2d_selected, (iy, ix), 60 (1, 1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 61 #contruction the sizer contaning button 62 button_sizer.Add((20, 20), 1, wx.EXPAND|wx.ADJUST_MINSIZE, 0) 63 button_sizer.Add(button_cancel, 0, 64 wx.LEFT|wx.RIGHT|wx.ADJUST_MINSIZE, 10) 65 button_sizer.Add(button_OK, 0, 66 wx.LEFT|wx.RIGHT|wx.ADJUST_MINSIZE, 10) 67 vbox.Add(hint_sizer, 0, wx.EXPAND|wx.ALL, 10) 68 vbox.Add(selection_sizer, 0, wx.TOP|wx.BOTTOM, 10) 69 vbox.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0) 70 vbox.Add(button_sizer, 0 , wx.TOP|wx.BOTTOM, 10) 71 self.SetSizer(vbox) 72 73 def get_data(self): 74 """ 75 return 1 if user requested Data1D , 2 if user requested Data2D 76 """ 77 if self.data_1d_selected.GetValue(): 78 return 1 79 else: 80 return 2 81 82 19 83 20 84 class DataDialog(wx.Dialog):
Note: See TracChangeset
for help on using the changeset viewer.