nodesnim/nodescontrol/edittext

Types

EditHandler = proc (pressed_key: string)
EditTextRef = ref object of LabelObj
  is_blink, is_select: bool
  caret*, selectable: bool
  blink_time: uint8
  caret_color: ColorRef
  hint*: StyleText
  caret_pos: array[2, uint32]
  on_edit*: EditHandler      ## This called when user press any key.
  

Procs

proc EditText(name: string = "EditText"; hint: string = "Edit text ..."): EditTextRef {...}{.
    raises: [ValueError, RegexError, GLerror], tags: [].}

Methods

method draw(self: EditTextRef; w, h: GLfloat) {...}{.
    raises: [GLerror, Exception, ResourceError], tags: [RootEffect].}
This method uses for redraw Label object.
method moveCursorBy(self: EditTextRef; value: int) {...}{.base, raises: [], tags: [].}
method insert(self: EditTextRef; position: uint32; value: string) {...}{.base,
    raises: [GLerror, Exception], tags: [RootEffect].}
method setText(self: EditTextRef; t: string; save_properties: bool = false) {...}{.
    raises: [GLerror, Exception], tags: [RootEffect].}

Changes text.

Arguments:

  • text is a new Label text.
  • save_properties - saves old text properties, if true.
method setHint(self: EditTextRef; t: string; save_properties: bool = false) {...}{.
    base, raises: [GLerror, Exception], tags: [RootEffect].}
method setHintColor(self: EditTextRef; color: ColorRef) {...}{.base, raises: [],
    tags: [].}
method handle(self: EditTextRef; event: InputEvent; mouse_on: var NodeRef) {...}{.
    raises: [Exception, GLerror], tags: [RootEffect].}
Handles user input. Thi uses in the window.nim.