home *** CD-ROM | disk | FTP | other *** search
-
- (*
- * Copyright 1987, 1989 Samuel H. Smith; All rights reserved
- *
- * This is a component of the ProDoor System.
- * Do not distribute modified versions without my permission.
- * Do not remove or alter this notice or any other copyright notice.
- * If you use this in your own program you must distribute source code.
- * Do not use any of this in a commercial product.
- *
- *)
-
- (*
- * Example program for pulldown menu system
- *
- * Samuel H. Smith, 13-nov-87
- *
- *)
-
- {$t+}
-
- uses CRT;
-
- {$i \tinc\getkey.inc}
- {$i \tinc\pop3.inc}
- {$i \tinc\border.inc}
- {$i \tinc\pull.inc}
-
-
- {define pulldown menu codes}
- const
- UNDEFINED_MENU = 1;
- CALIB_MENU = 2;
- DISPLAY_MENU = 3;
- GRAPH_MENU = 4;
- REPORT_MENU = 5;
- FILES_MENU = 6;
- SETUP_MENU = 7;
- QUIT_MENU = 8;
-
-
- {define line item actions}
- const
- UNDEF_ACTION = 10000;
- LEAVE_MENU = 10001;
- QUIT_TOP = 10002;
-
-
-
- {define pulldown menu contents}
- const
- pull_count = 8;
- pull_table: array[0..pull_count] of pulldown_rec = (
-
- ( border: taildouble_border;
- border_fg: white; border_bg: black; {color definition}
- text_fg: white; text_bg: black;
- select_fg: black; select_bg: white;
- ainit: 0; aexit: 0; {init and exit actions}
-
- line: ( (title: 'Calibrate'; action: CALIB_MENU),
- (title: 'Display'; action: DISPLAY_MENU),
- (title: 'Graph'; action: GRAPH_MENU),
- (title: 'Report'; action: REPORT_MENU),
- (title: 'File'; action: FILES_MENU),
- (title: 'Setup'; action: SETUP_MENU),
- (title: 'Test'; action: UNDEFINED_MENU),
- (title: 'Quit'; action: QUIT_MENU),
- (title: ''; action: unused_entry),
- (title: ''; action: unused_entry) )),
-
-
- ( border: single_border;
- border_fg: white; border_bg: black;
- text_fg: white; text_bg: black;
- select_fg: black; select_bg: white;
- ainit: 0; aexit: 0;
-
- line: ( (title: 'Function not implemented'; action: divider_entry),
- (title: ' Cancel '; action: LEAVE_MENU),
- (title: ''; action: unused_entry),
- (title: ''; action: unused_entry),
- (title: ''; action: unused_entry),
- (title: ''; action: unused_entry),
- (title: ''; action: unused_entry),
- (title: ''; action: unused_entry),
- (title: ''; action: unused_entry),
- (title: ''; action: unused_entry) )),
-
-
- ( border: taildouble_border;
- border_fg: white; border_bg: black;
- text_fg: white; text_bg: black;
- select_fg: black; select_bg: white;
- ainit: 0; aexit: 0;
-
- line: ( (title: 'New calibration'; action: UNDEF_ACTION),
- (title: 'Single run'; action: UNDEF_ACTION),
- (title: 'Automatic run'; action: UNDEF_ACTION),
- (title: 'Options...'; action: UNDEF_ACTION),
- (title: ''; action: unused_entry),
- (title: ''; action: unused_entry),
- (title: ''; action: unused_entry),
- (title: ''; action: unused_entry),
- (title: ''; action: unused_entry),
- (title: ''; action: unused_entry) )),
-
-
- ( border: taildouble_border;
- border_fg: white; border_bg: black;
- text_fg: white; text_bg: black;
- select_fg: black; select_bg: white;
- ainit: 0; aexit: 0;
-
- line: ( (title: 'Next'; action: UNDEF_ACTION),
- (title: 'Previous'; action: UNDEF_ACTION),
- (title: 'Delete'; action: UNDEF_ACTION),
- (title: 'Insert'; action: UNDEF_ACTION),
- (title: 'Edit'; action: UNDEF_ACTION),
- (title: 'Formula'; action: UNDEF_ACTION),
- (title: 'Recalculate'; action: UNDEF_ACTION),
- (title: ''; action: unused_entry),
- (title: ''; action: unused_entry),
- (title: ''; action: unused_entry) )),
-
-
- ( border: taildouble_border;
- border_fg: white; border_bg: black;
- text_fg: white; text_bg: black;
- select_fg: black; select_bg: white;
- ainit: 0; aexit: 0;
-
- line: ( (title: 'K vs Flow'; action: UNDEF_ACTION),
- (title: 'K vs Frequency'; action: UNDEF_ACTION),
- (title: 'Freq vs Flow'; action: UNDEF_ACTION),
- (title: 'K vs Reynolds'; action: UNDEF_ACTION),
- (title: 'Reading Error'; action: UNDEF_ACTION),
- (title: 'F.S. Error'; action: UNDEF_ACTION),
- (title: 'User Defined'; action: UNDEF_ACTION),
- (title: 'Options...'; action: UNDEF_ACTION),
- (title: ''; action: unused_entry),
- (title: ''; action: unused_entry) )),
-
-
- ( border: taildouble_border;
- border_fg: white; border_bg: black;
- text_fg: white; text_bg: black;
- select_fg: black; select_bg: white;
- ainit: 0; aexit: 0;
-
- line: ( (title: 'Header data...'; action: UNDEF_ACTION),
- (title: 'Mechanical datasheet'; action: UNDEF_ACTION),
- (title: 'Electronic datasheet'; action: UNDEF_ACTION),
- (title: 'Detail datasheet'; action: UNDEF_ACTION),
- (title: 'Display summary'; action: UNDEF_ACTION),
- (title: ''; action: unused_entry),
- (title: ''; action: unused_entry),
- (title: ''; action: unused_entry),
- (title: ''; action: unused_entry),
- (title: ''; action: unused_entry) )),
-
-
- ( border: taildouble_border;
- border_fg: white; border_bg: black;
- text_fg: white; text_bg: black;
- select_fg: black; select_bg: white;
- ainit: 0; aexit: 0;
-
- line: ( (title: 'Store'; action: UNDEF_ACTION),
- (title: 'Load'; action: UNDEF_ACTION),
- (title: 'Delete'; action: UNDEF_ACTION),
- (title: '-----------------'; action: divider_entry),
- (title: 'Working directory'; action: UNDEF_ACTION),
- (title: 'Sort order'; action: UNDEF_ACTION),
- (title: ''; action: unused_entry),
- (title: ''; action: unused_entry),
- (title: ''; action: unused_entry),
- (title: ''; action: unused_entry) )),
-
-
- ( border: taildouble_border;
- border_fg: white; border_bg: black;
- text_fg: white; text_bg: black;
- select_fg: black; select_bg: white;
- ainit: 0; aexit: 0;
-
- line: ( (title: 'General'; action: UNDEF_ACTION),
- (title: 'Analog inputs'; action: UNDEF_ACTION),
- (title: 'Motion control'; action: UNDEF_ACTION),
- (title: 'Density table'; action: UNDEF_ACTION),
- (title: 'Viscosity'; action: UNDEF_ACTION),
- (title: 'Special...'; action: UNDEF_ACTION),
- (title: '-----------------'; action: divider_entry),
- (title: 'stoRe settings'; action: UNDEF_ACTION),
- (title: 'Load settings'; action: UNDEF_ACTION),
- (title: 'Factory defaults'; action: UNDEF_ACTION) )),
-
-
- ( border: taildouble_border;
- border_fg: white; border_bg: black;
- text_fg: white; text_bg: black;
- select_fg: black; select_bg: white;
- ainit: 0; aexit: 0;
-
- line: ( (title: 'Stay'; action: LEAVE_MENU),
- (title: 'Quit'; action: QUIT_TOP),
- (title: ''; action: unused_entry),
- (title: ''; action: unused_entry),
- (title: ''; action: unused_entry),
- (title: ''; action: unused_entry),
- (title: ''; action: unused_entry),
- (title: ''; action: unused_entry),
- (title: ''; action: unused_entry),
- (title: ''; action: unused_entry) ))
- );
-
-
- {$i \tinc\top.inc}
-
-
- function pulldown_action{pullno: integer; (* pulldown menu number *)
- entry: integer; (* entry in pulldown menu *)
- action: integer; (* action code *)
- var sel: char) (* select key *)
- : boolean}; (* true to force menu exit *)
- {pulldown action routine; called when a pulldown entry is selected}
- begin
-
- case action of
- UNDEF_ACTION:
- begin
- select_pulled(UNDEFINED_MENU,sel);
- pulldown_action := false;
- end;
-
- LEAVE_MENU:
- begin
- pulldown_action := true;
- sel := ESC;
- end;
-
- QUIT_TOP:
- begin
- pulldown_action := true;
- sel := quit_sel;
- end;
-
- else
- pulldown_action := false;
- end;
- end;
-
-
- procedure pulldown_init{pullno: integer;
- action: integer;
- var sel: char};
- {pulldown init routine; called when a pulldown menu is opened}
- var
- x,y: integer;
- begin
-
- x := wherex;
- y := wherey;
- setcolor(green,black);
- gotoxy(14,22);
- displn(' '#24#25#27#26' to select, ─┘ to activate, F1 for Help ');
-
- setcolor(white,red);
-
- case pullno of
-
- UNDEFINED_MENU: ;
-
- CALIB_MENU:
- begin
- gotoxy(20,14); disp(' ');
- gotoxy(20,15); disp(' Selected flow rate = ______ ');
- gotoxy(20,16); disp(' Top flow rate = ______ ');
- gotoxy(20,17); disp(' Bottom flow rate = ______ ');
- gotoxy(20,18); disp(' Flowmeter pulses = ______ ');
- gotoxy(20,19); disp(' ');
- end;
-
- DISPLAY_MENU:
- begin
- gotoxy(10,20); disp(' Datapoint ___ out of ___ ');
- end;
-
- GRAPH_MENU: ;
-
- REPORT_MENU: ;
-
- FILES_MENU: ;
-
- SETUP_MENU: ;
-
- QUIT_MENU: ;
- end;
-
- gotoxy(x,y);
- end;
-
-
- procedure pulldown_exit{pullno: integer;
- action: integer;
- var sel: char};
- {pulldown exit routine; called when a pulldown menu is closed}
- begin
- end;
-
-
- function pulldown_key {pullno: integer; (* pulldown menu number *)
- entry: integer; (* entry in pulldown menu *)
- var sel: char) (* select key *)
- : boolean}; (* true to force menu exit *)
- {process unknown keys}
- procedure help;
- var
- save: window_save_rec;
- begin
- save_window(save);
- window(1,1,80,25);
- setcolor(black,yellow);
- display_border(24,5,57,14,thinsolid_border);
-
- gotoxy(25, 6); disp(' ');
- gotoxy(25, 7); disp(' --- Help-on-tap --- ');
- gotoxy(25, 8); disp(' ');
- gotoxy(25, 9); disp(' Pulldown # ');
- write(pullno:3); disp(' ');
- gotoxy(25,10); disp(' Entry # ');
- write(entry:3); disp(' ');
- gotoxy(25,11); disp(' ');
- gotoxy(25,12); disp(' [ Press ESC to exit ] ');
- gotoxy(25,13); disp(' ');
-
- repeat
- until getkey = ESC;
-
- restore_window(save);
- end;
-
- begin
- pulldown_key := false;
-
- case sel of
- F1: help;
- else disp(^G);
- end;
- end;
-
-
- begin
- init_pop_up;
- setcolor(white,blue);
- clrscr;
-
- setcolor(green,black);
- gotoxy(14,22);
- displn(' '#25#27#26' to select, ─┘ to activate, F1 for Help ');
-
- setcolor(yellow,black);
- gotoxy(20,24);
- displn(' CALIBRON SYSTEMS - LIQUID FLOW PROVER ');
-
- top_menu(6,3,pull_table[0]);
-
- setcolor(white,blue);
- clrscr;
- end.
-