Unterabschnitte

Shell Script API

In diesem Kapitel ist die API dargestellt, wie sie für Shell-Script Programmierer zur Verfügung steht. Um die Hintergründe zu verstehen und effizienter arbeiten zu können, sollte man auch das Kapitel ''Scripting'' gelesen haben.

Damit die hier beschriebenen Funktionen und Konstanten im Script bekannt sind, sollte die API an oberster Stelle per Source-Include eingebunden werden. Unter eisfair existiert dazu die Datei ''cuilib'' die unter ''/var/install/include'' abgelegt ist. Einige Programme die eine Script- Erweiterung haben, können zusätzliche include-Dateien anbieten (z.B. die Datei ''ecelib'' des eisfair Konfigurationseditors), die unbedingt hinter der allgemeinen API eingebunden werden sollten.

#!/bin/sh

. /var/install/include/cuilib      # Standard API
. /var/install/include/ecelib      # optional weitere API

exec_dialog()
{
...
}

cui_init
cui_run

Konstanten

Tastatur-, Farb- und Window-Stil- Konstanten

Key constants

KEY_ENTER 10
KEY_F1 265
KEY_F2 266
KEY_F3 267
KEY_F4 268
KEY_F5 269
KEY_F6 270
KEY_F7 271
KEY_F8 272
KEY_F9 273
KEY_F10 274

Color constants

COLOR_BLACK 0
COLOR_RED 1
COLOR_GREEN 2
COLOR_BROWN 3
COLOR_BLUE 4
COLOR_MAGENTA 5
COLOR_CYAN 6
COLOR_LIGHTGRAY 7
COLOR_DARKGRAY 8
COLOR_LIGHTRED 9
COLOR_LIGHTGREEN 10
COLOR_YELLOW 11
COLOR_LIGHTBLUE 12
COLOR_LIGHTMAGENTA 13
COLOR_LIGHTCYAN 14
COLOR_WHITE 15

Window Styles

CWS_NONE '0'
CWS_BORDER '1'
CWS_CAPTION '2'
CWS_MINIMIZEBOX '4'
CWS_MAXIMIZEBOX '8'
CWS_CLOSEBOX '16'
CWS_SYSMENU '32'
CWS_RESIZE '64'
CWS_HIDDEN '256'
CWS_DISABLED '512'
CWS_TABSTOP '1024'
CWS_CENTERED '2048'
CWS_POPUP '4096'
CWS_MAXIMIZED '8192'
CWS_MINIMIZED '16384'
CWS_STATUSBAR '32768'
CWS_DEFOK '65536'
CWS_DEFCANCEL '131072'
EF_PASSWORD '16777216'
MF_AUTOWORDWRAP '16777216'
LB_SORTED '16777216'
LB_DESCENDING '33554432'

Window Hook Konstanten

Window Hook Konstanten

HOOK_CREATE '0'
HOOK_DESTROY '1'
HOOK_CANCLOSE '2'
HOOK_INIT '3'
HOOK_PAINT '4'
HOOK_NCPAINT '5'
HOOK_SIZE '6'
HOOK_SETFOCUS '7'
HOOK_KILLFOCUS '8'
HOOK_ACTIVATE '9'
HOOK_DEACTIVATE '10'
HOOK_KEY '11'
HOOK_MMOVE '12'
HOOK_MBUTTON '13'
HOOK_VSCROLL '14'
HOOK_HSCROLL '15'
HOOK_TIMER '16'

Control Callback Konstanten

Edit hook types

EDIT_SETFOCUS '0'
EDIT_KILLFOCUS '1'
EDIT_PREKEY '2'
EDIT_POSTKEY '3'
EDIT_CHANGED '4'

Label hook types

LABEL_SETFOCUS '0'
LABEL_KILLFOCUS '1'

Button hook types

BUTTON_SETFOCUS '0'
BUTTON_KILLFOCUS '1'
BUTTON_PREKEY '2'
BUTTON_POSTKEY '3'
BUTTON_CLICKED '4'

Radio hook types

RADIO_SETFOCUS '0'
RADIO_KILLFOCUS '1'
RADIO_PREKEY '2'
RADIO_POSTKEY '3'
RADIO_CLICKED '4'

Checkbox hook types

CHECKBOX_SETFOCUS '0'
CHECKBOX_KILLFOCUS '1'
CHECKBOX_PREKEY '2'
CHECKBOX_POSTKEY '3'
CHECKBOX_CLICKED '4'

Listbox hook types

LISTBOX_SETFOCUS '0'
LISTBOX_KILLFOCUS '1'
LISTBOX_PREKEY '2'
LISTBOX_POSTKEY '3'
LISTBOX_CHANGED '4'
LISTBOX_CHANGING '5'
LISTBOX_CLICKED '6'

