2018-04-07 06:05:47 +10:00
|
|
|
The "neoux" (aka NeoUX) library is a
|
|
|
|
UI framework for KittenOS NEO, meant
|
|
|
|
to provide a consistent set of
|
|
|
|
controls and a consistent way to
|
|
|
|
navigate the UI in any given case.
|
|
|
|
|
|
|
|
Thus, it's not used by text editing
|
|
|
|
programs such as Neolithic.
|
|
|
|
|
|
|
|
To get ahold of NeoUX in your app,
|
|
|
|
use code similar to:
|
|
|
|
|
|
|
|
local event, neoux
|
|
|
|
event = require("event")(neo)
|
|
|
|
neoux = require("neoux")(event, neo)
|
|
|
|
|
|
|
|
The neo table is used for retrieving
|
|
|
|
the required accesses for APIs.
|
|
|
|
|
|
|
|
The NeoUX API is divided into three
|
|
|
|
parts - the part that connects it to
|
|
|
|
Everest & utility functions, the UI
|
|
|
|
framework's "tcwindow" root, and the
|
|
|
|
basic set of controls.
|
|
|
|
|
|
|
|
The most reliable reference on the
|
|
|
|
API a control implements is given
|
|
|
|
at the top of libs/neoux.lua, and
|
|
|
|
for updatability reasons will not
|
|
|
|
be repeated here, except with the
|
|
|
|
note that "xI"/"yI" is within-char
|
|
|
|
position from 0 to 1.
|
|
|
|
|
2018-04-09 09:04:40 +10:00
|
|
|
Main functions:
|
|
|
|
|
|
|
|
fileDialog(mode[, callback]):
|
|
|
|
Creates a file dialog, returning a
|
|
|
|
file wrapper (see ul-fwrap) on
|
|
|
|
success, or nil on failure.
|
|
|
|
If a callback is given, then nil is
|
|
|
|
always returned immediately, and
|
|
|
|
the callback is called when the
|
|
|
|
dialog has shown.
|
|
|
|
mode is the mode used for the file,
|
|
|
|
so see ul-fwrap for values.
|
|
|
|
|
|
|
|
neoux.create = TODO
|
|
|
|
function (w, h, title, callback)
|
|
|
|
callback(window, evt, ...)
|
|
|
|
|
|
|
|
pad: See ul-fmttx, but loaded on
|
|
|
|
demand and unloaded after use.
|
|
|
|
|
|
|
|
fmtText: See ul-fmttx, but loaded on
|
|
|
|
demand and unloaded after use.
|
|
|
|
|
|
|
|
neoux.tcwindow = TODO
|
|
|
|
function (w, h, controls, closing,
|
|
|
|
bg, fg, selIndex)
|
|
|
|
|
|
|
|
startDialog(fmt, title, wait):
|
|
|
|
Shows a text dialog.
|
|
|
|
fmt is some un-safeTextFormat'd
|
|
|
|
text for the dialog.
|
|
|
|
title can be nil, or more un-STF'd
|
|
|
|
text for the dialog title.
|
|
|
|
wait can be nil/false to not wait,
|
|
|
|
and otherwise.
|
|
|
|
|
|
|
|
UI framework controls (TODO):
|
|
|
|
|
|
|
|
neoux.tcrawview =
|
|
|
|
function (x, y, lines)
|
|
|
|
table of lines not STF'd
|
|
|
|
neoux.tchdivider =
|
|
|
|
function (x, y, w)
|
|
|
|
neoux.tcvdivider =
|
|
|
|
function (x, y, h)
|
|
|
|
neoux.tcbutton =
|
|
|
|
function (x, y, text, callback)
|
|
|
|
callback(window)
|
|
|
|
neoux.tcfield =
|
|
|
|
function (x, y, w, textprop)
|
|
|
|
textprop(newval) -> nil
|
|
|
|
textprop() -> val
|
2018-04-05 02:15:51 +10:00
|
|
|
|
|
|
|
-- This is released into
|
|
|
|
the public domain.
|
|
|
|
-- No warranty is provided,
|
|
|
|
implied or otherwise.
|
|
|
|
|