[622:14] (extern: com.lehman.aussom.stdlib.curses.CursesTextBox) extends: component
The textbox component allows for editing of text fields and text areas. They can be read only or read and write.
textbox (string text, bool multiLine = true, int cols = null, int rows = null
)
Constructor that creates a textbox with the provided arguments.
text
is the textbox text value.multiLine
is a boolean with true for multiline support and false for not.cols
is an int with the size in columns.rows
is an int with the size in rows.null
newTextBox (bool multiLine = true
)
Helper that creates the new textbox.
multiLine
is a boolean with true for multiline and false for not.null
setText (string text
)
Sets the text for the text box.
text
is a string with the text to set.null
setValidation (string regexPattern
)
Sets the validation pattern for the textbox.
regexPattern
is a string with the regex pattern to match.null
setReadOnly (bool readOnly
)
Sets the read only boolean.
readOnly
is a boolean with true for read only and false for not.null
getText ()
Gets the text of the textbox.
A
string with the text.[525:14] (extern: com.lehman.aussom.stdlib.curses.CursesBorderLayout) extends: object
Border layout provides a similar layout to the swing border layout. The layoutpos enum can be used to specify the 5 different layout areas.
[910:14] (extern: com.lehman.aussom.stdlib.curses.CursesActionBox) extends: component
Is a component that provides a list of actions.
actionbox (list items
)
Constructor for the actionbox object.
items
is a list of pairs of ['name', ::callback].null
setItems (list items
)
Sets a list of items for the actionbox.
items
is a list of pairs of ['name', ::callback].null
addItem (list item
)
Adds an item pair to the actionbox.
item
is a pair with ['name', ::callback].null
[1034:21] static
(extern: com.lehman.aussom.stdlib.curses.CursesFileDialog) extends: object
Dialog filedialog provides file chooser support.
show (object gui, string title = "", string desc = "", string actionLabel = ""
)
Opens a modal file dialog window with the provided arguments.
gui
is the gui object.title
is a string with the title to use.desc
is a string with the description for the dialog.actionLabel
is a string with the action button text.A
string with the selected file.[322:14] (extern: com.lehman.aussom.stdlib.curses.Screen) extends: object
Implementation of the screen object.
start ()
Starts the screen.
null
stop ()
Stops the screen.
null
setColor (string Color
)
Sets the text color to the specified color.
Color
is a string with the color. (enum color)null
setBgColor (string Color
)
Sets the background color to the specified color.
Color
is a string with the color. (enum color)null
putString (int x, int y, string str
)
Writes a string at the provided coordinates.
x
is an int with the x coordinate.y
is an int with the y coordinate.str
is a string to write.null
clear ()
Clears the screen.
null
refresh ()
Writes content from the back buffer to the front buffer effectively updating the screen.
null
getKey ()
Blocking call that gets a key stroke and returns it as a keyStroke object.
A
keyStroke object.doResizeIfNecessary ()
This method can be called at the beginning of your rendering code to handle screen resize events and properly resize the screen buffers.
null
setPos (int col, int row
)
Sets the cursor position to the provided location.
col
is an int with the column.row
is an int with the row.null
[274:14] (extern: com.lehman.aussom.stdlib.curses.CursesKeyStroke) extends: object
This object is returned from get key function calls such as getKey() and pollKey().
getChar ()
For key strokes of normal characters this gets the character value. Letters, digits, symbols ..
A
character.getEventTime ()
Gets the event time the key was pressed.
An
integer with epoch time.getKeyType ()
Gets the key type. Compare this to keyType values.
A
string with the key type.isAltDown ()
Is the alt key down.
A
boolean with true if the key is down.isCtrlDown ()
Is the control key down.
A
boolean with true if the key is down.isShiftDown ()
Is the shift key down.
A
boolean with true if the key is down.toString ()
Returns a string representation of the keyStroke object.
A
sring representing the keyStroke.[479:14] (extern: com.lehman.aussom.stdlib.curses.CursesLinearLayout) extends: object
Linear layout lays out components in a single direction, either vertical or horizontal. Direction is specified in direction enum.
linearlayout (string direct = "vertical"
)
Layout constructor takes the layout direction as an argument.
direct
is the direction for the layout. (enum direction)null
setDirection (string direct
)
Sets the layout direction.
direct
is the direction for the layout. (enum direction)null
[1017:21] static
(extern: com.lehman.aussom.stdlib.curses.CursesInputDialog) extends: object
Dialog inputdialog prompts for text input.
show (object gui, string title = "", string desc = "", string initText = "", int cols = null, int rows = null
)
Opens an input modal dialog window with the provided arguments.
gui
is the gui object.title
is a string with the title to use.desc
is a string with the description.is
a string with the input initial text.cols
is an int with the number of cols for the input.rows
is an int with the number of rows for the input.A
string with the input result.[133:21] static
(extern: com.lehman.aussom.stdlib.curses.Curses) extends: object
The main curses class for primitive operations.
start ()
Starts basic curses support.
null
stop ()
Stops basic curses support.
null
enterPrivateMode ()
In private mode the screen is cleared, scrolling is disabled and the previous content is stored. When you exit private mode, the previous content is restored and displayed on screen again.
exitPrivateMode ()
Exits private mode.
null
setPos (int col, int row
)
Sets the cursor position.
col
is the column or x coordinate to use.row
is the row or y coordinate to use.null
putChar (string ch
)
Puts the provided character at the current position.
ch
is a string with a character to place at the current position.null
getRows ()
Gets the screen size in rows.
An
int with number of rows in the screen.getCols ()
Gets the screen size in cols.
An
int with the number of cols in a screen.flush ()
Flushes anything left in the buffer out to the device.
null
putString (int x, int y, string str
)
Puts the provided string at the provided coordinates.
x
is the x coordinate.y
is the y coordinate.str
is the string to write.null
putLine (int x1, int y1, int x2, int y2, string str
)
Draws a line of text with the provided start and end coordinates and the provided string.
x1
is the start x coordinate.y1
is the start y coordinate.x2
is the end x coordinate.y2
is the end y coordinate.str
is the string to write.null
setColor (string Color
)
Sets the text color with the provided color. It's recommended to use the color enum.
Color
is a string with the color value.null
setBgColor (string Color
)
Sets the background color with the provided color. It's recommended to use the color enum.
Color
is a string with the color value.null
enableStyle (string Style
)
Sets the provided style from the style enum.
Style
is a string with the style to set.null
disableStyle (string Style
)
Disables the provided style from the style enum.
Style
is a string with the style to disable.null
resetStyle ()
Resets all styles.
null
clearScreen ()
Clears the screen.
null
getKey ()
Blocking call that gets a key stroke from the keyboard and returns a keyStroke object.
A
keyStroke object with the pressed key info.pollKey ()
Non blocking call which gets the key stroke if available and returns it as a keyStroke object.
A
keyStroke object with the key info.[23:6] static
extends: object
Enum defines the curses styles.
[397:14] (extern: com.lehman.aussom.stdlib.curses.Gui) extends: object
Implementation of the GUI object.
gui (Screen, Color
)
Constructor creates a new gui object with the provided screen and color.
Screen
is the screen object.Color
is a string with the text color to set. (enum color)null
newGui (object Screen, string Color
)
Internal function for creating a new gui.
Screen
is the screen object.Color
is a string with the text color to set. (enum color)null
start ()
Starts the screen.
null
stop ()
Stops the screen.
null
addWindowAndWait (object win
)
Adds a window to the text gui system and then blocks.
win
is the window object to set for this gui.null
[1064:21] static
(extern: com.lehman.aussom.stdlib.curses.CursesActionDialog) extends: object
Dialog actiondialog provides action dialog support.
show (object gui, string title = "", string desc = "", list actions
)
Opens a modal action dialog window with the provided arguments.
gui
is the gui object.title
is a string with the title to use.desc
is a string with the description for the dialog.actions
is a list of pairs of ['name', ::callback].null
[473:14] (extern: com.lehman.aussom.stdlib.curses.CursesAbsoluteLayout) extends: object
Absolute layout allows for exact positioning.
[8:6] static
extends: object
Enum defines the curses colors.
[1049:21] static
(extern: com.lehman.aussom.stdlib.curses.CursesDirectoryDialog) extends: object
Dialog directorydialog provides directory chooser support.
show (object gui, string title = "", string desc = "", string actionLabel = ""
)
Opens a modal directory dialog window with the provided arguments.
gui
is the gui object.title
is a string with the title to use.desc
is a string with the description for the dialog.actionLabel
is a string with the action button text.A
string with the selected directory.[677:14] (extern: com.lehman.aussom.stdlib.curses.CursesButton) extends: component
The button component provides button functionality.
button (string text = "", callback cb
)
Constructor for button object.
text
is a string with the button text.cb
is a callback with the on-click handler.null
newButton (string text = "", callback cb
)
Helper function that creates a new button.
text
is a string with the button text.cb
is a callback with the on-click handler.null
setText (string text
)
Sets the button text.
text
is a string with the button text.null
getText ()
Gets the button text.
A
string with the button text.[1002:21] static
(extern: com.lehman.aussom.stdlib.curses.CursesDialog) extends: object
Standard text dialog.
show (object gui, string title = "", string text = "", string dlgBtn = ""
)
Opens a modal dialog window with the provided arguments.
gui
is the gui object.title
is a string with the title to use.text
is a string with the text for the dialog.dlgBtn
is a string with the dialog button from the dlgbtn enum.null
[838:14] (extern: com.lehman.aussom.stdlib.curses.CursesRadioBox) extends: component
The radiobox component provides a list of radio buttons.
radiobox (list items
)
Constructor for the radiobox object.
items
is a list of strings with the radiobox items.null
setItems (list items
)
Sets the radiobox items.
items
is a list of strings with the radiobox items.null
addItem (string item = ""
)
Adds an item to the radiobox.
item
is a string with the item to add.null
clear ()
Clears/removes the items from the radiobox.
null
clearSelected ()
Unselects selected items.
null
getSelected ()
Gets the selected item.
A
string with the selected item.getSelectedIndex ()
Gets the selected index.
An
integer with the index of the selected item.size ()
Gets the size of the radiobox items.
An
int with the number of items in the radiobox.isChecked (int index
)
Checks if the item at the provided index is selected.
index
is an int with the index to check.A
boolean with true if selected and false if not.remove (int index
)
Removes the item at the provided index.
index
is an int with the index to remove the item at.null
[778:14] (extern: com.lehman.aussom.stdlib.curses.CursesCheckBox) extends: component
The checkbox component provides a checkbox list.
checkbox (list items
)
Constructor for the checkbox object.
items
is a list of strings of each checkbox.null
setItems (list items
)
Sets the checkbox items.
items
is a list of strings of each checkbox.null
addItem (string item = ""
)
Adds an item to the checkbox list.
item
is a string with the item to add.null
clear ()
Clears the checkbox list.
null
getCheckedItems ()
Gets a list of checked items.
A
list of strings with checked items.size ()
Gets the checkbox list size.
An
int with the checkbox size.isChecked (int index
)
Checks to see if the checkbox is checked at the provided index.
index
is an int with the index to check.A
boolean with true for checked and false for not.remove (int index
)
Remove the checkbox item at the provided index.
index
is an int with the index to remove.null
[107:6] static
extends: object
Enum that defines dialog button options.
[501:14] (extern: com.lehman.aussom.stdlib.curses.CursesGridLayout) extends: object
Grid layout lays out components in a customizable grid structure.
gridlayout (int NumCols
)
Constructor for gridlayout takes the number of columns for the grid.
NumCols
is an int with the number of columns of the grid.null
newGridLayout (int NumCols
)
Private helper function creates a new gridlayout.
NumCols
is an int with the number of columns of the grid.null
[38:6] static
extends: object
Enum defines the curses keyboard keys.
[575:14] (extern: com.lehman.aussom.stdlib.curses.CursesPanel) extends: component
The panel component is a base element where other components can be placed.
setLayout (object layout
)
Sets a layout for the panel.
layout
is the layout object to set.null
add (object Component
)
Adds a component to the panel.
Component
is a component object to add.null
[440:14] (extern: com.lehman.aussom.stdlib.curses.Win) extends: object
Implementation of the GUI object.
setHints (list Hints
)
Sets the window hints. Use the winHint enum to supply the desired attributes.
Hints
is a list of strings with the window hints.null
set (object Component
)
Sets the component object for this window.
Component
is a curses component to set.null
setMenuBar (object MenuBar
)
Sets the curses menubar object.
MenuBar
is a menubar to set for the window.null
[938:14] (extern: com.lehman.aussom.stdlib.curses.CursesTable) extends: component
Is a component that provides table functionality.
table (list cols
)
Constructor for a table component.
cols
is an array of columns for the tables.null
setCols (list cols
)
Sets the cols of the tables. This resets the table.
cols
is an array of columns for the tables.null
addCol (string col
)
Adds a column to the table with the provided column.
col
is a string with the new column to add.addRow (list vals
)
Adds a row to the table with the provided list of values.
vals
is a list of values to set for the row.null
setAction (callback action = null
)
Sets an action handler to do an action when a row is selected.
action
is a callback to invoke when a row is selected. When called the argument is a list with the row values is provided.null
setVisibleCols (int cols
)
Sets the number of visible columns.
cols
is an int with the number of visible cols.null
setVisibleRows (int rows
)
Sets the number of visible rows.
rows
is an int with the number of visible rows.null
setViewTopRow (int row
)
Sets the view to row.
row
is an int with the view top row.null
[99:6] static
extends: object
Enum that defines a curses layout direction.
[83:6] static
extends: object
Enum that defines the curses window hint (styles).
[594:14] (extern: com.lehman.aussom.stdlib.curses.CursesLabel) extends: component
The label component is used to set text in the UI.
label (string text
)
Constructor that creates a label component with the provided text.
text
is a string with the label text.null
setText (string text
)
Sets the label text.
text
is a string with the label text.null
getText ()
Gets the label text.
A
string with the label text.[1092:14] (extern: com.lehman.aussom.stdlib.curses.CursesMenu) extends: object
When added to a menubar provides a dropdown type menu and sub menu items.
menu (string label
)
Constructor of a menu object with the provided label.
label
is a string with the menu label.null
newMenu (string label
)
Helper function that resets the menu object with the provided label.
label
is a string with the menu label.null
addItem (string label, callback action
)
Adds an item to the menu.
label
is a string with the item label.action
is a callback with the method to call when the action is invoked.null
[1079:14] (extern: com.lehman.aussom.stdlib.curses.CursesMenuBar) extends: object
Provides support for a top menubar.
add (object menu
)
Adds a menu object to the menubar.
menu
is a menu object to add to the menubar.null
[537:7] extends: object
Component is a class that all other components inherit from. It provides common functionality for all components.
setPos (int col, int row
)
Sets the position of the cursor on the screen.
col
is an int with the column.row
is an int with the row.null
setPrefSize (int cols, int rows
)
Sets the referred size. This is used for layouts like linear.
cols
is an int with the number of columns.rows
is an int with the number of rows.null
setSize (int cols, int rows
)
Sets the size of the component. This is used for absolute layout.
cols
is an int with the number of columns.rows
is an int with the number of rows.null
setLayoutData (string val
)
Sets the layout data. Use the layoutpos enum to provide position when using border layout.
val
is a string with the value.null
[122:6] static
extends: object
Enum that defines border layout positions.
[713:14] (extern: com.lehman.aussom.stdlib.curses.CursesComboBox) extends: component
The combobox component provides a dropdown type selector.
combobox (list items
)
Constructor for a combobox object.
items
is a list of strings with the items of the combobox.null
setItems (list items
)
Sets the combobox items.
items
is a list of strings with the items of the combobox.null
addItem (string item = ""
)
Adds an item to the combobox.
item
is a string with the item to add.null
clear ()
Clears the combobox.
null
size ()
Gets the size of the combobox.
An
int with the size.getItemAt (int index
)
Gets the item at the provided index.
index
is an int with the index to get the item at.A
string with the item at the provided index.getSelectedIndex ()
Gets the selected index.
An
int with the selected index.getSelectedItem ()
Gets the selected item.
A
string with the selected item.getText ()
Gets the combobox text string.
A
string with the combobox text.