Class SelCWindow
Curses' based textual windows.
Methods
| SelCWindow:keypad (keypad) | enable/disable abbreviation of function keys |
| SelCWindow:attrset (value) | Set all attributs of the window. |
| SelCWindow:attron (value) | Turn ON given attributs of the window. |
| SelCWindow:attroff (value) | Turn OFF given attributs of the window. |
| SelCWindow:Move (x, y) | move curses window cursor. |
| SelCWindow:Cursor (x, y) | move curses window cursor. |
| SelCWindow:GetXY () | get curses cursor coordinates. |
| SelCWindow:GetCursor () | get curses cursor coordinates. |
| SelCWindow:print (text) | write a string on the window. |
| SelCWindow:PrintAt (text, x, y) | write a string on the window at the given position |
| SelCWindow:getch () | read a character from stdin. |
| SelCWindow:addch () | add a character (with attributes) to a curses window, then advance the cursor. |
| SelCWindow:getstr () | read a string from stdin. |
| SelCWindow:getnstr (max) | read a fixed sized string from stdin. |
| SelCWindow:GetstrAt (x, y) | read a string from stdin and provide its position. |
| SelCWindow:GetnstrAt (x, y, max) | read a fixed sized string from stdin and provide its position. |
| SelCWindow:AddchAt (x, y) | add a character (with attributes) to a curses window, provide the cursor position then advance the cursor. |
| SelCWindow:refresh () | refresh terminal from curses buffer. |
| SelCWindow:border () | Draw window border. |
| SelCWindow:erase () | copy blanks to every position in the window. |
| SelCWindow:clear () | copy blanks to every position in the window and mark all of the buffer as dirty. |
| SelCWindow:clrtoeol () | erase the current line to the right of the cursor, inclusive, to the end of the current line. |
| SelCWindow:clrtobot () | erase from the cursor to the end of window. |
| SelCWindow:GetSize () | Get window's size. |
| SelCWindow:HLine (length, char) | draw a horizontal (left to right) line starting at the current cursor position. |
| SelCWindow:HLineAt (x, y, length, char) | draw a horizontal (left to right) line starting at the given position. |
| SelCWindow:VLine (length, char) | draw a vertical (top to bottom) line starting at the current cursor position. |
| SelCWindow:VLineAt (x, y, length, char) | draw a vertical (top to bottom) line starting at the given position. |
| SelCWindow:DerWin (x, y, width, length) | Create a subwindow |
Methods
- SelCWindow:keypad (keypad)
-
enable/disable abbreviation of function keys
Parameters:
- keypad boolean
- SelCWindow:attrset (value)
-
Set all attributs of the window.
Parameters:
- value integer
- SelCWindow:attron (value)
-
Turn ON given attributs of the window.
Parameters:
- value integer
- SelCWindow:attroff (value)
-
Turn OFF given attributs of the window.
Parameters:
- value integer
- SelCWindow:Move (x, y)
-
move curses window cursor.
Parameters:
- x integer
- y integer
- SelCWindow:Cursor (x, y)
-
move curses window cursor.
Parameters:
- x integer
- y integer
- SelCWindow:GetXY ()
-
get curses cursor coordinates.
Returns:
- integer x
- integer y
- SelCWindow:GetCursor ()
-
get curses cursor coordinates.
Returns:
- integer x
- integer y
- SelCWindow:print (text)
-
write a string on the window.
Parameters:
- text string
- SelCWindow:PrintAt (text, x, y)
-
write a string on the window at the given position
Parameters:
- text string
- x integer
- y integer
- SelCWindow:getch ()
-
read a character from stdin.
Returns:
-
integer
character read
- SelCWindow:addch ()
-
add a character (with attributes) to a curses window, then advance the cursor.
Returns:
-
integer
character read
- SelCWindow:getstr ()
-
read a string from stdin.
Returns:
- SelCWindow:getnstr (max)
-
read a fixed sized string from stdin.
Parameters:
- max integer max amount of characters to read
Returns:
- SelCWindow:GetstrAt (x, y)
-
read a string from stdin and provide its position.
Parameters:
- x integer cursor position
- y integer cursor position
Returns:
- SelCWindow:GetnstrAt (x, y, max)
-
read a fixed sized string from stdin and provide its position.
Parameters:
- x integer cursor position
- y integer cursor position
- max integer max amount of characters to read
Returns:
- SelCWindow:AddchAt (x, y)
-
add a character (with attributes) to a curses window, provide the cursor position then advance the cursor.
Parameters:
- x integer cursor position
- y integer cursor position
Returns:
-
integer
character read
- SelCWindow:refresh ()
- refresh terminal from curses buffer.
- SelCWindow:border ()
-
Draw window border.
The borders generated by this function are "inside borders".
- SelCWindow:erase ()
- copy blanks to every position in the window.
- SelCWindow:clear ()
- copy blanks to every position in the window and mark all of the buffer as dirty.
- SelCWindow:clrtoeol ()
- erase the current line to the right of the cursor, inclusive, to the end of the current line.
- SelCWindow:clrtobot ()
- erase from the cursor to the end of window.
- SelCWindow:GetSize ()
-
Get window's size.
Returns:
- integer x width
- integer y length
- SelCWindow:HLine (length, char)
-
draw a horizontal (left to right) line starting at the current cursor position.
The current cursor position is not changed.
Parameters:
- length integer
- char integer or nil Character to use for drawing (default : '-')
- SelCWindow:HLineAt (x, y, length, char)
-
draw a horizontal (left to right) line starting at the given position.
Parameters:
- x integer origin
- y integer origin
- length integer
- char integer or nil Character to use for drawing (default : '-')
- SelCWindow:VLine (length, char)
-
draw a vertical (top to bottom) line starting at the current cursor position.
The current cursor position is not changed.
Parameters:
- length integer
- char integer or nil Character to use for drawing (default : '|')
- SelCWindow:VLineAt (x, y, length, char)
-
draw a vertical (top to bottom) line starting at the given position.
Parameters:
- x integer origin
- y integer origin
- length integer
- char integer or nil Character to use for drawing (default : '|')
- SelCWindow:DerWin (x, y, width, length)
-
Create a subwindow
Parameters:
- x integer origin related to its parent
- y integer origin related to its parent
- width integer
- length integer