Difference between revisions of "IUP/Controls/IupMultiLine"

From Vendetta Lua
Jump to: navigation, search
(Created page with "__NOTOC__ __NOEDITSECTION__ Creates an editable field with one or more lines. ===Creation=== :iup.multiline{} -> (elem: ihandle) :This function returns the identifier of the...")
 
 
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 
__NOEDITSECTION__
 
__NOEDITSECTION__
 +
{{IUP Controls}}
 
Creates an editable field with one or more lines.
 
Creates an editable field with one or more lines.
  
 
===Creation===
 
===Creation===
:iup.multiline{} -> (elem: ihandle)
+
    iup.multiline{} -> (elem: ihandle)
  
 
:This function returns the identifier of the created multiline, or nil if an error occurs.
 
:This function returns the identifier of the created multiline, or nil if an error occurs.
Line 16: Line 17:
 
:'''BORDER''': Shows a frame around the multiline. Default: "YES".
 
:'''BORDER''': Shows a frame around the multiline. Default: "YES".
  
:'''[[IUP/Attributes/CARET|CARET]]''': Position of the insertion point in the multiline.
+
:'''[[IUP/Attributes/CARET|CARET]]''': Character position of the insertion point in the multiline.
  
 
:'''[[IUP/Attributes/READONLY|READONLY]]''': Allows the user only to read the contents, without changing it. Possible values: "YES", "NO" (default).
 
:'''[[IUP/Attributes/READONLY|READONLY]]''': Allows the user only to read the contents, without changing it. Possible values: "YES", "NO" (default).
Line 27: Line 28:
  
 
:'''VALUE''': Text typed by the user. The '\n' character indicates line change. Default: nil
 
:'''VALUE''': Text typed by the user. The '\n' character indicates line change. Default: nil
 +
 +
:'''WANTSLONGPRESS''': Possible values: "YES", "NO"
 +
 +
:'''DONT_RECURSE''': Possible values: "YES", "NO"
 +
 +
:'''MARGINX''': Possible values: number
 +
 +
:'''MARGINY''': Possible values: number
 +
 +
:'''[[IUP/Attributes/IMAGE|IMAGE]]'''
 +
 +
:'''BOXCOLOR''': The color of the IupMultiLine when it is not selected.
 +
 +
:'''MOUSEOVERBOXCOLOR''': The color of the control when it is selected or the mouse hovers over it.
 +
 +
:'''SCROLL''': Possible values: "PAGEUP", "PAGEDOWN", "TOP", "BOTTOM"
  
 
===Callbacks===
 
===Callbacks===
Line 32: Line 49:
 
:[[IUP/Callbacks/ACTION|ACTION]]: Action generated when a keyboard event occurs. The callback also receives the typed key.
 
:[[IUP/Callbacks/ACTION|ACTION]]: Action generated when a keyboard event occurs. The callback also receives the typed key.
  
::elem:action('''c''': number, '''after''': string) -> (ret: number) [in IupLua]
+
    elem:action('''c''': number, '''after''': string) -> (ret: number) [in IupLua]
  
 
::'''c''': Identifier of the typed key. Please refer to the Keyboard Codes table for a list of possible values.
 
::'''c''': Identifier of the typed key. Please refer to the Keyboard Codes table for a list of possible values.
Line 39: Line 56:
 
::If the function returns IUP_IGNORE, the system will ignore the typed character. If the function returns the code of any other key, IUP will treat this new key instead of the one typed by the user.
 
::If the function returns IUP_IGNORE, the system will ignore the typed character. If the function returns the code of any other key, IUP will treat this new key instead of the one typed by the user.
  
:[[IUP/Callbacks/CARET_CB|CARET_CB]]: Action generated when the caret/cursor position is changed.
+
:[[IUP/Callbacks/CARET_CB|CARET_CB]]: Action generated on mouse click or before ACTION.
  
::elem:caret_cb('''row''', '''col''': number) -> (ret: number)
+
    elem:caret_cb('''row''', '''col''': number) -> (ret: number)
  
