// Copyright (c) 2003,2004,2005 Juraj Kolesár #define TT_TABLE GSList /* Main variable of the tt_table functions -the idea is to keep separatly list of values from T_TABLE that are actualy showed by tt_table_list */ /*** "PUBLIC" TO USE **********************************************************/ /* tt_table (POS, **T_TABLE, *T_COLS) {{{ */ int tt_table (POS point, T_TABLE **table, T_COLS *cols); /* MEAN -simpliest function to handle with T_TABLE data in WINDOW area -displayed according to T_COLS values -result after confirm: actual T_ROW from T_TABLE is stored in T_COLS values -moving cursor is changing actual T_ROW in T_TABLE -table size is computed as smaller number from list size and description or previous size defined in POS }}} */ /* tt_table_qs (*WINDOW, *T_DB, *T_QS, *T_COLS) {{{ */ int tt_table_qs (WINDOW *win, T_DB *tdb, T_QS *qs, T_COLS *cols); /* MEAN -table data stored in T_MATRIX are read from T_DB according to T_QS request (for more see ../db/tdb.h). -shows filter line and calls tt_table_list in subwin area handles user inputs to view data list (find,filter) USER EVENT HANDLING -after changing filter or find string by hiting char key actualized list is changed and showed immediatly. RETURN (__TT_ENTER)-when actual row values are stored in T_COLS [Enter] all other exits keeps current fliter value in T_COLS (__TT_ESC) -[Esc] pressed, f.e. nothing was chosen (__TT_INS) -[Insert] pressed, f.e. new input wanted }}} */ /* tt_table_combo(POS, **T_TABLE, *T_COLS) {{{ */ int tt_table_combo(POS point, T_TABLE **table, T_COLS *cols); /* MEAN -combo box on POS is displayed tt_table_draw_combo -when pressing [Enter] T_TABLE is displayed by tt_table and user can select T_ROW. After selection is table destroyed and called tt_table_draw_combo again with selected value of T_ROW }}} */ /*** "DRAW" ("private", but could be used) ************************************/ /* tt_table_draw (*WINDOW, *T_COLS, *T_TABLE) {{{ */ int tt_table_draw (WINDOW *win, T_COLS *cols, T_TABLE *table); /* }}} */ /* tt_table_draw_row (POS, char separator, *T_COLS, *T_ROW) {{{ */ int tt_table_draw_row (POS point, char separator, T_COLS *cols, T_ROW *row); /* }}} */ /* tt_table_draw_list (*WINDOW, *T_COLS, *T_TABLE, *TT_TABLE) {{{ */ int tt_table_draw_list ( WINDOW *win, T_COLS *cols, T_TABLE *table, TT_TABLE *v_table ); /* -lists TT_TABLE data in WINDOW area according to T_COLS descriptions (when T_COLS list is shorter than the number of columns, all not described columns use descripton of the last described) -when T_TABLE != NULL highliths the visible cursor }}} */ /* tt_table_draw_combo (POS, *T_COLS, *T_TABLE) {{{ */ int tt_table_draw_combo(POS point, T_COLS *cols, T_TABLE *table); /* -draws combo symbol "[v]" and actual T_ROW from T_TABLE }}} */ /* tt_table_draw_filter (*WINDOW, *T_COLS) {{{ */ int tt_table_draw_filter (WINDOW *win, T_COLS *cols); /* lists actual filter(T_COLS) values in WINDOW starting on position (1,1) (internal function for tt_table_qs) }}} */ /*** "INTERNAL" ("private", not recomended for external use) ******************/ /* tt_table_init (int rows, *T_TABLE, **TT_TABLE) {{{ */ int tt_table_init(int rows, T_TABLE *table, TT_TABLE **v_table); /* MEAN initialization of TT_TABLE -starts from the actual position in T_TABLE RETURN (number) of rows initialized -could be less or equal to "rows" attribute according to size of parent T_TABLE (0) if T_TABLE = NULL }}} */ /* tt_table_store (*T_TABLE, *T_COLS) {{{ */ int tt_table_store(T_TABLE *table, T_COLS *cols); /* MEAN -stores actual T_ROW to T_COLS -is called after hiting [Enter] or another confirm key RETURN __LT_OK - when stored, or T_TABLE=NULL and nothing changed __LT_ERR - when T_COLS list is shorter than T_ROW }}} */ /* tt_table_cursor (*T_TABLE, *TT_TABLE) {{{ */ int tt_table_cursor(T_TABLE *table, TT_TABLE *v_table); /* RETURN (value) of visual cursor vertical position (first line has value '1') (0) -if lt_table=NULL }}} */ /* tt_table_next (**T_TABLE, **TT_TABLE) {{{ */ int tt_table_next(T_TABLE **table, TT_TABLE **v_table); /*after hiting KEY_DOWN -if possible then T_TABLE cursor is moved to new position and TT_TABLE values are changed if necessary (when visible cursor is in the end of the table, first item from TT_TABLE goes out and new from T_TABLE is added) }}} */ /* tt_table_previous (**T_TABLE, **TT_TABLE) {{{ */ int tt_table_previous(T_TABLE **table, TT_TABLE **v_table); /*after hiting KEY_UP simmilar to tt_table_next but in oposite garde }}} */ /* tt_table_search (char *str, int column, **T_TABLE, **TT_TABLE) {{{ */ int tt_table_search(char *str, int column, T_TABLE **table, TT_TABLE **v_table); /*after hiting key it is added (or removed) to search string and searched for it in actual column ??? -need to make new strcmp function where string "n333umber" would be less then "n3umber" }}} */ /* tt_table_find (char *str, int column, **T_TABLE, **TT_TABLE) {{{ */ int tt_table_find(char *str, int column, T_TABLE **table, TT_TABLE **v_table); /*similar to search but it fills the whole value of str when SURE }}} */