Combobox hook types

COMBOBOX_SETFOCUS '0'
COMBOBOX_KILLFOCUS '1'
COMBOBOX_PREKEY '2'
COMBOBOX_POSTKEY '3'
COMBOBOX_CHANGED '4'
COMBOBOX_CHANGING '5'

Textview hook types

TEXTVIEW_SETFOCUS '0'
TEXTVIEW_KILLFOCUS '1'
TEXTVIEW_PREKEY '2'
TEXTVIEW_POSTKEY '3'

Listview hook types

LISTVIEW_SETFOCUS '0'
LISTVIEW_KILLFOCUS '1'
LISTVIEW_PREKEY '2'
LISTVIEW_POSTKEY '3'
LISTVIEW_CHANGED '4'
LISTVIEW_CHANGING '5'
LISTVIEW_CLICKED '6'

Memo hook types

MEMO_SETFOCUS '0'
MEMO_KILLFOCUS '1'
MEMO_PREKEY '2'
MEMO_POSTKEY '3'
MEMO_CHANGED '4'

Terminal hook types

TERMINAL_SETFOCUS '0'
TERMINAL_KILLFOCUS '1'
TERMINAL_PREKEY '2'
TERMINAL_POSTKEY '3'
TERMINAL_EXIT '4'

Menu hook types

MENU_SETFOCUS '0'
MENU_KILLFOCUS '1'
MENU_PREKEY '2'
MENU_POSTKEY '3'
MENU_CHANGED '4'
MENU_CHANGING '5'
MENU_CLICKED '6'
MENU_ESCAPE '7'

MessageBox- und Dialogkonstanten

MessageBox Styles

MB_NORMAL '0'
MB_INFO '16777216'
MB_ERROR '33554432'
MB_OK '0'
MB_OKCANCEL '67108864'
MB_YESNO '134217728'
MB_YESNOCANCEL '268435456'
MB_RETRYCANCEL '536870912'
MB_DEFBUTTON1 '1073741824'
MB_DEFBUTTON2 '2147483648'

Dialog result codes

IDOK '1'
IDCANCEL '2'
IDYES '3'
IDNO '4'
IDRETRY '5'

Scroll bar control codes

SB_LINEDOWN '1'
SB_LINEUP '2'
SB_PAGEDOWN '3'
SB_PAGEUP '4'
SB_THUMBTRACK '5'

General Window API

