



DoMenu (lines 715-823)
Back to List
Browsing verblibm.h
0715 #Endif; ! V3
0716
0717 #IfV5;
0718
0719 [ DoMenu menu_choices EntryR ChoiceR
0720 lines main_title main_wid cl i j oldcl pkey ch cw y x;
0721 if (pretty_flag == 0) return LowKey_Menu(menu_choices, EntryR, ChoiceR);
0722 menu_nesting++;
0723 menu_item = 0;
0724 lines = indirect(EntryR);
0725 main_title = item_name; main_wid = item_width;
0726 cl = 7;
0727
0728 .ReDisplay;
0729
0730 oldcl = 0;
0731 @erase_window $ffff;
0732 #Iftrue (#version_number == 6);
0733 @set_cursor -1;
0734 ch = HDR_FONTWUNITS->0;
0735 #Ifnot;
0736 ch = 1;
0737 #Endif;
0738 i = ch * (lines+7);
0739 @split_window i;
0740 i = HDR_SCREENWCHARS->0;
0741 if (i == 0) i = 80;
0742 @set_window 1;
0743 @set_cursor 1 1;
0744
0745 #Iftrue (#version_number == 6);
0746 @set_font 4 -> cw;
0747 cw = HDR_FONTHUNITS->0;
0748 #Ifnot;
0749 cw = 1;
0750 #Endif;
0751
0752 style reverse;
0753 spaces(i); j=1+(i/2-main_wid)*cw;
0754 @set_cursor 1 j;
0755 print (string) main_title;
0756 y=1+ch; @set_cursor y 1; spaces(i);
0757 x=1+cw; @set_cursor y x; print (string) NKEY__TX;
0758 j=1+(i-13)*cw; @set_cursor y j; print (string) PKEY__TX;
0759 y=y+ch; @set_cursor y 1; spaces(i);
0760 @set_cursor y x; print (string) RKEY__TX;
0761 j=1+(i-18)*cw; @set_cursor y j;
0762
0763 if (menu_nesting == 1) print (string) QKEY1__TX;
0764 else print (string) QKEY2__TX;
0765 style roman;
0766 y = y+2*ch;
0767 @set_cursor y x; font off;
0768
0769 if (menu_choices ofclass String) print (string) menu_choices;
0770 else menu_choices.call();
0771
0772 x = 1+3*cw;
0773 for (::) {
0774 if (cl ~= oldcl) {
0775 if (oldcl>0) {
0776 y=1+(oldcl-1)*ch; @set_cursor y x; print " ";
0777 }
0778 y=1+(cl-1)*ch; @set_cursor y x; print ">";
0779 }
0780
0781 oldcl = cl;
0782 @read_char 1 -> pkey;
0783 if (pkey == NKEY1__KY or NKEY2__KY or 130) {
0784 cl++; if (cl == 7+lines) cl = 7; continue;
0785 }
0786 if (pkey == PKEY1__KY or PKEY2__KY or 129) {
0787 cl--; if (cl == 6) cl = 6+lines; continue;
0788 }
0789 if (pkey == QKEY1__KY or QKEY2__KY or 27 or 131) break;
0790 if (pkey == 10 or 13 or 132) {
0791 @set_window 0; font on;
0792 new_line; new_line; new_line;
0793
0794 menu_item = cl-6;
0795 EntryR.call();
0796
0797 @erase_window $ffff;
0798 @split_window ch;
0799 i = HDR_SCREENWCHARS->0; if ( i== 0) i = 80;
0800 @set_window 1; @set_cursor 1 1; style reverse; spaces(i);
0801 j=1+(i/2-item_width)*cw;
0802 @set_cursor 1 j;
0803 print (string) item_name;
0804 style roman; @set_window 0; new_line;
0805
0806 i = ChoiceR.call();
0807 if (i == 2) jump ReDisplay;
0808 if (i == 3) break;
0809
0810 L__M(##Miscellany, 53);
0811 @read_char 1 -> pkey; jump ReDisplay;
0812 }
0813 }
0814
0815 menu_nesting--; if (menu_nesting > 0) rfalse;
0816 font on; @set_cursor 1 1;
0817 @erase_window $ffff; @set_window 0;
0818 #Iftrue (#version_number == 6);
0819 @set_cursor -2;
0820 #Endif;
0821 new_line; new_line; new_line;
0822 if (deadflag == 0) <<Look>>;
0823 ];
Last updated 27 February 2004. The librarian in charge of this page is Graham Nelson (graham@gnelson.demon.co.uk) assisted by C Knight. Please email any comments, suggestions or corrections to cedenqs@inform-fiction.org.