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, #displayed?, #enable, #enabled?, #focus, #fun_ref, #handle, #help, #init, #label, #my_event?, #opt, #refresh_help, #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:



286
287
288
289
290
291
292
293
# File 'library/cwm/src/lib/cwm/common_widgets.rb', line 286

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 271

#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 268