::'''row''', '''col''': Row and column number. VO: "1, 1" if the alignment is ALEFT or ARIGHT.  "0, 0" if the alignment is ACENTER
+
::'''row''', '''col''': Row and column number. Possible values: "1, 1" if the alignment is ALEFT or ARIGHT.  "0, 0" if the alignment is ACENTER
  
 +
:GETFOCUS_CB
 +
 +
:KILLFOCUS_CB
 +
 +
:ENTERWINDOW_CB
 +
 +
:LEAVEWINDOW_CB
 +
 +
:DRAGENTER_CB
 +
 +
:DRAGLEAVE_CB
 +
 +
:DRAGOVER_CB
 +
 +
:DROP_CB
 
::Triggers on mouse-click or before ACTION
 
::Triggers on mouse-click or before ACTION
  
Line 52: Line 84:
  
 
:Since all the keys are processed to change focus to the next element press <Ctrl>+<Tab>. The "DEFAULTENTER" button will not be processed, but the "DEFAULTESC" will.
 
:Since all the keys are processed to change focus to the next element press <Ctrl>+<Tab>. The "DEFAULTENTER" button will not be processed, but the "DEFAULTESC" will.
 +
 +
:Clicking on the control will only set the caret to the first row ('''VERIFY''')
 +
 +
[[Category:IUP Controls]]

Latest revision as of 21:47, 11 May 2023


Controls

Dialog
Fill
Hbox
Vbox
Zbox
Cbox
Radio
Button
Canvas
Frame
Label
List
Multiline
Text
Toggle
Progress Bar
Matrix
Tree
Navmap

Creates an editable field with one or more lines.

Creation

   iup.multiline{} -> (elem: ihandle)
This function returns the identifier of the created multiline, or nil if an error occurs.

Attributes

APPEND: Inserts a text at the end of the multiline.
INSERT: Inserts a text in the caret's position.
BORDER: Shows a frame around the multiline. Default: "YES".
CARET: Character position of the insertion point in the multiline.
READONLY: Allows the user only to read the contents, without changing it. Possible values: "YES", "NO" (default).
NC: Maximum number of characters.
SIZE: Multiline size. Default: room for 5 characters in 1 line.
ALIGNMENT: Label's alignment. Possible values: "ALEFT", "ARIGHT", "ACENTER". Default: "ALEFT".
VALUE: Text typed by the user. The '\n' character indicates line change. Default: nil
WANTSLONGPRESS: Possible values: "YES", "NO"
DONT_RECURSE: Possible values: "YES", "NO"
MARGINX: Possible values: number
MARGINY: Possible values: number
IMAGE
BOXCOLOR: The color of the IupMultiLine when it is not selected.
MOUSEOVERBOXCOLOR: The color of the control when it is selected or the mouse hovers over it.
SCROLL: Possible values: "PAGEUP", "PAGEDOWN", "TOP", "BOTTOM"

Callbacks

ACTION: Action generated when a keyboard event occurs. The callback also receives the typed key.
   elem:action(c: number, after: string) -> (ret: number) [in IupLua]
c: Identifier of the typed key. Please refer to the Keyboard Codes table for a list of possible values.
after: Represents the new text value if the key is validated (i.e. the callback returns IUP_DEFAULT).
If the function returns IUP_IGNORE, the system will ignore the typed character. If the function returns the code of any other key, IUP will treat this new key instead of the one typed by the user.
CARET_CB: Action generated on mouse click or before ACTION.
   elem:caret_cb(row, col: number) -> (ret: number)
row, col: Row and column number. Possible values: "1, 1" if the alignment is ALEFT or ARIGHT. "0, 0" if the alignment is ACENTER
GETFOCUS_CB
KILLFOCUS_CB
ENTERWINDOW_CB
LEAVEWINDOW_CB
DRAGENTER_CB
DRAGLEAVE_CB
DRAGOVER_CB
DROP_CB
Triggers on mouse-click or before ACTION

Notes

The multiline has a limitation of about 64,000 characters.
Since all the keys are processed to change focus to the next element press <Ctrl>+<Tab>. The "DEFAULTENTER" button will not be processed, but the "DEFAULTESC" will.
Clicking on the control will only set the caret to the first row (VERIFY)