Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Data Fields
Lesson1Wx.FloatCounter Class Reference
Inheritance diagram for Lesson1Wx.FloatCounter:

Public Member Functions

def __init__
 
def SetFloat
 

Data Fields

 sizer
 
 intPart
 
 manPart
 
 unitSel
 
 valAndUnit
 
 theValue
 
 theUnit
 

Detailed Description

Definition at line 307 of file Lesson1Wx.py.

Constructor & Destructor Documentation

def Lesson1Wx.FloatCounter.__init__ (   self,
  parent,
  myTitle,
  unitList 
)

Definition at line 308 of file Lesson1Wx.py.

309  def __init__(self, parent, myTitle, unitList):
310  wx.Panel.__init__(self, parent, -1)
312  self.sizer = wx.BoxSizer(wx.HORIZONTAL)
313  self.sizer.Add((10, -1))
314  self.sizer.Add(wx.StaticText(parent, -1, myTitle, wx.DefaultPosition, (100, -1)))
316  self.intPart = wx.SpinCtrl(parent, -1, "", wx.DefaultPosition, (60,-1))
317  self.intPart.SetRange(0,999)
318  self.intPart.SetValue(1)
319  self.intPart.Bind(wx.EVT_SPINCTRL, self.SetFloat)
321  self.manPart = wx.SpinCtrl(parent, -1, "", wx.DefaultPosition, (50, -1))
322  self.manPart.SetRange(0,999)
323  self.manPart.SetValue(0)
324  self.manPart.Bind(wx.EVT_SPINCTRL, self.SetFloat)
326  self.unitSel = wx.Choice(parent, -1, wx.DefaultPosition, (90, -1), unitList)
327  self.unitSel.Bind(wx.EVT_CHOICE, self.SetFloat, self.unitSel)
328  self.unitSel.SetSelection(2)
330  self.valAndUnit = wx.TextCtrl(parent, -1, "value unset", wx.DefaultPosition, (150, -1))
331 
332  self.sizer.Add(self.valAndUnit)
333  self.sizer.Add((10, -1))
334  self.sizer.Add(wx.StaticText(parent, -1, " ", wx.DefaultPosition, (30, -1)))
335  self.sizer.Add(self.intPart)
336  self.sizer.Add(wx.StaticText(parent, -1, ".", wx.DefaultPosition, (10, -1)))
337  self.sizer.Add(self.manPart)
338  self.sizer.Add((5,-1))
339  self.sizer.Add(self.unitSel)
340  self.SetSizer(self.sizer)

Member Function Documentation

def Lesson1Wx.FloatCounter.SetFloat (   self,
  event 
)

Definition at line 341 of file Lesson1Wx.py.

342  def SetFloat(self, event):
343 # self.theValue = str(self.intPart.GetValue()) + "." + str(self.manPart.GetValue()) + " "
344  self.theValue = float (self.intPart.GetValue()) + float(self.manPart.GetValue())/ 1000.
345  self.theUnit = self.unitSel.GetStringSelection()
346  theText = "%.3f" % (self.theValue) + " " + self.theUnit
347  self.valAndUnit.SetValue(theText)
348 # user may edit the Entry, so finnaly this value must be got
349 # but it doesn't work for length but work for energy (gApplyUIcommnd)
350 
351 
# special class for this example to set/unset processes

Field Documentation

Lesson1Wx.FloatCounter.intPart

Definition at line 315 of file Lesson1Wx.py.

Lesson1Wx.FloatCounter.manPart

Definition at line 320 of file Lesson1Wx.py.

Lesson1Wx.FloatCounter.sizer

Definition at line 311 of file Lesson1Wx.py.

Lesson1Wx.FloatCounter.theUnit

Definition at line 344 of file Lesson1Wx.py.

Lesson1Wx.FloatCounter.theValue

Definition at line 343 of file Lesson1Wx.py.

Lesson1Wx.FloatCounter.unitSel

Definition at line 325 of file Lesson1Wx.py.

Lesson1Wx.FloatCounter.valAndUnit

Definition at line 329 of file Lesson1Wx.py.


The documentation for this class was generated from the following file: