Skip to content
doyousketch2 edited this page Sep 12, 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 ( index in text )
  • 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 ( 1 advance focus (default). 0 insert tab char )
  • obj.tab_nav = bool val set ( 1 advance focus (default). 0 insert tab char )
  • obj.readonly ==> bool val get ( non-zero if widget is read-only )
  • obj.readonly = bool val get ( 0 = editable )
  • obj.shortcut ==> userdata key get ( shortcut key for widget )
  • obj.shortcut = int|str|userdata key set
  • obj.textfont ==> str index get ( Fl_Font index )
  • obj.textfont = int|str font set ( Fl_Font index or name )
  • obj.textsize ==> int size get ( in pixels )
  • obj.textsize = int size set ( in pixels )
  • obj.textcolor ==> userdata color get ( Fl_color )
  • 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 ( Fl_color )
  • obj.cursor_color = int|userdata color set ( Fl_color )
  • obj.maximum_size ==> int max get ( maximum length of input field in chars )
  • obj.maximum_size = int max set ( maximum length of input field in chars )
  • obj.cursor_position ==> int index get ( position of cursor, corresponds to Fl_Input_::position() )
  • obj.cursor_position = int index set ( position of cursor, corresponds to Fl_Input_::position( i ) )
  • obj.type ==> str mode get ( see below )
  • obj.type = str mode set ( see below )

The type property / mode of input widgets can be set to one of the following values:

  • "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