home *** CD-ROM | disk | FTP | other *** search
-
- /* (c)Copyright Sequiter Software Inc., 1987, 1988, 1989. All rights reserved.
-
- This is the example from routine 'n4pull_down' in the manual.
- */
-
- #include "d4base.h"
- #include "w4.h"
- #include <stdlib.h>
-
- main()
- {
- int horizontal_ref, sub_one, sub_two ;
- char no_flds[20], *rec_ptr ;
-
- w4clear(-1) ;
-
- /* Open the database */
- if ( d4use( "D4LEARN.DBF" ) < 0 ) exit(1) ;
-
- /* Calculate some display information */
- itoa( f4num_fields(), no_flds, 10 ) ;
- rec_ptr = f4record() ;
-
- /* Define the horizontal menu bar */
- horizontal_ref = w4define( -1,-1,-1,-1 ) ;
-
- /* Define the main menu items */
- n4( "Position Database" ) ;
- n4reaction( n4activate, &sub_one ) ;
-
- n4( "Display" ) ;
- n4reaction( n4activate, &sub_two ) ;
-
- /* Define the 'Position Database' sub-menu */
- sub_one = w4define( -1,-1,-1,-1 ) ;
- n4( "First Record" ) ;
- n4action( d4top ) ;
-
- n4( "Last Record" ) ;
- n4action( d4bottom ) ;
-
- n4( "Next Record" ) ;
- n4action( d4skip, 1L ) ;
-
- /* Define the 'Display' sub-menu */
- sub_two = w4define( -1,-1,-1,-1 ) ;
-
- n4( "Database Record" ) ;
- n4action( w4display, rec_ptr, (char *) 0 ) ;
-
- n4( "Number of Fields" ) ;
- n4action( w4display, no_flds, (char *) 0 ) ;
-
- /* Turn the menus into a pulldown menu. */
- n4pulldown( horizontal_ref ) ;
-
- /* Activate the menuing pulldown system */
- w4cursor( -1,-1 ) ;
- n4activate( &horizontal_ref ) ;
- w4cursor( 23,0 ) ;
-
- w4close( horizontal_ref ) ;
- w4close( sub_one ) ;
- w4close( sub_two ) ;
-
- exit(0) ;
- }
-