home *** CD-ROM | disk | FTP | other *** search
-
-
-
- /* b4browse.c (c)Copyright Sequiter Software Inc., 1987-1990. All rights reserved.*/
-
- #include "d4all.h"
- #include "w4.h"
- #include "g4char.h"
- #include "p4misc.h"
-
- #include <string.h>
- #include <ctype.h>
-
- static void b4set_row(int,long) ;
- static int b4modify(int) ;
- static int b4skip_one(int) ;
- static int b4page(int) ;
- static int b4top(int) ;
- static int b4find(int) ;
- static int b4bottom(int) ;
- static int b4char(void) ;
- static void b4edit_setup(void) ;
- static void b4browse_setup(void) ;
- static int b4setup(int (*)(void), int (*)(void)) ;
- static void b4deact_menu(void) ;
- static int b4add_copy(int) ;
- static int b4select_index(int) ;
- static int b4delete(int) ;
- static int b4undelete(int) ;
- static int b4go_rec(void) ; /* Goes to the record at 'b4cursor_row'. */
- static int b4empty_check(void) ;
-
- static int (*user_edit_setup)(void) = 0 ;
- static int (*user_browse_setup)(void)= 0 ;
- static int b4on_browse = -1 ;
- static int b4cur_ref = -1 ;
-
- static int b4pull_ref = -1 ;
- static int b4select_ref = -1 ;
-
- static int b4page_size = -1 ;
- static int b4top_margin = 3 ;
- static int b4cur_top_margin = -1 ;
- static int b4bottom_margin = 1 ;
- static int b4cursor_col = -1 ;
- static int last_read_char = 0 ;
- static int is_empty = 0 ;
- static int do_escape = 0 ;
-
- /* Action routines assume that the record at 'b4cursor_row' is
- 'b4cursor_rec'. */
- static int b4cursor_row ;
- static long b4cursor_rec ; /* The record at 'b4cursor_row'. This info
- is filled in by 'b4display_recs'.
- It becomes '-1L' if there was no record
- at the cursor. */
- static long b4start_rec ; /* Saved by 'b4display_assume'.
- This is the starting record number. */
- static int b4num_displayed; /* Saved by 'b4display_recs'. */
-
- static int b4display_one(int) ;
- static int b4display_assume(void) ; /* Assumes that 'b4cursor_rec'
- is at 'b4cursor_row'. */
- static int b4display_recs(long) ;
- static void b4display_cursor(void) ;
-
- extern CB_WINDOW *v4window_ptr ;
- extern GET *v4get ;
- extern INDEX *v4index ;
-
- static int b4go_rec()
- {
- if ( ! is_empty )
- if ( b4cursor_rec != d4recno() )
- d4go( b4cursor_rec ) ;
- return 0 ;
- }
-
- static int b4empty_check()
- {
- if ( d4eof() )
- d4top() ;
- else
- {
- if ( d4skip(1L) == -3 )
- d4top() ;
- else
- d4skip(-1L) ;
- }
- is_empty = 1 ;
- b4cursor_rec = 0L ;
- if ( ! d4eof() )
- {
- is_empty = 0 ;
- b4cursor_rec = d4recno() ;
- }
- return 0 ;
- }
-
- static int (*verify_routine)(int) = 0 ;
- #ifdef KR
- void b4verify( verify_rou )
- int (*verify_rou)() ;
- #else
- void b4verify( int (*verify_rou)(int) )
- #endif
- {
- verify_routine = verify_rou ;
- }
-
- static int (*call_routine)(int,int) = 0 ;
- #ifdef KR
- void b4call( call_rou )
- int (*call_rou)() ;
- #else
- void b4call( int (*call_rou)(int,int) )
- #endif
- {
- call_routine = call_rou ;
- }
-
-
- static int temp_ref = -1 ;
-
- static void b4deact_menu()
- {
- if ( w4select(-1) != b4pull_ref && w4select(-1) != b4cur_ref )
- {
- temp_ref = w4select(-1) ;
- n4refresh( temp_ref ) ;
- w4deactivate(temp_ref) ;
- }
- }
-
- static void b4set_row( int new_row, long new_attribute )
- {
- int get_on ;
- GET *get_ptr ;
-
- new_row += b4cur_top_margin ;
-
- for ( get_on = v4window_ptr->first_get; get_on >= 0; get_on = get_ptr->next)
- {
- get_ptr = v4get+ get_on ;
- if ( b4on_browse )
- get_ptr->row = new_row ;
- get_ptr->attribute = new_attribute ;
- }
- }
-
- static int b4modify( int is_modify )
- {
- int rc ;
-
- if ( is_modify )
- if ( is_empty ) return 0 ;
-
- b4deact_menu() ;
- if ( is_modify )
- b4go_rec() ;
-
- w4activate( b4cur_ref ) ;
- b4set_row( b4cursor_row, (long) B_WHITE ) ;
-
- for( ;; )
- {
- if ( is_modify )
- d4unlock(-1L) ;
-
- last_read_char = g4read() ;
- if ( last_read_char == ESC || last_read_char == CTRL_Q )
- {
- last_read_char = 0 ;
- if ( is_modify )
- d4go( b4cursor_rec ) ;
- else
- return ESC ;
-
- break ;
- }
- else
- {
- if ( ! u4ptr_equal( (void *) 0, (void *) verify_routine) )
- rc = (*verify_routine)(b4cur_ref) ;
- else
- rc = 0 ;
-
- if ( rc == 0 )
- {
- if ( is_modify ) d4lock( d4recno(), 1 ) ;
- if ( ! u4ptr_equal( (void *) call_routine, (void *) 0) )
- (*call_routine)(b4cur_ref,b4cursor_row+b4cur_top_margin) ;
-
- if ( is_modify )
- rc = d4write( d4recno() ) ;
- else
- rc = d4append() ;
- if ( rc == -3 ) continue ;
-
- d4flush( d4select(-1) ) ;
- if ( last_read_char == RETURN || last_read_char == DOWN )
- last_read_char = 0 ;
- break ;
- }
- }
- }
-
- if ( is_modify )
- {
- b4display_assume() ;
- b4display_cursor() ;
- }
-
- d4unlock(-1L) ;
- return 0 ;
- }
-
- static int b4add_copy( int is_blank )
- {
- int rc, save_row ;
-
- if ( is_blank )
- d4go(0L) ;
- else
- b4go_rec() ;
-
- save_row = b4cursor_row ;
- b4cursor_row = b4num_displayed ;
- if ( b4cursor_row >= b4page_size )
- b4cursor_row-- ;
-
- rc = b4modify(0) ;
- if ( rc != 0 )
- b4cursor_row = save_row ;
- else
- {
- b4cursor_rec = d4recno() ;
- b4go_rec() ;
- b4empty_check() ;
- }
-
- b4display_assume() ;
- return 0 ;
- }
-
-
- static void b4display_cursor()
- {
- w4select( b4cur_ref ) ;
- w4cursor( b4cur_top_margin + b4cursor_row, b4cursor_col ) ;
- }
-
- static int b4display_one(int disp_row)
- {
- int first_get ;
-
- b4set_row(disp_row,F_WHITE) ;
- first_get = v4window_ptr->first_get ;
-
- if ( ! u4ptr_equal( (void *) call_routine, (void *) 0) )
- (*call_routine)(b4cur_ref,disp_row+b4cur_top_margin) ;
-
- if ( d4deleted() )
- w4( v4get[first_get].row, v4get[first_get].col-1, "*" ) ;
- else
- w4( v4get[first_get].row, v4get[first_get].col-1, " " ) ;
-
- g4display() ;
- return 0 ;
- }
-
- /* Returns the number of records displayed.
- Stores record at cursor in 'b4cursor_rec'.
- */
-
- static int b4display_recs( long start_rec )
- {
- int i ;
-
- b4num_displayed = 0 ;
- w4activate( b4cur_ref ) ;
-
- b4cursor_rec = -1L ;
- if ( is_empty )
- d4go(0L) ;
- else
- d4go( start_rec ) ;
-
- for ( i = 0; i < b4page_size; i++ )
- {
- b4display_one(i) ;
-
- if ( ! d4eof())
- {
- b4num_displayed++ ;
- if ( i == b4cursor_row )
- b4cursor_rec = d4recno() ;
-
- d4skip(1L) ;
- }
- }
-
- return 0 ;
- }
-
- static int b4display_assume()
- {
- b4start_rec = d4recno() ;
- b4go_rec() ;
- d4skip( (long) -b4cursor_row ) ;
- b4display_recs( d4recno() ) ;
- b4display_cursor() ;
-
- return 0 ;
- }
-
- static int b4top( int junk_parm )
- {
- d4top() ;
- b4cursor_row = 0 ;
- b4cursor_rec = d4recno() ;
-
- b4deact_menu() ;
- b4display_assume() ;
-
- d4unlock(-1L) ;
- return 0 ;
- }
-
- static int b4bottom( int junk_parm )
- {
- long bot_rec ;
-
- d4bottom() ;
- bot_rec = d4recno() ;
- d4skip((long)(1-b4page_size) ) ;
-
- b4deact_menu() ;
- b4display_recs(d4recno()) ;
- b4cursor_rec = bot_rec ;
- b4cursor_row = b4num_displayed-1 ;
- b4display_cursor() ;
-
- d4unlock(-1L) ;
- return 0 ;
- }
-
- static int b4skip_one( int n )
- {
- int rc ;
-
- b4go_rec() ;
- rc = d4skip( (long) n ) ;
- if ( rc < 0 ) return -1 ;
- if ( rc == 1 ) return 0 ;
- if ( rc == 3 ) return 0 ;
-
- b4cursor_row += n ;
- b4cursor_rec = d4recno() ;
- if ( b4cursor_row < 0 )
- {
- b4cursor_row = 0 ;
- b4deact_menu() ;
- b4display_assume() ;
- return 0 ;
- }
-
- if ( b4cursor_row >= b4page_size )
- {
- b4cursor_row = b4page_size -1 ;
- b4deact_menu() ;
- b4display_assume() ;
- return 0 ;
- }
-
- b4display_cursor() ;
- d4unlock(-1L) ;
- return 0 ;
- }
-
- static int b4page( int no_recs )
- {
- b4go_rec() ;
- if ( no_recs < 0 && b4cursor_row > 0 )
- {
- d4skip( (long) -b4cursor_row ) ;
- b4cursor_rec = d4recno() ;
- b4cursor_row = 0 ;
- b4display_cursor() ;
- return 0 ;
- }
-
- if ( no_recs > 0 && b4cursor_row < b4num_displayed-1 )
- {
- d4skip( (long) (b4num_displayed-1-b4cursor_row) ) ;
- b4cursor_rec = d4recno() ;
- b4cursor_row = b4num_displayed-1 ;
- b4display_cursor() ;
- return 0 ;
- }
-
- d4skip( (long) no_recs ) ;
- if ( d4eof()) d4skip(-1L) ;
- b4cursor_rec = d4recno() ;
- b4deact_menu() ;
- b4display_assume() ;
- d4unlock(-1L) ;
- return 0 ;
- }
-
- void b4margin( int top_margin, int bottom_margin )
- {
- b4top_margin = top_margin ;
- b4bottom_margin = bottom_margin ;
- }
-
- static int b4help( int junk_parm )
- {
- w4display( " Help ",
- "You can use the menu to select an option or you can press",
- "one of the following command keys:",
- "",
- "A Add a blank record.",
- "B Move to the bottom database record.",
- "C Add a record by copying the current record.",
- "D Mark the current record for deletion.",
- "E Switch to the edit screen if possible.",
- "F Find a record.",
- "H Display this help screen.",
- "M Modify the current record.",
- "R Enter a record to move to.",
- "S Select a record ordering index.",
- "T Move to the top database record.",
- "U Remove the deletion mark from the current record.",
- "Z Switch to the browse screen if possible.",
- "X Exit.",
- "<PgUp> or <PgDn> Move up/down one screen of records.",
- "<Up or Down Arrow> Move to the previous/next record.",
- (char *) 0 ) ;
- b4display_cursor() ;
- return 0 ;
- }
-
- static int b4record( int junk_parm )
- {
- long rec ;
- int rc, w_ref ;
-
- rec = b4cursor_rec ;
- if ( rec < 0L ) rec = 0L ;
-
- w_ref = w4define( 9,20,14,58 ) ;
- w4border( DOUBLE, F_WHITE ) ;
- w4popup() ;
- w4title( 0,-1, " Record Number Command ", B_WHITE ) ;
- w4activate( w_ref ) ;
-
- w4( 1,2, "Enter Record Number: " ) ;
- g4long( w4row(), w4col(), &rec ) ;
- w4( 2,2, "Records in Database:" ) ;
- w4long( w4row(),w4col(), d4reccount(), 9 ) ;
- rc = g4read() ; /* Read the Record */
-
- w4deactivate( w_ref ) ;
- w4close( w_ref ) ;
-
- if ( rc != ESC )
- {
- if ( rec > 0 && rec <= d4reccount() )
- {
- if ( is_empty )
- {
- w4display( " Message ",
- "To display a record, there will be an immediate",
- "switch to record number ordering.", (char *) 0 ) ;
- i4unselect() ;
- b4empty_check() ;
- }
- b4cursor_rec = rec ;
- b4cursor_row = 0 ;
-
- b4deact_menu() ;
- b4display_assume() ;
- }
- }
-
- b4display_cursor() ;
- d4unlock(-1L) ;
- return 0 ;
- }
-
- static int b4find( int junk_parm )
- {
- int index_ref, rc, w_ref ;
- char seek_data[101] ;
-
- index_ref = i4seek_ref() ;
- if ( index_ref < 0 ) return 0 ;
-
- w_ref = w4define( 9,21,16,58 ) ;
- w4popup() ;
- w4border( DOUBLE, F_WHITE ) ;
- w4title( 0,-1, " Find ", B_WHITE ) ;
- w4activate( w_ref ) ;
-
- w4( 1,3, "Find Index: ") ;
- w4( 1,w4col(), i4name(index_ref)) ;
-
- memset( seek_data, 0, (size_t) sizeof(seek_data) ) ;
- w4( 3,3, "Enter the Find Information:" ) ;
- g4( 4,3, seek_data ) ;
- if ( i4type(index_ref) == 'N' )
- g4width( 24, 24 ) ;
- else
- g4width( 24, 100 ) ;
- rc = g4read() ;
-
- w4deactivate( w_ref ) ;
- w4close( w_ref ) ;
-
- if ( rc == ESC )
- b4display_cursor() ;
- else
- {
- if ( i4type(index_ref) == 'N' )
- {
- if ( (rc = d4seek_double( c4atod(seek_data,24) )) < 0) return -1 ;
- }
- else
- if ( (rc = d4seek_str(seek_data))< 0) return -1 ;
-
- if ( rc == 3 )
- {
- c4trim_n( seek_data, (int) sizeof(seek_data) ) ;
- w4display( " The end of the file was reached finding data: ", seek_data, (char *) 0 ) ;
- b4display_cursor() ;
-
- d4unlock(-1L) ;
- return 0 ;
- }
-
- b4cursor_rec = d4recno() ;
- b4cursor_row = 0 ;
- b4deact_menu() ;
- b4display_assume() ;
- }
-
- d4unlock(-1L) ;
- return 0 ;
- }
-
-
- static int b4select_index( int item_ref )
- {
- i4select( n4int_get(item_ref) ) ;
- n4start_item( item_ref ) ;
- last_read_char = -2 ;
- do_escape = 1 ;
- return 0 ;
- }
-
- static int b4delete( int junk_parm )
- {
- if ( b4cursor_rec > 0L )
- d4delete( b4cursor_rec ) ;
-
- b4deact_menu() ;
- w4select( b4cur_ref ) ;
- b4display_one(b4cursor_row) ;
- d4unlock(-1L) ;
- return 0 ;
- }
-
- static int b4undelete( int junk_parm )
- {
- if ( b4cursor_rec > 0L )
- d4recall( b4cursor_rec ) ;
-
- b4deact_menu() ;
- w4select( b4cur_ref ) ;
- b4display_one(b4cursor_row) ;
- d4unlock(-1L) ;
- return 0 ;
- }
-
- static int b4browse_flip( int junk_parm )
- {
- if ( u4ptr_equal( (void *) user_edit_setup, (void *) 0)) return 0 ;
- if ( u4ptr_equal( (void *) user_browse_setup, (void *) 0)) return 0 ;
-
- b4deact_menu() ;
- n4refresh( b4pull_ref ) ;
-
- w4close( b4cur_ref ) ;
-
- if ( b4on_browse )
- b4edit_setup() ;
- else
- b4browse_setup() ;
-
- return 0 ;
- }
-
- #ifdef KR
- int b4edit( browse_setup, edit_setup )
- int (*browse_setup)() ;
- int (*edit_setup)() ;
- #else
- int b4edit( int (*browse_setup)(void), int (*edit_setup)(void) )
- #endif
- {
- b4on_browse = 0 ;
- return( b4setup( browse_setup, edit_setup) ) ;
- }
-
- #ifdef KR
- int b4browse( browse_setup, edit_setup )
- int (*browse_setup)() ;
- int (*edit_setup)() ;
- #else
- int b4browse( int (*browse_setup)(void), int (*edit_setup)(void) )
- #endif
- {
- b4on_browse = 1 ;
- return( b4setup( browse_setup, edit_setup) ) ;
- }
-
- static char browse_or_edit[] = "BROWSE" ;
-
- static void b4edit_setup()
- {
- b4cur_ref = (*user_edit_setup)() ;
- b4on_browse = 0 ;
- b4cur_top_margin = v4get[v4window_ptr->first_get].row ;
- b4page_size = 1 ;
- b4cursor_row = 0 ;
- b4cursor_col = v4get[v4window_ptr->first_get].col ;
- strcpy( browse_or_edit, "Browse" ) ;
- b4display_assume() ;
- d4unlock(-1L) ;
- }
-
- static void b4browse_setup()
- {
- b4cur_ref = (*user_browse_setup)() ;
- b4on_browse = 1 ;
- b4cur_top_margin = b4top_margin ;
- b4page_size = w4height(-1) - b4top_margin - b4bottom_margin ;
- b4cursor_row = 0 ;
- b4cursor_col = v4get[v4window_ptr->first_get].col ;
- strcpy( browse_or_edit, "Edit " ) ;
- b4display_assume() ;
- d4unlock(-1L) ;
- }
-
- #ifdef KR
- static int b4setup( browse_setup, edit_setup )
- int (*browse_setup)() ;
- int (*edit_setup)() ;
- #else
- static int b4setup( int (*browse_setup)(void), int (*edit_setup)(void) )
- #endif
- {
- int srch_ref, pos_ref, add_ref, ch_ref ;
- int i_ref, item_ref ;
- int start_lock_code ;
-
- w4clear(-1) ;
-
- user_edit_setup = edit_setup ;
- user_browse_setup = browse_setup ;
- start_lock_code = d4lock_code(2) ;
-
- b4empty_check() ;
-
- if ( b4on_browse )
- b4browse_setup() ;
- else
- b4edit_setup() ;
-
- b4select_ref = -1 ;
-
- /* Define the index file selection menu. */
- if ( d4ptr()->index_ref >= 0 )
- {
- i_ref = h4first( (char **) &v4index, d4ptr()->index_ref ) ;
-
- b4select_ref = w4define(-1,-1,-1,-1) ;
- n4( "Record Number Ordering" ) ;
- n4action( b4select_index ) ;
- n4int_save( -1 ) ;
- for (;i_ref >= 0; i_ref = v4index[i_ref].next )
- {
- item_ref = n4( v4index[i_ref].name ) ;
- if ( i4seek_ref() == i_ref )
- n4start_item( item_ref ) ;
- n4action( b4select_index ) ;
- n4int_save( i_ref ) ;
- }
- }
-
- /* Define the main pulldown menu. */
- n4key_special( -1, CTRL_C, -1,-1 ) ;
- b4pull_ref = w4define( -1,-1,-1,-1 ) ;
- n4key_special( ESC, CTRL_C, -1,-1 ) ;
-
- n4( "Help" ) ;
- n4key( 0,0,-1) ;
- n4action( b4help ) ;
-
- n4( "Modify" ) ;
- n4key( 0,0,-1) ;
- n4action( n4sub_menu ) ;
- n4ptr_save( &ch_ref ) ;
-
- n4( "Add" ) ;
- n4key( 0,0,-1) ;
- n4action( n4sub_menu ) ;
- n4ptr_save( &add_ref ) ;
-
- n4( "Position" ) ;
- n4key( 0,0,-1) ;
- n4action( n4sub_menu ) ;
- n4ptr_save( &pos_ref ) ;
-
- if ( b4select_ref >= 0 )
- {
- n4( "Find" ) ;
- n4key( 0,0,-1) ;
- n4action( n4sub_menu ) ;
- n4ptr_save( &srch_ref ) ;
- }
-
- if ( ! u4ptr_equal((void *) user_edit_setup,(void *) 0) &&
- ! u4ptr_equal((void *) user_edit_setup,(void *) 0))
- {
- n4( browse_or_edit ) ;
- n4key( 0,0,-1) ;
- n4action( b4browse_flip ) ;
- }
-
- n4( "Exit" ) ;
- n4key( 0,0,-1) ;
- n4parm( -1 ) ;
-
- ch_ref = w4define(-1,-1,-1,-1) ;
- n4( "Modify Record" ) ; n4action( b4modify ) ; n4parm(1) ;
- n4( "Delete Record" ) ; n4action( b4delete ) ;
- n4( "Undelete Record" ) ; n4action( b4undelete ) ;
-
- if ( b4select_ref >= 0 )
- {
- srch_ref = w4define(-1,-1,-1,-1) ;
- n4( "Find" ) ; n4action( b4find ) ;
- if ( b4select_ref >= 0 )
- {
- n4( "Select Record Ordering Index" ) ;
- n4action( n4sub_menu ) ;
- n4ptr_save( &b4select_ref ) ;
- }
- }
-
- pos_ref = w4define(-1,-1,-1,-1) ;
- n4( "Record" ) ; n4action( b4record ) ;
- n4( "Top" ) ; n4action( b4top ) ;
- n4( "Bottom" ) ; n4action( b4bottom ) ;
-
- add_ref = w4define(-1,-1,-1,-1) ;
- n4( "Add Blank" ) ; n4action( b4add_copy ) ; n4parm(1) ;
- n4( "Add Copy" ) ; n4action( b4add_copy ) ; n4parm(0) ;
- n4key( (int) 'C', 1, 4 ) ;
-
- n4pulldown( b4pull_ref ) ;
- w4select( b4pull_ref ) ;
- w4memory() ;
- n4char_routine( b4char ) ;
- n4activate( b4pull_ref ) ;
-
- w4close( b4cur_ref ) ;
-
- w4deactivate( b4pull_ref ) ;
- w4close( b4pull_ref ) ;
- n4char_routine( 0 ) ;
-
- if ( b4select_ref >= 0 )
- {
- w4close( b4select_ref ) ;
- w4close( srch_ref ) ;
- }
-
- w4close( pos_ref ) ;
- w4close( add_ref ) ;
- w4close( ch_ref ) ;
-
- d4lock_code( start_lock_code ) ;
- w4clear(-1) ;
-
- return 0 ;
- }
-
- static int b4char()
- {
- int rc ;
-
- if ( do_escape )
- {
- do_escape = 0 ;
- return ESC ;
- }
-
- if ( last_read_char != 0 )
- {
- rc = last_read_char ;
- last_read_char = 0 ;
- }
- else
- rc = g4char() ;
-
- if ( rc > 0 && rc < 0xFF )
- rc = u4toupper(rc) ;
-
- if ( w4select(-1) != b4pull_ref )
- if ( rc >= (int) 'A' && rc <= (int) 'Z' ) return rc ;
-
- switch( rc )
- {
- case PGUP:
- b4page( -b4page_size ) ;
- break ;
-
- case PGDN:
- b4page( b4page_size ) ;
- break ;
-
- #ifndef UNIX
- case ALT_A:
- #endif
- case 'A':
- b4add_copy(1) ;
- break ;
-
- #ifndef UNIX
- case ALT_B:
- #endif
- case 'B':
- b4bottom(0) ;
- break ;
-
- #ifndef UNIX
- case ALT_C:
- #endif
- case 'C':
- b4add_copy(0) ;
- break ;
-
- #ifndef UNIX
- case ALT_D:
- #endif
- case 'D':
- b4delete(0) ;
- break ;
-
- #ifndef UNIX
- case ALT_E:
- #endif
- case 'E':
- if ( b4on_browse )
- b4browse_flip(0) ;
- break ;
-
- #ifndef UNIX
- case ALT_F:
- #endif
- case 'F':
- b4find(0) ;
- break ;
-
- #ifndef UNIX
- case ALT_H:
- #endif
- case 'H':
- b4help(0) ;
- break ;
-
- #ifndef UNIX
- case ALT_M:
- #endif
- case 'M':
- b4modify(1) ;
- break ;
-
- #ifndef UNIX
- case ALT_R:
- #endif
- case 'R':
- b4record(0) ;
- break ;
-
- #ifndef UNIX
- case ALT_S:
- #endif
- case 'S':
- if ( b4select_ref >= 0 )
- n4activate( b4select_ref ) ;
- break ;
-
- case -2: /* After 'b4select_index' to refresh the display. */
- b4deact_menu() ;
- b4go_rec() ;
- b4empty_check() ;
- b4display_assume() ;
- if ( b4cursor_rec == -1L )
- {
- b4cursor_rec = b4start_rec ;
- b4cursor_row = 0 ;
- }
- d4unlock(-1L) ;
- break ;
-
- #ifndef UNIX
- case ALT_T:
- #endif
- case 'T':
- b4top(0) ;
- break ;
-
- #ifndef UNIX
- case ALT_U:
- #endif
- case 'U':
- b4undelete(0) ;
- break ;
-
- #ifndef UNIX
- case ALT_Z:
- #endif
- case 'Z':
- if ( ! b4on_browse )
- b4browse_flip(0) ;
- break ;
-
- #ifndef UNIX
- case ALT_X:
- #endif
- case 'X':
- return CTRL_C ;
-
- case UP:
- if ( v4window_ptr->horizontal )
- b4skip_one(-1) ;
- return rc ;
-
- case DOWN:
- if ( v4window_ptr->horizontal )
- b4skip_one(1) ;
- return rc ;
-
- default:
- return rc ;
- }
-
- return 0 ;
- }
-