Changeset b0ab6cb in sasview for calculatorview/perspectives/calculator/kiessig_calculator_panel.py
- Timestamp:
- Oct 27, 2010 4:41:30 PM (14 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:
- 6cda91f
- Parents:
- c4d6900
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
calculatorview/perspectives/calculator/kiessig_calculator_panel.py
r74b1770 rb0ab6cb 11 11 import wx 12 12 import sys 13 import os13 #import os 14 14 15 from sans.guicomm.events import StatusEvent15 #from sans.guicomm.events import StatusEvent 16 16 from sans.calculator.kiessig_calculator import KiessigThicknessCalculator 17 from calculator_widgets import OutputTextCtrl, InputTextCtrl 17 from calculator_widgets import OutputTextCtrl 18 from calculator_widgets import InputTextCtrl 18 19 19 20 _BOX_WIDTH = 77 … … 39 40 CENTER_PANE = True 40 41 41 def __init__(self, parent, id=-1,*args, **kwds):42 wx.Panel.__init__(self, parent, id=id,*args, **kwds)42 def __init__(self, parent, *args, **kwds): 43 wx.Panel.__init__(self, parent, *args, **kwds) 43 44 #Font size 44 45 self.SetWindowVariant(variant=FONT_VARIANT) … … 46 47 self.parent = parent 47 48 self.kiessig = KiessigThicknessCalculator() 49 #layout attribute 50 self.hint_sizer = None 48 51 self._do_layout() 49 52 … … 91 94 """ 92 95 thick_unit = '['+self.kiessig.get_thickness_unit() +']' 93 thickness_size_txt = wx.StaticText(self, -1, 'Thickness (or Diameter): ') 96 thickness_size_txt = wx.StaticText(self, -1, 97 'Thickness (or Diameter): ') 94 98 self.thickness_size_tcl = OutputTextCtrl(self, -1, 95 99 size=(_BOX_WIDTH,-1)) … … 106 110 Fill the sizer containing hint 107 111 """ 108 hint_msg = "This tool is to approximately estimate the thickness of a layer" 112 hint_msg = "This tool is to approximately estimate " 113 hint_msg += "the thickness of a layer" 109 114 hint_msg += " or the diameter of particles\n " 110 115 hint_msg += "from the Kiessig fringe width in SANS/NR data." … … 148 153 """ 149 154 self.parent.Close() 155 if event is not None: 156 event.Skip() 150 157 151 158 def on_compute(self, event): … … 164 171 self.thickness_size_tcl.SetValue(str(thickness)) 165 172 166 def format_number(self, value=None):173 def format_number(self, value=None): 167 174 """ 168 175 Return a float in a standardized, human-readable formatted string … … 174 181 return output 175 182 176 output = "%-7.4g" % value183 output = "%-7.4g" % value 177 184 return output.lstrip().rstrip() 178 185 179 186 class KiessigWindow(wx.Frame): 180 def __init__(self, parent=None, id=1, title="Kiessig Thickness Calculator"): 181 wx.Frame.__init__(self, parent, id, title, size=(PANEL_WIDTH,PANEL_HEIGHT)) 187 def __init__(self, parent=None, title="Kiessig Thickness Calculator"): 188 wx.Frame.__init__(self, parent, title, 189 size=(PANEL_WIDTH,PANEL_HEIGHT)) 182 190 self.parent = parent 183 191 self.panel = KiessigThicknessCalculatorPanel(parent=self)
Note: See TracChangeset
for help on using the changeset viewer.