Skip to content
doyousketch2 edited this page Sep 13, 2019 · 7 revisions

Input:

Corresponds to: Fl_Input, Fl_Input_

Inherits from: Widget

Constructors

  • fl.Input( int X, int Y, int W, int H, *str label ) ==> userdata Widget
  • fl.Input{ table entries } ==> userdata Widget

    ( table constructor syntax )


Functions

  • methods defined for Widget userdata type
  • obj:copy( int from ) ==> bool success

    ( 0 selection, 1 clipboard. returns 1 if copied )

  • obj:copy_cuts() ==> bool success ( 0 if no change )
  • obj:cut() ==> bool success

    ( Delete current selection. return 0 )

  • obj:cut( int bytes ) ==> bool success

    ( delete bytes after cursor. return 0 )

  • obj:cut( int begin, int end ) ==> bool success

    ( del chars between begin & end. return 0 )

  • obj:index( int i ) ==> int char

    ( Return char at index i )

  • obj:insert( str text ) ==> bool success

    ( insert text at cursor. return 0 )

  • obj:replace( int begin, int end, *str text ) ==> bool success

    ( delete from begin to end, then insert text. return 0 )

  • obj:size( int W, int H ) set

    ( width & height of widget )

  • obj:undo()

    ( undo changes to text buffer )


Properties

  • properties defined for Widget userdata type
  • obj.mark ==> int index get

    obj.mark = int index set
    ( index in text )

  • obj.wrap ==> int status get

    obj.wrap = int status set
    ( only for multi-line input )

  • obj.value ==> str text get

    obj.value = str text set

  • obj.tab_nav ==> bool val get

    obj.tab_nav = bool val set
    ( default 1 advance focus. 0 insert tab char )

  • obj.readonly ==> bool val get

    obj.readonly = bool val set
    ( 0 = editable )

  • obj.shortcut ==> userdata key get

    obj.shortcut = int|str|userdata key set
    ( shortcut key for widget, see Lua vs Cpp for adding key combos )

  • obj.textfont ==> str index get

    obj.textfont = int|str font set
    ( Fl_Font index or name )

  • obj.textsize ==> int size get

    obj.textsize = int size set
    ( in pixels )

  • obj.textcolor ==> userdata color get

    obj.textcolor = int|userdata color set
    ( Fl_color )

  • obj.value_size ==> int bytes get ( corresponds to Fl_Input_::size() )
  • obj.cursor_color ==> userdata color get

    obj.cursor_color = int|userdata color set
    ( Fl_color )

  • obj.maximum_size ==> int max get

    obj.maximum_size = int max set
    ( max length of input field in chars )

  • obj.cursor_position ==> int index get

    obj.cursor_position = int index set
    ( corresponds to Fl_Input_::position( i ) )

  • obj.type ==> str mode get

    obj.type = str mode set

    • "FL_NORMAL_INPUT" (default)
    • "FL_FLOAT_INPUT"
    • "FL_INT_INPUT"
    • "FL_HIDDEN_INPUT"
    • "FL_MULTILINE_INPUT"
    • "FL_SECRET_INPUT"
    • "FL_NORMAL_OUTPUT"
    • "FL_MULTILINE_OUTPUT"
    • "FL_MULTILINE_INPUT_WRAP"
    • "FL_MULTILINE_OUTPUT_WRAP"
Clone this wiki locally