Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
ref:uifc [2020/11/28 10:54] – [Javascript Interface] mlong | ref:uifc [2020/11/28 13:58] – [UIFC Input Keyboard Modes] remove c/js chart mlong | ||
---|---|---|---|
Line 4: | Line 4: | ||
UIFC (User InterFaCe) is the text mode full-screen user interface library used by [[util: | UIFC (User InterFaCe) is the text mode full-screen user interface library used by [[util: | ||
- | |||
- | ===== Implementations ===== | ||
- | |||
- | Over the years, a few different implementations have been ported/ | ||
- | |||
- | ==== uifc.c ==== | ||
- | |||
- | The original DOS 16-bit implementation, | ||
- | |||
- | ==== uifc32.c ==== | ||
- | |||
- | The 32-bit port of the DOS version, initialized using uifcini32(). | ||
- | |||
- | ==== uifcx.c ==== | ||
- | |||
- | The command-line version using standard I/O, initialized using uifcinix(). | ||
===== Interfaces ===== | ===== Interfaces ===== | ||
Line 48: | Line 32: | ||
| Paste item | '' | | Paste item | '' | ||
+ | |||
+ | ===== Development Documentation ===== | ||
==== C Interface ==== | ==== C Interface ==== | ||
+ | |||
+ | === uifc.h === | ||
+ | |||
+ | The C API is exposed through the header file: '' | ||
+ | |||
+ | === uifc32.c === | ||
+ | |||
+ | The 32-bit port of the DOS version, initialized using uifcini32(). | ||
+ | |||
+ | === uifcx.c === | ||
+ | |||
+ | The command-line version using standard I/O, initialized using uifcinix(). | ||
+ | |||
==== Javascript Interface ==== | ==== Javascript Interface ==== | ||
See [[http:// | See [[http:// | ||
+ | |||
+ | When using uifc.list, you can pass the WIN_SAV option, along with a context object to preserve the menu selection index. | ||
+ | |||
+ | The context object is created as follows: | ||
+ | |||
+ | < | ||
+ | var ctx = new uifc.list.CTX( | ||
+ | 0, // current | ||
+ | 0, // bar | ||
+ | 0, // left | ||
+ | 0, // top | ||
+ | 0 // width | ||
+ | ); | ||
+ | </ | ||
==== UIFC List Window Flags ==== | ==== UIFC List Window Flags ==== | ||
- | ^ Flag ^ Description | + | ^ Flag ^ Description ^ |
- | | WIN_ORG | Original menu, destroy valid screen area | + | | WIN_ORG | Original menu, destroy valid screen area | |
- | | WIN_SAV | Save existing text and replace when finished (use with context object) | + | | WIN_SAV | Save existing text and replace when finished (use with context object) | |
- | |||| | + | || |
- | | WIN_ACT | Menu remains active after a selection | + | | WIN_ACT | Menu remains active after a selection | |
- | | WIN_INSACT | Remains active after insert key | Y | Y | | + | | WIN_INSACT | Remains active after insert key | |
- | | WIN_DELACT | Remains active after delete key | Y | Y | | + | | WIN_DELACT | Remains active after delete key | |
- | | WIN_CHE | Stay active after escape if changes | + | | WIN_CHE | Stay active after escape if changes | |
- | | WIN_EXTKEYS | Return on any keypress. Return value is -2 - keyvalue | + | | WIN_EXTKEYS | Return on any keypress. Return value is -2 - keyvalue | |
- | | WIN_POP | Exit the list as though ESC was pressed. For use after WIN_EXTKEYS or WIN_DYN | + | | WIN_POP | Exit the list as though ESC was pressed. For use after WIN_EXTKEYS or WIN_DYN | |
- | | WIN_SEL | Exit the list as though ENTER was pressed. For use after WIN_EXTKEYS or WIN_DYN | + | | WIN_SEL | Exit the list as though ENTER was pressed. For use after WIN_EXTKEYS or WIN_DYN | |
- | | WIN_ESC | Screen is active when escape is hit | Y | Y | | + | | WIN_ESC | Screen is active when escape is hit | |
- | | WIN_EDITACT | Remain active after edit key | - | Y | | + | | WIN_EDITACT | Remain active after edit key | |
|| | || | ||
- | | WIN_L2R | Center the window based on width | Y | Y | | + | | WIN_L2R | Center the window based on width | |
- | | WIN_T2B | Center the window based on height | + | | WIN_T2B | Center the window based on height | |
- | | WIN_RHT | Place window against right side of screen | + | | WIN_RHT | Place window against right side of screen | |
- | | WIN_MID | Place window in middle of screen | + | | WIN_MID | Place window in middle of screen | |
- | | WIN_BOT | Place window against bottom of screen | + | | WIN_BOT | Place window against bottom of screen | |
- | | WIN_FIXEDHEIGHT | Use light_height from uifc struct | + | | WIN_FIXEDHEIGHT | Use light_height from uifc struct | |
- | | WIN_NOBRDR | Do not draw a border around the window | + | | WIN_NOBRDR | Do not draw a border around the window | |
- | |||| | + | ||| |
- | | WIN_IMM | Draw window and return immediately | + | | WIN_IMM | Draw window and return immediately | |
- | | WIN_INACT | Draw window inactive, intended for use with WIN_IMM | + | | WIN_INACT | Draw window inactive, intended for use with WIN_IMM | |
- | |||| | + | ||| |
- | | WIN_DYN | Dynamic window, return at least every second | + | | WIN_DYN | Dynamic window, return at least every second | |
- | | WIN_REDRAW | Force redraw on dynamic window | + | | WIN_REDRAW | Force redraw on dynamic window | |
- | | WIN_NODRAW | Force not to redraw on dynamic window | + | | WIN_NODRAW | Force not to redraw on dynamic window | |
- | |||| | + | ||| |
- | | WIN_INS | Allow user to use insert key | Y | Y | | + | | WIN_INS | Allow user to use insert key | |
- | | WIN_DEL | Allows use to use delete key | Y | Y | | + | | WIN_DEL | Allows use to use delete key | |
- | | WIN_COPY | Allows F5 to Get/Copy a menu item | Y | Y | | + | | WIN_COPY | Allows F5 to Get/Copy a menu item | |
- | | WIN_PASTE | Allows F6 to Put/Paste a menu item | Y | Y | | + | | WIN_PASTE | Allows F6 to Put/Paste a menu item | |
- | | WIN_XTR | Add extra line at end for inserting at end | Y | Y | | + | | WIN_XTR | Add extra line at end for inserting at end | |
- | | WIN_CUT | Allow Ctrl-X/Cut a Menu Item | Y | Y | | + | | WIN_CUT | Allow Ctrl-X/Cut a Menu Item | |
- | | WIN_EDIT | Allow F2 to edit a menu item | Y | Y | | + | | WIN_EDIT | Allow F2 to edit a menu item | |
- | | WIN_PASTEXTR | Allow paste into extra (blank) item | Y | - | | + | | WIN_PASTEXTR | Allow paste into extra (blank) item | |
- | | WIN_GET | Alias for WIN_COPY | Y | - | | + | ||| |
- | | WIN_PUT | Alias for WIN_PASTE | Y | - | | + | | WIN_HLP | Parse Help Codes | |
- | |||| | + | | WIN_PACK | Pack text in window (no padding) | |
- | | WIN_HLP | Parse Help Codes | Y | - | | + | | WIN_FAT | Do not pad outside borders | |
- | | WIN_PACK | Pack text in window (no padding) | + | | WIN_UNGETMOUSE | If the mouse is clicked outside window, put mouse even back into even queue | |
- | | WIN_FAT | Do not pad outside borders | + | |
- | | WIN_UNGETMOUSE | If the mouse is clicked outside window, put mouse even back into even queue | Y | Y | | + | |
==== UIFC Input Keyboard Modes ==== | ==== UIFC Input Keyboard Modes ==== | ||
- | ^ Flag ^ Description | + | ^ Flag ^ Description ^ |
- | | K_NONE | No special behavior | + | | K_NONE | No special behavior | |
- | | K_UPPER | Converts all letters to upper case | Y | Y | | + | | K_UPPER | Converts all letters to upper case | |
- | | K_UPRLWR | Upper/lower case automatically | + | | K_UPRLWR | Upper/lower case automatically | |
- | | K_NUMBER | Allow numbers only | Y | Y | | + | | K_NUMBER | Allow numbers only | |
- | | K_WRAP | Allows word wrap | Y | Y | | + | | K_WRAP | Allows word wrap | |
- | | K_MSG | Allows ANSI, Ctrl-N, Ctrl-A, Ctrl-G | + | | K_MSG | Allows ANSI, Ctrl-N, Ctrl-A, Ctrl-G | |
- | | K_SPIN | Spinning cursor | + | | K_SPIN | Spinning cursor | |
- | | K_LINE | Input line (inverse color) | + | | K_LINE | Input line (inverse color) | |
- | | K_EDIT | Edit string | + | | K_EDIT | Edit string |
- | | K_CHAT | In chat multi-chat | + | | K_CHAT | In chat multi-chat | |
- | | K_NOCRLF | Don't print CRLF after string input | Y | Y | | + | | K_NOCRLF | Don't print CRLF after string input | |
- | | K_ALPHA | Only allow alphabetic characters | + | | K_ALPHA | Only allow alphabetic characters | |
- | | K_SCANNING | UPC Scanner is active, return on ' | + | | K_SCANNING | UPC Scanner is active, return on ' |
- | | K_LOWPRIO | Low-priority input | Y | Y | | + | | K_LOWPRIO | Low-priority input | |
- | | K_NOEXASC | No extended ASCII allowed | + | | K_NOEXASC | No extended ASCII allowed | |
- | | K_E71DETECT | Detect E-7-1 terminal type | Y | Y | | + | | K_E71DETECT | Detect E-7-1 terminal type | |
- | | K_AUTODEL | Auto-delete text (used with K_EDIT) | + | | K_AUTODEL | Auto-delete text (used with K_EDIT) | |
- | | K_COLD | Possible cold key mode | Y | Y | | + | | K_COLD | Possible cold key mode | |
- | | K_NOECHO | Don't echo input | Y | Y | | + | | K_NOECHO | Don't echo input | |
- | | K_TAB | Treat TAB as CR | Y | Y | | + | | K_TAB | Treat TAB as CR | |
- | | K_LEFTEXIT | Allow exit from getstr() with backspace | + | | K_LEFTEXIT | Allow exit from getstr() with backspace | |
- | | K_USEOFFSET | Use console.getstr_offset with getstr() | + | | K_USEOFFSET | Use console.getstr_offset with getstr() | |
- | | K_NOSPIN | Do not honor user's spinning cursor | + | | K_NOSPIN | Do not honor user's spinning cursor | |
- | | K_ANSI_CPR | ANSI Cursor Position Report expected | + | | K_ANSI_CPR | ANSI Cursor Position Report expected | |
- | | K_TRIM | Trim white-space from both ends of str | Y | Y | | + | | K_TRIM | Trim white-space from both ends of str | |
- | | K_CTRLKEYS | No control-key handling in inkey() | + | | K_CTRLKEYS | No control-key handling in inkey() | |
- | | K_TABEXIT | Exit on TAB or BACKTAB | + | | K_TABEXIT | Exit on TAB or BACKTAB | |
- | | K_DECIMAL | Allow floating point numbers only | Y | Y | | + | | K_DECIMAL | Allow floating point numbers only | |
- | | K_DEUCEEXIT | Return on up/ | + | | K_DEUCEEXIT | Return on up/down/F2 | |
- | | K_MOUSEEXIT | Returns when mouse is clicked outside of input area (not window) | + | | K_MOUSEEXIT | Returns when mouse is clicked outside of input area (not window) | |
- | | K_PASSWORD | Do not display text while editing | + | | K_PASSWORD | Do not display text while editing | |
- | | K_FIND | Don't set the " | + | | K_FIND | Don't set the " |
==== UIFC List Return Input Masks ==== | ==== UIFC List Return Input Masks ==== |