Class: CDK::FSCALE
Direct Known Subclasses
Instance Attribute Summary
Attributes included from HasTitle
Attributes included from HasScreen
#is_visible, #screen, #screen_index
Attributes included from ExitConditions
Attributes included from Bindings
Attributes included from Focusable
Attributes included from Borders
#BXAttr, #HZChar, #LLChar, #LRChar, #ULChar, #URChar, #VTChar, #border_size, #box
Instance Method Summary collapse
- #drawField ⇒ Object
- #getDigits ⇒ Object
-
#initialize(cdkscreen, xplace, yplace, title, label, field_attr, field_width, start, low, high, inc, fast_inc, digits, box, shadow) ⇒ FSCALE
constructor
A new instance of FSCALE.
- #object_type ⇒ Object
- #SCAN_FMT ⇒ Object
- #setDigits(digits) ⇒ Object
Methods inherited from SCALE
Decrement, Increment, #activate, #destroy, #draw, #erase, #focus, #getHighValue, #getLowValue, #getValue, #inject, #limitCurrentValue, #move, #moveToEditPosition, #performEdit, #position, removeChar, #set, #setBKattr, #setEditPosition, #setLowHigh, #setValue, #unfocus, #validEditPosition
Methods inherited from CDKOBJS
#setBackgroundColor, #timeout, #validCDKObject, #validObjType
Methods included from WindowHooks
#destroy, #draw, #erase, #refreshData, #saveData
Methods included from WindowInput
#getc, #getch, #inject, #setPostProcess, #setPreProcess
Methods included from HasTitle
#cleanTitle, #drawTitle, #init_title, #setTitle
Methods included from HasScreen
#SCREEN_XPOS, #SCREEN_YPOS, #init_screen, #wrefresh
Methods included from ExitConditions
#init_exit_conditions, #resetExitType, #setExitType
Methods included from Bindings
#bind, #bindableObject, #checkBind, #cleanBindings, #init_bindings, #isBind, #unbind
Methods included from Focusable
Methods included from Borders
#getBox, #init_borders, #setBXattr, #setBox, #setHZchar, #setLLchar, #setLRchar, #setULchar, #setURchar, #setVTchar
Methods included from Movement
#move, #move_specific, #position
Methods included from Converters
#char2Chtype, #charOf, #chtype2Char, #chtype2String, #decode_attribute, #encode_attribute
Methods included from Justifications
Methods included from Alignments
Constructor Details
#initialize(cdkscreen, xplace, yplace, title, label, field_attr, field_width, start, low, high, inc, fast_inc, digits, box, shadow) ⇒ FSCALE
Returns a new instance of FSCALE.
5 6 7 8 9 10 |
# File 'lib/cdk/components/fscale.rb', line 5 def initialize(cdkscreen, xplace, yplace, title, label, field_attr, field_width, start, low, high, inc, fast_inc, digits, box, shadow) @digits = digits super(cdkscreen, xplace, yplace, title, label, field_attr, field_width, start, low, high, inc, fast_inc, box, shadow) end |
Instance Method Details
#drawField ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/cdk/components/fscale.rb', line 12 def drawField @field_win.werase # Draw the value in the field. digits = [@digits, 30].min format = '%%.%if' % [digits] temp = format % [@current] Draw.writeCharAttrib(@field_win, @field_width - temp.size - 1, 0, temp, @field_attr, CDK::HORIZONTAL, 0, temp.size) self.moveToEditPosition(@field_edit) wrefresh(@field_win) end |
#getDigits ⇒ Object
32 33 34 |
# File 'lib/cdk/components/fscale.rb', line 32 def getDigits return @digits end |
#object_type ⇒ Object
40 41 42 |
# File 'lib/cdk/components/fscale.rb', line 40 def object_type :FSCALE end |
#SCAN_FMT ⇒ Object
36 37 38 |
# File 'lib/cdk/components/fscale.rb', line 36 def SCAN_FMT '%g%c' end |
#setDigits(digits) ⇒ Object
28 29 30 |
# File 'lib/cdk/components/fscale.rb', line 28 def setDigits(digits) @digits = [0, digits].max end |