home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1994 #1
/
monster.zip
/
monster
/
CLIPPER
/
NCCLIB.ZIP
/
NCCVIEW.ZIP
/
G_MENU.PRG
< prev
next >
Wrap
Text File
|
1994-01-20
|
8KB
|
134 lines
//═══════════════════════════════════════════════════════╕
// Program .....: G_Menu │
// CopyRight ...: 1993 National Computer Consultants │
// All rights are reserved. │
// Author ......: Greg Rice │
//═══════════════════════════════════════════════════════╛
#include "g_menu.ch"
#include "inkey.ch"
Function g_menu()
local Bar
Bar := NccBar():New(1)
Bar:MouseActive := .t.
Bar:AddMenuPrompt( ABOUT , ' ≡ ' ) ; Bar:PromptSubMenu( ABOUT , Menu_(0, Bar) )
Bar:AddMenuPrompt( FILE , ' File ' ) ; Bar:PromptSubMenu( FILE , Menu_(1, Bar) )
Bar:AddMenuPrompt( EDIT , ' Edit ' ) ; Bar:PromptSubMenu( EDIT , Menu_(2, Bar) )
Bar:AddMenuPrompt( INDEX , ' Index ' ) ; Bar:PromptSubMenu( INDEX , Menu_(3, Bar) )
Bar:AddMenuPrompt( VIEW , ' Field~s ' ) ; Bar:PromptSubMenu( VIEW , Menu_(4, Bar) )
Bar:AddMenuPrompt( POSITION , ' Record ' ) ; Bar:PromptSubMenu( POSITION , Menu_(5, Bar) )
Bar:AddMenuPrompt( WINDOW , ' Window ' ) ; Bar:PromptSubMenu( WINDOW , Menu_(6, Bar) )
Bar:AddMenuPrompt( HELP , ' Help ' ) ; Bar:PromptSubMenu( HELP , Menu_(8, Bar) )
Bar:PromptQuickKey( CHANGE_RECORD , K_ENTER )
Bar:PromptQuickKey( VIEW_MODIFY , K_ALT_L )
Bar:PromptQuickKey( WIN_MOVE , K_ALT_M )
Bar:PromptQuickKey( SYS_EXIT , K_ALT_X )
Bar:PromptQuickKey( WIN_ZOOM , K_ALT_Z )
Bar:PromptQuickKey( INDEX_REORDER , K_CTRL_H )
Return( Bar )
static Function Menu_( x, Bar )
local m, s
m := NccMenu():New
m:Shadow := .t.
m:Border := 4
m:LetterColor := Bar:LetterColor
Do Case
Case x == 0
m:AddPrompt( ABOUT_ABOUT , ' About ' ) ; m:PromptMessage( , 'About National Computer Consultants' )
Case x == 1
m:AddPrompt( DATABASE_OPEN , ' Open F' ) ; m:PromptMessage( , 'Open a Database File' )
m:AddPrompt( DATABASE_CLOSE , ' Close ' ) ; m:PromptMessage( , 'Close Database File' )
m:AddPromptLine()
m:AddPrompt( TEXTFILE_OPEN , ' View Text File ' ) ; m:PromptMessage( , 'View a Text File' )
m:AddPromptLine()
m:AddPrompt( PRINT_SUB, ' Print ' ) ; m:PromptMessage( , 'Print...' )
s := NccMenu():New
s:Shadow := m:Shadow
s:Border := m:Border
s:BorderColor := m:BorderColor
s:LetterColor := m:LetterColor
s:MessageColor := m:MessageColor
s:AddPrompt( PRINT_FILE , ' File ' ) ; s:PromptMessage( , 'Print File based on criteria' )
s:AddPrompt( PRINT_STRUCTURE, ' file ~Structure ' ) ; s:PromptMessage( , 'Print File structure' )
m:PromptSubMenu( , s )
m:AddPromptLine()
m:AddPrompt( SYS_EXIT, ' e~Xit Alt-X' ) ; m:PromptMessage( , 'Quit NccView...' )
Case x == 2
m:AddPrompt( CHANGE_RECORD , ' Change record Enter' ) ; m:PromptMessage( , 'Edit Current Record' )
m:AddPromptLine()
m:AddPrompt( ADD_RECORD , ' Add record A' ) ; m:PromptMessage( , 'Add Record to Database' )
m:AddPrompt( DUPE_RECORD , ' d~Uplicate record ' ) ; m:PromptMessage( , 'Duplicate Current Record' )
m:AddPrompt( INS_BLANK , ' Insert blank record Ins' ) ; m:PromptMessage( , 'Insert Blank Record' )
m:AddPrompt( DELE_RECORD , ' Delete/undelete record D' ) ; m:PromptMessage( , 'Delete/undelete Group of Records' )
m:AddPromptLine()
m:AddPrompt( REPLACE_REC , ' Replace R' ) ; m:PromptMessage( , 'Replace Field values for group of records' )
m:AddPrompt( PACK_FILE , ' Pack P' ) ; m:PromptMessage( , 'Permanently remove deleted records' )
m:AddPrompt( ZAP_FILE , ' Zap Z' ) ; m:PromptMessage( , 'Permanently remove all records from current database' )
Case x == 3
m:AddPrompt( INDEX_NEW , ' New ' ) ; m:PromptMessage( , 'Create New Index' )
m:AddPrompt( INDEX_OPEN , ' Open I' ) ; m:PromptMessage( , 'Open a Existing Index' )
m:AddPrompt( INDEX_CLOSE , ' Close ' ) ; m:PromptMessage( , 'Close all Index files' )
m:AddPromptLine()
m:AddPrompt( INDEX_REORDER , ' c~Hange index order Ctrl-H' ) ; m:PromptMessage( , 'Change Controlling Index order' )
m:AddPrompt( INDEX_MODIFY , ' modify index ~Expression ' ) ; m:PromptMessage( , 'Change an index expression' )
m:AddPrompt( INDEX_REINDEX , ' Recreate all index files Alt-R' ) ; m:PromptMessage( , 'Reindex all index files' )
m:AddPromptLine()
m:AddPrompt( INDEX_RELATION , ' Set Relation ', .f. ) ; m:PromptMessage( , 'Not available. Underdevelopment' )
Case x == 4
m:AddPrompt( VIEW_MODIFY , ' modify field ~List Alt-L' ) ; m:PromptMessage( , 'Modify Fields in Window')
m:AddPromptLine()
m:AddPrompt( VIEW_VERT , ' Vertical records ' ) ; m:PromptMessage( , 'Display records in a Vertical format' )
m:AddPrompt( VIEW_HORI , ' Horizontal records ' ) ; m:PromptMessage( , 'Display records in a Horizontal format' )
m:AddPromptLine()
m:AddPrompt( _STRUCTURE , ' str~Ucture ' ) ; m:PromptMessage( , 'Database Structure...' )
s := NccMenu():New
s:Shadow := m:Shadow
s:Border := m:Border
s:BorderColor := m:BorderColor
s:LetterColor := m:LetterColor
s:MessageColor := m:MessageColor
s:AddPrompt( STRUCTURE_DISPLAY, ' Display structure ' ) ; s:PromptMessage( , 'Display Database Structure' )
s:AddPrompt( DATABASE_MODIFY , ' Modify structure ' ) ; s:PromptMessage( , 'Not available. Underdevelopment' )
m:PromptSubMenu( , s )
Case x == 5
m:AddPrompt( GO_REC , ' Go to record G' ) ; m:PromptMessage( , 'Go to specific record' )
m:AddPrompt( LOCA_REC , ' Locate L' ) ; m:PromptMessage( , 'Locate a record based on a locate command' )
m:AddPrompt( SEEK_REC , ' Seek S' ) ; m:PromptMessage( , 'Seek a record based on an Index condition' )
Case x == 6
m:AddPrompt( WIN_NEXT , ' Next Tab' ) ; m:PromptMessage( , 'Change to next window by mouse or keyboard' )
m:AddPrompt( WIN_PREV , ' Previous Shift-Tab' ) ; m:PromptMessage( , 'Change to previous window by mouse or keyboard' )
m:AddPrompt( WIN_MOVE , ' Move/resize Alt-M' ) ; m:PromptMessage( , 'Change window coordinates or position by mouse or keyboard' )
m:AddPrompt( WIN_ZOOM , ' Zoom Alt-Z' ) ; m:PromptMessage( , 'Toggle between Full screen and default size window' )
Case x == 8
m:AddPrompt( HELP_GEN , ' Help ' ) ; m:PromptMessage( , 'Help on NccView' )
m:AddPrompt( HELP_KEY , ' Help Index ' ) ; m:PromptMessage( , 'Index on Help in the system' )
EndCase
Return( m )