Funktion Beschreibung
cui_message() MessageBox.
cui_window_new() Create new window instance.
cui_window_create() Create window (and make it visible).
cui_window_destroy() Destroy window (and it's data).
cui_window_quit() Quit application.
cui_window_modal() Execute as modal dialog.
cui_window_close() Close a modal dialog.
cui_window_sethook() Assign a window hook.
cui_window_getctrl() Get a control window.
cui_getdesktop() Get desktop window.
cui_window_move() Move and/or resize a window.
cui_getwindowrect() Get a window's rectangle.
cui_getclientrect() Get a window's client rectangle.
cui_settimer() Start a window timer.
cui_killtimer() Stop a window timer.
cui_addcolors() Add/Modify a color profile.
cui_hascolors() Check if color profile has been defined.
cui_window_setcolors() Assign a color profile to a window.
cui_window_settext() Set window text.
cui_window_setltext() Set window left text.
cui_window_setrtext() Set window right text.
cui_window_setltext() Set window left text.
cui_window_setstatustext() Set window left text.
cui_window_setltext() Set window status text.
cui_window_setlstatustext() Set window left status text.
cui_window_setrstatustext() Set window right status text.
cui_window_totop() Bring window to top.
cui_window_maximize() Maximize window (and reverse).
cui_window_minimize() Minimize window (and reverse).
cui_window_hide() Hide window (and reverse).
cui_window_enable() Enable window (and reverse).
cui_window_invalidate() Invalidate window and force redrawing.
cui_update() Update window stack.
cui_leave_curses() Leave curses mode.
cui_resume_curses() Resume curses mode.
cui_shell_execute() Execute shell script.

cui_message()

Expects: $1 <- Parent window : Window Handle
  $2 <- Message : String
  $3 <- Title : String
  $4 <- Style : Integer (use $MB_XXX constants)
Returns: $p2 -> Result code : Integer

cui_window_new()

Expects: $1 <- Parent Window : Window Handle
  $2 <- X : Integer
  $3 <- Y : Integer
  $4 <- W : Integer
  $5 <- H : Integer
  $6 <- Style : Integer (use $CWS_XXX constants)
Returns: $p2 -> New Window : Window Handle

cui_message()

Expects: $1 <- Parent Window : Window Handle
  $2 <- Message : String
  $3 <- Title : String
  $4 <- Style : Integer (use $MB_XXX constants)
Returns: $p2 -> Result code : Integer

cui_window_new()

Expects: $1 <- Parent Window : Window Handle
  $2 <- X : Integer
  $3 <- Y : Integer
  $4 <- W : Integer
  $5 <- H : Integer
  $6 <- Style : Integer (use $CWS_XXX constants)
Returns: $p2 -> New Window : Window Handle

cui_window_create()

Expects: $1 <- Window : Window Handle
Returns: <nothing>  

cui_window_destroy()

Expects: $1 <- Window : Window Handle
Returns: <nothing>  

cui_window_quit()

Expects: $1 <- Exit code : Integer
Returns: <nothing>  

cui_window_modal()

Expects: $1 <- Window : Window Handle
Returns: $p2 -> Result code : Integer

cui_window_close()

Expects: $1 <- Window : Window Handle
  $2 <- Result code : Integer
Returns: $p2 -> "1ßuccess : ''0'' no success (refused to close)

cui_window_sethook()

Expects: $1 <- Window : Window Handle
  $2 <- Hook : Integer (use $HOOK_XXX constants)
  $3 <- Proc : String (name of shell function)
Returns: <nothing>  

cui_window_getctrl()

Expects: $1 <- Window : Window Handle
  $2 <- Ctrl ID : Integer
Returns: $p2 -> Ctrl : Window Handle or ''0'' if not found

cui_getdesktop()

Expects: <nothing>  
Returns: $p2 -> Desktop : Window Handle

cui_window_move()

Expects: $1 <- Window : Window Handle
  $2 <- X : Integer
  $3 <- Y : Integer
  $4 <- W : Integer
  $5 <- H : Integer
Returns: <nothing>  

cui_getwindowrect()

Expects: $1 <- Window : Window Handle
Returns: $p2 -> X : Integer
  $p3 -> Y : Integer
  $p4 -> W : Integer
  $p5 -> H : Integer

cui_getclientrect()

Expects: $1 <- Window : Window Handle
Returns: $p2 -> X : Integer
  $p3 -> Y : Integer
  $p4 -> W : Integer
  $p5 -> H : Integer

cui_settimer()

Expects: $1 <- Window : Window Handle
  $2 <- TimerId : Integer
  $3 <- Time : Integer (Milliseconds 100ms resolution)
Returns: <nothing>  

cui_killtimer()

Expects: $1 <- Window : Window Handle
  $2 <- TimerId : Integer
Returns: <nothing>  

cui_addcolors()

Expects: $1 <- Name : Window Handle
  $2 <- WndColor : Integer (COLOR_XXX)
  $3 <- WndSelColor : Integer (COLOR_XXX)
  $4 <- WndTxtColor : Integer (COLOR_XXX)
  $5 <- SelTxtColor : Integer (COLOR_XXX)
  $6 <- InactTxtColor : Integer (COLOR_XXX)
  $7 <- HilightColor : Integer (COLOR_XXX)
  $8 <- TitleTxtColor : Integer (COLOR_XXX)
  $9 <- TitleBkgndColor : Integer (COLOR_XXX)
  $10 <- StatusTxtColor : Integer (COLOR_XXX)
  $11 <- StatusBkgndColor : Integer (COLOR_XXX)
  $12 <- BorderColor : Integer (COLOR_XXX)
Returns: <nothing>  

cui_hascolors()

Expects: $1 <- Name : Name of profile
Returns: $p2 -> Result : Integer (0 = not defined, 1 = defined)

cui_window_setcolors()

Expects: $1 <- Window : Window Handle
  $2 <- Name : Name of profile
Returns: <nothing>  

cui_window_settext()

Expects: $1 <- Window : Window Handle
  $2 <- Text : Window text
Returns: <nothing>  

cui_window_setltext()

Expects: $1 <- Window : Window Handle
  $2 <- Text : Window text
Returns: <nothing>  

cui_window_setrtext()

Expects: $1 <- Window : Window Handle
  $2 <- Text : Window text
Returns: <nothing>  

cui_window_setstatustext()

Expects: $1 <- Window : Window Handle
  $2 <- Text : Window text
Returns: <nothing>  

cui_window_setlstatustext()

Expects: $1 <- Window : Window Handle
  $2 <- Text : Window text
Returns: <nothing>  

cui_window_setrstatustext()

Expects: $1 <- Window : Window Handle
  $2 <- Text : Window text
Returns: <nothing>  

cui_window_totop()

Expects: $1 <- Window : Window Handle
Returns: <nothing>  

cui_window_maximize()

Expects: $1 <- Window : Window Handle
  $2 <- State : 1 = maximize, 0 = normal
Returns: <nothing>  

cui_window_minimize()

Expects: $1 <- Window : Window Handle
  $2 <- State : 1 = minimized, 0 = normal
Returns: <nothing>  

cui_window_hide()

Expects: $1 <- Window : Window Handle
  $2 <- State : 1 = hidden, 0 = normal
Returns: <nothing>  

cui_window_enable()

Expects: $1 <- Window : Window Handle
  $2 <- State : 1 = enabled (default), 0 = disabled
Returns: <nothing>  

cui_window_invalidate()

Expects: $1 <- Window : Window Handle
Returns: <nothing>  

cui_update()

Expects: <nothing>  
Returns: <nothing>  

cui_leave_curses()

Expects: <nothing>  
Returns: <nothing>  

cui_resume_curses()

Expects: <nothing>  
Returns: <nothing>  

cui_shell_execute()

Expects: $1 <- Shell command : String
Returns: <nothing>  

Edit Control API

Funktion Beschreibung
cui_edit_new() Make new edit.
cui_edit_callback() Assign a edit callback.
cui_edit_settext() Set edit text.
cui_edit_gettext() Get edit text.

cui_edit_new()

Expects: $1 <- Parent Window : Window Handle
  $2 <- Window title : String
  $3 <- X : Integer
  $4 <- Y : Integer
  $5 <- W : Integer
  $6 <- H : Integer
  $7 <- Len : Integer
  $8 <- ID : Integer
  $9 <- Set style : Integer (use $CWS_XXX constants)
  $10 <- Clear style : Integer (use $CWS_XXX constants)
Returns: $p2 -> New Window : Window Handle

cui_edit_callback()

Expects: $1 <- Window : Window Handle
  $2 <- Hook : Integer (use $HOOK_XXX constants)
  $3 <- Target : Window Handle
  $4 <- Proc : String (name of shell function)
Returns: <nothing>  

cui_edit_settext()

Expects: $1 <- Window : Window Handle
  $2 <- Text : String
Returns: <nothing>  

cui_edit_gettext()

Expects: $1 <- Window : Window Handle
Returns: $p2 -> Text : String

Label Control API

Funktion Beschreibung
cui_label_new() Make new label.
cui_label_callback() Assign a label callback.

cui_label_new()

Expects: $1 <- Parent Window : Window Handle
  $2 <- Window title : String
  $3 <- X : Integer
  $4 <- Y : Integer
  $5 <- W : Integer
  $6 <- H : Integer
  $7 <- ID : Integer
  $8 <- Set style : Integer (use $CWS_XXX constants)
  $9 <- Clear style : Integer (use $CWS_XXX constants)
Returns: $p2 -> New Window : Window Handle

cui_label_callback()

Expects: $1 <- Window : Window Handle
  $2 <- Hook : Integer (use $HOOK_XXX constants)
  $3 <- Target : Window Handle
  $4 <- Proc : String (name of shell function)
Returns: <nothing>  

Button Control API

Funktion Beschreibung
cui_button_new() Make new button.
cui_button_callback() Assign a button callback.

cui_button_new()

Expects: $1 <- Parent Window : Window Handle
  $2 <- Window title : String
  $3 <- X : Integer
  $4 <- Y : Integer
  $5 <- W : Integer
  $6 <- H : Integer
  $7 <- ID : Integer
  $8 <- Set style : Integer (use $CWS_XXX constants)
  $9 <- Clear style : Integer (use $CWS_XXX constants)
Returns: $p2 -> New Window : Window Handle

cui_button_callback()

Expects: $1 <- Window : Window Handle  
  $2 <- Hook : Integer (use $HOOK_XXX constants)  
  $3 <- Target : Window Handle  
  $4 <- Proc : String (name of shell function)  
Returns: <nothing>  

Groupbox Control API

Funktion Beschreibung
cui_groupbox_new() Make new groupbox.

cui_groupbox_new()

Expects: $1 <- Parent Window : Window Handle
  $2 <- Window title : String
  $3 <- X : Integer
  $4 <- Y : Integer
  $5 <- W : Integer
  $6 <- H : Integer
  $7 <- Set style : Integer (use $CWS_XXX constants)
  $8 <- Clear style : Integer (use $CWS_XXX constants)
Returns: $p2 -> New Window : Window Handle

Radio Control API

Funktion Beschreibung
cui_radio_new() Make new radio control.
cui_radio_callback() Assign a radio callback.
cui_radio_setcheck() Set radio check status.
cui_radio_getcheck() Get radio check status.

cui_radio_new()

Expects: $1 <- Parent Window : Window Handle
  $2 <- Window title : String
  $3 <- X : Integer
  $4 <- Y : Integer
  $5 <- W : Integer
  $6 <- H : Integer
  $7 <- ID : Integer
  $8 <- Set style : Integer (use $CWS_XXX constants)
  $9 <- Clear style : Integer (use $CWS_XXX constants)
Returns: $p2 -> New Window : Window Handle

cui_radio_callback()

Expects: $1 <- Window : Window Handle
  $2 <- Hook : Integer (use $HOOK_XXX constants)
  $3 <- Target : Window Handle
  $4 <- Proc : String (name of shell function)
Returns: <nothing>  

cui_radio_setcheck()

Expects: $1 <- Window : Window Handle
  $2 <- Value : Integer (0 or 1)
Returns: <nothing>  

cui_radio_getcheck()

Expects: $1 <- Window : Window Handle
Returns: $p2 -> Value : Integer (0 or 1)

Checkbox Control API

Funktion Beschreibung
cui_checkbox_new() Make new checkbox control.
cui_checkbox_callback() Assign a checkbox callback.
cui_checkbox_setcheck() Set checkbox check status.
cui_checkbox_getcheck() Get checkbox check status.

cui_checkbox_new()

Expects: $1 <- Parent Window : Window Handle
  $2 <- Window title : String
  $3 <- X : Integer
  $4 <- Y : Integer
  $5 <- W : Integer
  $6 <- H : Integer
  $7 <- ID : Integer
  $8 <- Set style : Integer (use $CWS_XXX constants)
  $9 <- Clear style : Integer (use $CWS_XXX constants)
Returns: $p2 -> New Window : Window Handle

cui_checkbox_callback()

Expects: $1 <- Window : Window Handle
  $2 <- Hook : Integer (use $HOOK_XXX constants)
  $3 <- Target : Window Handle
  $4 <- Proc : String (name of shell function)
Returns: <nothing>  

cui_checkbox_setcheck()

Expects: $1 <- Window : Window Handle
  $2 <- Value : Integer (0 or 1)
Returns: <nothing>  

cui_checkbox_getcheck()

Expects: $1 <- Window : Window Handle
Returns: $p2 -> Value : Integer (0 or 1)

Listbox Control API

Funktion Beschreibung
cui_listbox_new() Make new listbox control.
cui_listbox_callback() Assign a listbox callback.
cui_listbox_add() Add string to listbox.
cui_listbox_delete() Delete string from listbox.
cui_listbox_get() Get string from listbox.
cui_listbox_adddata() Assign data to listbox item.
cui_listbox_getdata() Read data from listbox item.
cui_listbox_setsel() Set current selection.
cui_listbox_getsel() Get current selection.
cui_listbox_clear() Clear listbox content.
cui_listbox_getcount() Get number of items in listbox.
cui_listbox_select() Select string in listbox.

cui_listbox_new()

Expects: $1 <- Parent Window : Window Handle
  $2 <- Window title : String
  $3 <- X : Integer
  $4 <- Y : Integer
  $5 <- W : Integer
  $6 <- H : Integer
  $7 <- ID : Integer
  $8 <- Set style : Integer (use $CWS_XXX constants)
  $9 <- Clear style : Integer (use $CWS_XXX constants)
Returns: $p2 -> New Window : Window Handle

cui_listbox_callback()

Expects: $1 <- Window : Window Handle
  $2 <- Hook : Integer (use $HOOK_XXX constants)
  $3 <- Target : Window Handle
  $4 <- Proc : String (name of shell function)
Returns: <nothing>  

cui_listbox_add()

Expects: $1 <- Window : Window Handle
  $2 <- Value : String
Returns: $p2 -> Index : Integer

cui_listbox_delete()

Expects: $1 <- Window : Window Handle
  $2 <- Index : Integer
Returns: <nothing>  

cui_listbox_get()

Expects: $1 <- Window : Window Handle
  $2 <- Index : Integer
Returns: $p2 -> Value : String

cui_listbox_adddata()

Expects: $1 <- Window : Window Handle
  $2 <- Index : Integer
  $3 <- Data : Integer
Returns: <nothing>  

cui_listbox_getdata()

Expects: $1 <- Window : Window Handle
  $2 <- Index : Integer
Returns: $p2 -> Data : Integer

cui_listbox_setsel()

Expects: $1 <- Window : Window Handle
  $2 <- Index : Integer
Returns: <nothing>  

cui_listbox_getsel()

Expects: $1 <- Window : Window Handle
Returns: $p2 -> Index : Integer

cui_listbox_clear()

Expects: $1 <- Window : Window Handle
Returns: <nothing>  

cui_listbox_getcount()

Expects: $1 <- Window : Window Handle
Returns: $p2 -> NumItems : Integer

cui_listbox_select()

Expects: $1 <- Window : Window Handle
  $2 <- String : String to select
Returns: $p2 -> Index : Integer

Combobox Control API

Funktion Beschreibung
cui_combobox_new() Make new combobox control.
cui_combobox_callback() Assign a combobox callback.
cui_combobox_add() Add string to combobox.
cui_combobox_delete() Delete string from combobox.
cui_combobox_get() Get string from combobox.
cui_combobox_adddata() Assign data to combobox item.
cui_combobox_getdata() Read data from combobox item.
cui_combobox_setsel() Set current selection.
cui_combobox_getsel() Get current selection.
cui_combobox_clear() Clear combobox content.
cui_combobox_getcount() Get number of items in combobox.
cui_combobox_select() Select string in the combobox.

cui_combobox_new()

Expects: $1 <- Parent Window : Window Handle
  $2 <- X : Integer
  $3 <- Y : Integer
  $4 <- W : Integer
  $5 <- H : Integer
  $6 <- ID : Integer
  $7 <- Set style : Integer (use $CWS_XXX constants)
  $8 <- Clear style : Integer (use $CWS_XXX constants)
Returns: $p2 -> New Window : Window Handle

cui_combobox_callback()

Expects: $1 <- Window : Window Handle
  $2 <- Hook : Integer (use $HOOK_XXX constants)
  $3 <- Target : Window Handle
  $4 <- Proc : String (name of shell function)
Returns: <nothing>  

cui_combobox_add()

Expects: $1 <- Window : Window Handle
  $2 <- Value : String
Returns: $p2 -> Index : Integer

cui_combobox_delete()

Expects: $1 <- Window : Window Handle
  $2 <- Index : Integer
Returns: <nothing>  

cui_combobox_get()

Expects: $1 <- Window : Window Handle
  $2 <- Index : Integer
Returns: $p2 -> Value : String

cui_combobox_adddata()

Expects: $1 <- Window : Window Handle
  $2 <- Index : Integer
  $3 <- Data : Integer
Returns: <nothing>  

cui_combobox_getdata()

Expects: $1 <- Window : Window Handle
  $2 <- Index : Integer
Returns: $p2 -> Data : Integer

cui_combobox_setsel()

Expects: $1 <- Window : Window Handle
  $2 <- Index : Integer
Returns: <nothing>  

cui_combobox_getsel()

Expects: $1 <- Window : Window Handle
Returns: $p2 -> Index : Integer

cui_combobox_clear()

Expects: $1 <- Window : Window Handle
Returns: <nothing>  

cui_combobox_getcount()

Expects: $1 <- Window : Window Handle
Returns: $p2 -> NumItems : Integer

cui_combobox_select()

Expects: $1 <- Window : Window Handle
  $2 <- String : String to select
Returns: $p2 -> Index : Integer

ProgressBar Control API

Funktion Beschreibung
cui_progress_new() Make new progress bar control.
cui_progress_setrange() Set bar range.
cui_progress_setpos() Set bar pos.
cui_progress_getrange() Get bar range.
cui_progress_getpos() Get bar pos.

cui_progress_new()

Expects: $1 <- Parent Window : Window Handle
  $2 <- Title : String
  $3 <- X : Integer
  $4 <- Y : Integer
  $5 <- W : Integer
  $6 <- H : Integer
  $7 <- ID : Integer
  $8 <- Set style : Integer (use $CWS_XXX constants)
  $9 <- Clear style : Integer (use $CWS_XXX constants)
Returns: $p2 -> New Window : Window Handle

cui_progress_setrange()

Expects: $1 <- Window : Window Handle
  $2 <- Range : Integer
Returns: <nothing>  

cui_progress_setpos()

Expects: $1 <- Window : Window Handle
  $2 <- Pos : Integer
Returns: <nothing>  

cui_progress_getrange()

Expects: $1 <- Window : Window Handle
Returns: $p2 -> Range : Integer

cui_progress_getpos()

Expects: $1 <- Window : Window Handle
Returns: $p2 -> Pos : Integer

Textview Control API

Funktion Beschreibung
cui_textview_new() Make new textview control.
cui_textview_callback() Assign a textview callback.
cui_textview_wordwrap() Enable word wrap.
cui_textview_add() Add string to textview.
cui_textview_clear() Clear text view.
cui_textview_read() Read a file.
cui_textview_search() Search within textview.

cui_textview_new()

Expects: $1 <- Parent Window : Window Handle
  $2 <- Title : String
  $3 <- X : Integer
  $4 <- Y : Integer
  $5 <- W : Integer
  $6 <- H : Integer
  $7 <- ID : Integer
  $8 <- Set style : Integer (use $CWS_XXX constants)
  $9 <- Clear style : Integer (use $CWS_XXX constants)
Returns: $p2 -> New Window : Window Handle

cui_textview_callback()

Expects: $1 <- Window : Window Handle
  $2 <- Hook : Integer (use $HOOK_XXX constants)
  $3 <- Target : Window Handle
  $4 <- Proc : String (name of shell function)
Returns: <nothing>  

cui_textview_wordwrap()

Expects: $1 <- Window : Window Handle
  $2 <- Enable? : Integer (0 or 1)
Returns: <nothing>  

cui_textview_add()

Expects: $1 <- Window : Window Handle
  $2 <- Value : String
  $3 <- Update : Flag (1 = update view, 0 = no update)
Returns: <nothing>  

cui_textview_clear()

Expects: $1 <- Window : Window Handle
  $2 <- Value : String
Returns: <nothing>  

cui_textview_read()

Expects: $1 <- Window : Window Handle
  $2 <- Filename : String
Returns: $p2 -> Success : Integer (0 = failed, 1 = success)

cui_textview_search()

Expects: $1 <- Window : Window Handle
  $2 <- SearchStr : String
  $3 <- WholeWord : Integer (0 or 1)
  $4 <- CaseSense : Integer (0 or 1)
  $5 <- Down : Integer (0 or 1)
Returns: $p2 -> Success : Integer (0 = failed, 1 = success)

Listview Control API

Funktion Beschreibung
cui_listview_new() Make new listview control.
cui_listview_callback() Assign a listview callback.
cui_listview_setcoltext() Set listview column titel.
cui_listview_clear() Clear listview data.
cui_listview_add() Add a new (empty) record to the list view (must be populated with data using cui_listview_settext)
cui_listview_settext() Assign text data to listview record.
cui_listview_gettext() Get text data assigned listview record.
cui_listview_setdata() Assign integer data to listview record.
cui_listview_getdata() Get integer data from listview record.
cui_listview_setsel() Set current selection in listview control.
cui_listview_getsel() Get current selection of listview control.
cui_listview_getcount() Get number of records in listview control.
cui_listview_update() Update listview visual display after modifying data.

cui_listview_new()

Expects: $1 <- Parent Window : Window Handle
  $2 <- Title : String
  $3 <- X : Integer
  $4 <- Y : Integer
  $5 <- W : Integer
  $6 <- H : Integer
  $7 <- Num columns : Integer
  $8 <- ID : Integer
  $9 <- Set style : Integer (use $CWS_XXX constants)
  $10 <- Clear style : Integer (use $CWS_XXX constants)
Returns: $p2 -> New Window : Window Handle

cui_listview_callback()

Expects: $1 <- Window : Window Handle
  $2 <- Hook : Integer (use $HOOK_XXX constants)
  $3 <- Target : Window Handle
  $4 <- Proc : String (name of shell function)
Returns: <nothing>  

cui_listview_setcoltext()

Expects: $1 <- Window : Window Handle
  $2 <- Col-No : Integer
  $3 <- Text : String
Returns: <nothing>  

cui_listview_clear()

Expects: $1 <- Window : Window Handle
Returns: <nothing>  

cui_listview_add()

Expects: $1 <- Window : Window Handle
Returns: $p2 -> Index of new record : Integer

cui_listview_settext()

Expects: $1 <- Window : Window Handle
  $2 <- Rec. index : Integer (returned by cui_listview_add)
  $3 <- Col. index : Integer (0 | 1 | ... | cols - 1)
  $4 <- Text : String
Returns: <nothing>  

cui_listview_gettext()

Expects: $1 <- Window : Window Handle
  $2 <- Rec. index : Integer (returned by cui_listview_add)
  $3 <- Col. index : Integer (0 | 1 | ... | cols - 1)
Returns: $p2 -> Text : String

cui_listview_setdata()

Expects: $1 <- Window : Window Handle
  $2 <- Rec. index : Integer (returned by cui_listview_add)
  $3 <- Data : Integer
Returns: <nothing>  

cui_listview_getdata()

Expects: $1 <- Window : Window Handle
  $2 <- Rec. index : Integer (returned by cui_listview_add)
Returns: $p2 -> Data : Integer

cui_listview_setsel()

Expects: $1 <- Window : Window Handle
  $2 <- Rec. index : Integer (returned by cui_listview_add)
Returns: <nothing>  

cui_listview_getsel()

Expects: $1 <- Window : Window Handle
Returns: $p2 -> Sel. index : Integer (-1 if not selected)

cui_listview_getcount()

Expects: $1 <- Window : Window Handle
Returns: $p2 -> Count : Integer

cui_listview_update()

Expects: $1 <- Window : Window Handle
Returns: <nothing>  

Memo Control API

Funktion Beschreibung
cui_memo_new() Make new memo.
cui_memo_callback() Assign a memo callback.
cui_memo_settext() Set memo text.
cui_memo_gettext() Get memo text.

cui_memo_new()

Expects: $1 <- Parent Window : Window Handle
  $2 <- Window title : String
  $3 <- X : Integer
  $4 <- Y : Integer
  $5 <- W : Integer
  $6 <- H : Integer
  $7 <- ID : Integer
  $8 <- Set style : Integer (use $CWS_XXX constants)
  $9 <- Clear style : Integer (use $CWS_XXX constants)
Returns: $p2 -> New Window : Window Handle

cui_memo_callback()

Expects: $1 <- Window : Window Handle
  $2 <- Hook : Integer (use $HOOK_XXX constants)
  $3 <- Target : Window Handle
  $4 <- Proc : String (name of shell function)
Returns: <nothing>  

cui_memo_settext()

Expects: $1 <- Window : Window Handle
  $2 <- Text : String
Returns: <nothing>  

cui_memo_gettext()

Expects: $1 <- Window : Window Handle
Returns: $p2 -> Text : String

cui_memo_setwrapcolumns()

Expects: $1 <- Window : Window Handle
  $2 <- Column : String
Returns: <nothing>  

Terminal Window API

Funktion Beschreibung
cui_terminal_new() Make new terminal control.
cui_terminal_callback() Assign a terminal callback.
cui_terminal_write() Write text into the terminal window.
cui_terminal_run() Run a command within the terminal window.
cui_terminal_pipe() Pipe text data to the running co process.

cui_terminal_new()

Expects: $1 <- Parent Window : Window Handle
  $2 <- Title : String
  $3 <- X : Integer
  $4 <- Y : Integer
  $5 <- W : Integer
  $6 <- H : Integer
  $7 <- ID : Integer
  $8 <- Set style : Integer (use $CWS_XXX constants)
  $9 <- Clear style : Integer (use $CWS_XXX constants)
Returns: $p2 -> New Window : Window Handle

cui_terminal_callback()

Expects: $1 <- Window : Window Handle
  $2 <- Hook : Integer (use $HOOK_XXX constants)
  $3 <- Target : Window Handle
  $4 <- Proc : String (name of shell function)
Returns: <nothing>  

cui_terminal_write()

Expects: $1 <- Window : Window Handle
  $2 <- Text : String
  $3 <- DoUpdate : Integer
Returns: <nothing>  

cui_terminal_run()

Expects: $1 <- Window : Window Handle
  $2 <- Text : String
Returns: $p2 -> Success : Integer (0 or 1 !not the exit code of the process!)

cui_terminal_pipe()

Expects: $1 <- Window : Window Handle
  $2 <- Text : String
Returns: <nothing>  

Menu Window API

Funktion Beschreibung
cui_menu_new() Make new menu control.
cui_menu_callback() Assign a menu callback.
cui_menu_additem() Add a menu item.
cui_menu_addseparator() Add a menu separator.
cui_menu_selitem() Select menu item.
cui_menu_getselitem() Get selected menu item.
cui_menu_clear() Clear menu.

cui_menu_new()

Expects: $1 <- Parent Window : Window Handle
  $2 <- Title : String
  $3 <- X : Integer
  $4 <- Y : Integer
  $5 <- W : Integer
  $6 <- H : Integer
  $7 <- ID : Integer
  $8 <- Set style : Integer (use $CWS_XXX constants)
  $9 <- Clear style : Integer (use $CWS_XXX constants)
Returns: $p2 -> New Window : Window Handle

cui_menu_callback()

Expects: $1 <- Window : Window Handle
  $2 <- Hook : Integer (use $HOOK_XXX constants)
  $3 <- Target : Window Handle
  $4 <- Proc : String (name of shell function)
Returns: <nothing>  

cui_menu_additem()

Expects: $1 <- Window : Window Handle
  $2 <- Text : String
  $3 <- Id : Item id
Returns: <nothing>  

cui_menu_addseparator()

Expects: $1 <- Window : Window Handle
Returns: <nothing>  

cui_menu_selitem()

Expects: $1 <- Window : Window Handle
  $2 <- Id : Integer (item id)
Returns: <nothing>  

cui_menu_getselitem()

Expects: $1 <- Window : Window Handle
Returns: $p2 -> ItemId : Integer

cui_menu_clear()

Expects: $1 <- Window : Window Handle
Returns: <nothing>  

Holger Bruenjes 2016-12-12