coffeescript-ui
Version:
Coffeescript User Interface System
54 lines (46 loc) • 1.11 kB
text/coffeescript
###
* coffeescript-ui - Coffeescript User Interface System (CUI)
* Copyright (c) 2013 - 2016 Programmfabrik GmbH
* MIT Licence
* https://github.com/programmfabrik/coffeescript-ui, http://www.coffeescript-ui.org
###
class CUI.InputBlock extends CUI.Element
constructor: (opts) ->
super(opts)
=
initOpts: ->
super()
start:
mandatory: true
check: (v) ->
CUI.util.isInteger(v) and v >= 0
string:
mandatory: true
check: (v) ->
CUI.util.isString(v)
setString: (s) ->
CUI.util.assert(CUI.util.isString(s), "#{CUI.util.getObjectClass(@)}.setString", "Parameter needs to be String with a minimum length of 1.", string: s)
= s
@
getString: ->
calcSizes: ->
= .length
= +
for k in ["len", "end", "start", "string"]
@[k] = @["__#{k}"]
@
incrementBlock: (block, blocks) ->
block
decrementBlock: (block, blocks) ->
block
toString: ->
CUI.util.dump(
start:
end:
len:
string:
)