parameters: (self)
return_statement: return widget
docstring: Return widget to edit numeric value of attribute
          This is effectively the parametrisation of the masked.NumCtrl widget.
docstring_summary: Return widget to edit numeric value of attribute
          This is effectively the parametrisation of the masked.NumCtrl widget.
docstring_tokens: Return widget to edit numeric value of attribute This is effectively the parametrisation of the masked . NumCtrl widget .
function: def get_valuewidget_write(self):
          """
          Return widget to edit numeric value of attribute
          This is effectively the parametrisation of the masked.NumCtrl widget.
          """
          value = self.get_value_obj()
          # strange way to convert numpy type numbers into native python numbers
          if type(value) not in (types.IntType, types.LongType, types.FloatType, types.ComplexType):
              value = value.tolist()
          # print 'NumericWidgetContainer.get_valuewidget_write ',value,type(value),self._attrconf.digits_fraction
  
          # if self._attrconf.digits_fraction  is None:
          #    self._attrconf.digits_fraction = 3
  
          # print '  panelstyle=',self.panelstyle
          # print '  value=',value
          # numpy returns dtype... even for scalars
          # make sure to convert value in a native python scalar
          # if value  is None:
          # value=NaN
          # elif type(value) not in (types.IntType, types.LongType, types.FloatType):
          #    value=value.tolist()
  
          # if self.config_attr['min'] is None:
          allow_negative = True
          # else:
          #    allow_negative = self.config_attr['min'] < 0.0
  
          #min = self.config_attr['min']
          #max = self.config_attr['max']
  
          # if min  is None:
          #    if value<0:
          #        min = -5*value
          #    else:
          #        min = 0
          #
          # if max  is None:
          #    max = 5*abs(value)
  
          if np.isinf(value):
              widget = wx.StaticText(self.parent, -1,
                                     value.__repr__(),
                                     style=wx.ALIGN_LEFT  # |wx.SIMPLE_BORDER #wx.STATIC_BORDER #|  #
                                     )
              # widget.SetBackgroundColour(self.color_bg)
              self.extend_widgetsize(widget)
              # print 'create_unitwidget', self.config_attr['unit']
              return widget
  
          # if self.panelstyle == 'fancy': #'instrumental':
          #    print 'NumericWidgetContainer.get_valuewidget_write fancy mode'
          #    print 'TODO: no bindings yet for immediate apply'
          #    slider = wx.Slider(self.parent, wx.ID_ANY,
          #                value,
          #                min, max,
          #                style=wx.SL_HORIZONTAL| wx.SL_AUTOTICKS
          #                #style=wx.SL_HORIZONTAL | wx.SL_AUTOTICKS | wx.SL_LABELS
          #                )
          #
          #    slider.SetTickFreq(5, 1)
          #    return slider
  
          # else:
  
          widget = wx.TextCtrl(self.parent, -1, str(value), style=wx.ALIGN_RIGHT)
          # standard numerical widget
          # widget = masked.Ctrl(self.parent, id = -1,
          #                        value = value,
          #                        #integerWidth=None,
          #                        fractionWidth = self._attrconf.digits_fraction,
          #                        autoSize = True,
          #                        controlType=masked.controlTypes.NUMBER,
          #                        style= wx.ALIGN_RIGHT
          #                        )
          # widget = masked.NumCtrl(
          #     self.parent, id = -1,
          #     value = value,
          #     pos = wx.DefaultPosition,
          #     size = wx.DefaultSize,
          #     style = 0,
          #     validator = wx.DefaultValidator,
          #     name = "masked.number",
          #     integerWidth = 10,
          #     fractionWidth = 0,
          #     allowNone = False,
          #     allowNegative = True,
          #     useParensForNegatives = False,
          #     groupDigits = False,
          #     groupChar = ',',
          #     decimalChar = '.',
          #     min = None,
          #     max = None,
          #     limited = False,
          #     #limitOnFieldChange = False,
          #     selectOnEntry = True,
          #     foregroundColour = "Black",
          #     signedForegroundColour = "Red",
          #     emptyBackgroundColour = "White",
          #     validBackgroundColour = "White",
          #     invalidBackgroundColour = "Yellow",
          #     autoSize = False#True
          #     )
          self.set_textevents(widget)
          return widget
function_tokens: def get_valuewidget_write ( self ) : value = self . get_value_obj ( ) # strange way to convert numpy type numbers into native python numbers if type ( value ) not in ( types . IntType , types . LongType , types . FloatType , types . ComplexType ) : value = value . tolist ( ) # print 'NumericWidgetContainer.get_valuewidget_write ',value,type(value),self._attrconf.digits_fraction # if self._attrconf.digits_fraction  is None: #    self._attrconf.digits_fraction = 3 # print '  panelstyle=',self.panelstyle # print '  value=',value # numpy returns dtype... even for scalars # make sure to convert value in a native python scalar # if value  is None: # value=NaN # elif type(value) not in (types.IntType, types.LongType, types.FloatType): #    value=value.tolist() # if self.config_attr['min'] is None: allow_negative = True # else: #    allow_negative = self.config_attr['min'] < 0.0 #min = self.config_attr['min'] #max = self.config_attr['max'] # if min  is None: #    if value<0: #        min = -5*value #    else: #        min = 0 # # if max  is None: #    max = 5*abs(value) if np . isinf ( value ) : widget = wx . StaticText ( self . parent , - 1 , value . __repr__ ( ) , style = wx . ALIGN_LEFT # |wx.SIMPLE_BORDER #wx.STATIC_BORDER #|  # ) # widget.SetBackgroundColour(self.color_bg) self . extend_widgetsize ( widget ) # print 'create_unitwidget', self.config_attr['unit'] return widget # if self.panelstyle == 'fancy': #'instrumental': #    print 'NumericWidgetContainer.get_valuewidget_write fancy mode' #    print 'TODO: no bindings yet for immediate apply' #    slider = wx.Slider(self.parent, wx.ID_ANY, #                value, #                min, max, #                style=wx.SL_HORIZONTAL| wx.SL_AUTOTICKS #                #style=wx.SL_HORIZONTAL | wx.SL_AUTOTICKS | wx.SL_LABELS #                ) # #    slider.SetTickFreq(5, 1) #    return slider # else: widget = wx . TextCtrl ( self . parent , - 1 , str ( value ) , style = wx . ALIGN_RIGHT ) # standard numerical widget # widget = masked.Ctrl(self.parent, id = -1, #                        value = value, #                        #integerWidth=None, #                        fractionWidth = self._attrconf.digits_fraction, #                        autoSize = True, #                        controlType=masked.controlTypes.NUMBER, #                        style= wx.ALIGN_RIGHT #                        ) # widget = masked.NumCtrl( #     self.parent, id = -1, #     value = value, #     pos = wx.DefaultPosition, #     size = wx.DefaultSize, #     style = 0, #     validator = wx.DefaultValidator, #     name = "masked.number", #     integerWidth = 10, #     fractionWidth = 0, #     allowNone = False, #     allowNegative = True, #     useParensForNegatives = False, #     groupDigits = False, #     groupChar = ',', #     decimalChar = '.', #     min = None, #     max = None, #     limited = False, #     #limitOnFieldChange = False, #     selectOnEntry = True, #     foregroundColour = "Black", #     signedForegroundColour = "Red", #     emptyBackgroundColour = "White", #     validBackgroundColour = "White", #     invalidBackgroundColour = "Yellow", #     autoSize = False#True #     ) self . set_textevents ( widget ) return widget