Class: CWM::IntField

Inherits:
AbstractWidget show all
Includes:
ValueBasedWidget
Defined in:
library/cwm/src/lib/cwm/common_widgets.rb

Overview

An integer field widget. The AbstractWidget#label method is mandatory. It supports optional #minimum and #maximum methods for limiting the range. See #cwm_definition method for minimum and maximum example

Instance Attribute Summary

Attributes inherited from AbstractWidget

#handle_all_events, #widget_id

Instance Method Summary collapse

Methods included from ValueBasedWidget

#value, #value=

Methods inherited from AbstractWidget

#cleanup, #disable, #enable, #enabled?, #handle, #help, #init, #label, #opt, #store, #validate, widget_type=

Instance Method Details

#cwm_definitionWidgetHash

The definition for IntField additionally supports `minimum` and `maximum` methods.

Examples:

minimum and maximum methods

def minimum
  50
end

def maximum
  200
end

Returns:



262
263
264
265
266
267
268
269
# File 'library/cwm/src/lib/cwm/common_widgets.rb', line 262

def cwm_definition
  res = {}

  res["minimum"] = minimum if respond_to?(:minimum)
  res["maximum"] = maximum if respond_to?(:maximum)

  super.merge(res)
end

#maximumFixnum

Returns limited by C signed int range (-2**30 to 2**31-1).

Returns:

  • (Fixnum)

    limited by C signed int range (-2**30 to 2**31-1).



# File 'library/cwm/src/lib/cwm/common_widgets.rb', line 247

#minimumFixnum

Returns limited by C signed int range (-2**30 to 2**31-1).

Returns:

  • (Fixnum)

    limited by C signed int range (-2**30 to 2**31-1).



# File 'library/cwm/src/lib/cwm/common_widgets.rb', line 244