From:	ADVAX::"FILESERV@Dayton.SAIC.COM"  5-APR-1991 07:07:16.68
To:	ARISIA::EVERHART
CC:	
Subj:	NEWS_V60-3_PATCH.20

Received: by ADVAX.DECnet (utk-mail11 v1.5) ; Fri, 5 Apr 91 07:04:33 EST
Received:  from mcnc by ge-dab.GE.COM (5.61/GE-DAB 1.15) with UUCP
	id AA25058 for ; Fri, 5 Apr 91 06:38:15 -0500
From: FILESERV-Mgr@Dayton.SAIC.COM
Received: from dayvc.dayton.saic.com by mcnc.mcnc.org (5.59/MCNC/3-21-91)
	id AA02796; Thu, 4 Apr 91 18:28:29 -0500
	for ARISIA.dnet.ge.com!EVERHART
Message-Id: <9104042328.AA02796@mcnc.mcnc.org>
Received: by Dayton.SAIC.COM (MX V2.2-2) id 4820; Thu, 04 Apr 1991 18:25:55 EST
Date: Thu, 04 Apr 1991 18:25:55 EST
Reply-To: FILESERV@Dayton.SAIC.COM
Subject: NEWS_V60-3_PATCH.20
To: ARISIA::EVERHART
 
-+-+-+-+-+-+-+-+ START OF PART 2 -+-+-+-+-+-+-+-+
X`7D,  /* * export options for level 2    */`20
X`0C
X
X
X`7B  /* add options for level 2      MENU 9 */
X`7B 3 `7D,`7B
X"Followup"      , 0 , 'f'     , 0 ,           "FOLLOWUP/HEADERS" ,       -1
V ,
X           "Add an item to NEWS which is a comment about the current item",`
V20
X"Post"      , 0 , 'p'     , 0 ,           "POST/HEADER" ,                -1
V ,
X           "Add an item to NEWS",`20
X"Reply"      , 0 , 'r'     , 0 ,           "REPLY/HEADERS" ,             -1
V ,
X           "Send EMAIL to the author of the current item"
X       `7D
X`7D,  /*  add options for level 2    */`20
X`0C
X
X
X`7B  /* skip options from level 2 MENU 10 */
X`7B 5 `7D,`7B
X"Stream"          ,0 ,  's'     , 0 ,           "SKIP/FOLLOWUP" , -1 ,
X           "Skip all items in the current conversation stream",
X"To-current"      , 0 , 't'     , 0 ,           "SKIP/POINTER" , -1  ,
X           "Skip all items up to and including the current item",`20
X"suBject"      , 0 , 'b'     , 2 ,           "KILL/SUBJECT" ,    -1 ,
X           "Filter out (Skip) all items with the same subject as the current
V item",`20
X"seNder"      , 0 , 'n'     , 2 ,           "KILL/FROM" ,          -1 ,
X           "Filter out (Skip) all items sent by the sender of the current it
Vem",`20
X"Current"      , 0 , 'c'     , 0 ,           "SKIP" ,             -1 ,
X           "Skip the current item"
X       `7D
X`7D,  /* * skip options from level 2    */`20
X`0C
X
X
X`7B  /* others options from level 2       MENU 11 */
X`7B 6 `7D,`7B
X"Clear"      , 0 , 'c'     , 0 ,           "" ,                12 ,
X           "Remove kill filters or marks `7B`7D",`20
X"eXport"      , 0 , 'x'   , 1 ,           "" ,                8 ,
X           "Print or extract the item pointed to `7B`7D",`20
X"Quit"      , 0 , 'q'     , 0 ,           "QUIT" ,                -1 ,
X           "Finish using NEWS and do not keep a record of items read",`20
X"sHell"         , 0  , 'h'    , 1 ,           ""        , 17   ,
X           "Temporarily return to $ prompt or edit a file `7B`7D",
X"Noscreen"      , 0 , 'n'     , 0 ,           "NOSCREEN" ,        -1 ,
X           "Switch to scrolling screen mode; use SCREEN to return to current
V mode",
X"enRolment"  , 0   ,'r'   , 2  ,           ""              , 4 ,
X           "Register or deregister from this newsgroup `7B`7D"
X
X       `7D
X`7D,  /* others options from level 2     */`20
X`0C
X
X
X`7B  /* what to clear from level 2 and three   MENU 12 */
X`7B 2 `7D,`7B
X"Mark"      , 0 , 'm'     , 0 ,           "UNMARK" , -1 ,
X           "Remove any marks on the current items",`20
X"Filters"      , 0 , 'f'     , 0 ,           "CLEAR KILL" , -1 ,
X           "Remove all the filters skipping certain subjects and senders"
X       `7D
X`7D,  /*  what to clear   */`20
X`0C
X
X
X`7B  /* read options for level 3  MENU 13 */
X`7B 8 `7D,`7B
X"Header"      , 0 , 'h'     , 0 ,           "READ/HEADER" ,       -1,
X           "See the header of this item",`20
X"Previous"      , 0 , 'p'     , 0 ,           "READ/PREVIOUS" ,   -1 ,
X           "Re-read the last messages read",
X"Editor"      , 0 , 'e'     , 0 ,           "READ/EDITOR" ,       -1 ,
X           "Place this item into an editor (so FIND etc can be used)",`20
X"Newest"      , 0 , 'n'     , 0 ,           "READ *" ,                -1 ,
X           "Read the newest item in this newsgroup",`20
X"Last"      , 0 , 'l'     , 0 ,           "READ/LAST" ,                -1 ,
X           "Read the item listed before the item being read",`20
X"Marked"      , 0 , 'm'     , 0 ,           "READ/MARKER" ,                -
V1 ,
X           "Read the next marked item",`20
X"Decrypted"      , 0 , 'd'     , 0 ,           "READ/ROT13" ,      -1 ,
X           "Use the ROT13 method to decrypt this item",`20
X"Unread"      , 0 , 'u'     , 0 ,           "UNREAD" ,                -1 ,
X           "Remove the record of having read this item"`20
X
X       `7D
X`7D,  /* * read options for level 3    */`20
X`0C
X
X
X`7B                   /* move option at level 3 MENU 14 */
X`7B 4 `7D,`7B
X"Down"      , 0 , 'd'     , 0 ,           "DOWN 18" ,                -1 ,
X           "See the next page of this item (Same as NEXT SCREEN )",`20
X"Up"      , 0 ,   'u'     , 0 ,           "UP 18" ,                -1 ,
X           "See the previous page of this item (Same as PREV SCREEN)",`20
X"Top"      , 0 , 't'     , 0 ,           "TOP" ,       -1,
X           "See the first page of this item",`20
X"Bottom"      , 0 , 'b'     , 0 ,           "BOTTOM" ,       -1,
X           "See the last page of this item"`20
X
X       `7D
X`7D,  /* move options    */`20
X`0C
X
X
X`7B                   /* conversation stream following commands 3 MENU 15 */
X`7B 3 `7D,`7B
X"Child"      , 0 , 'c'     , 0 ,           "READ/FOLLOWUP" , -1 ,
X"Follow this conversation stream forward-read any comments on the current it
Vem",`20
X"Parent"      , 0 , 'p'     , 0 ,           "READ/PARENT" , -1 ,
X"Follow this conversation stream backwards-read any items this item comments
V on",`20
X"Ancestor"      , 0 , 'a'     , 0 ,           "READ/TOPIC" ,
V                -1 ,
X"See the start of this conversation stream-the oldest parent of the current
V item"
X
X       `7D
X`7D,  /* read options for level 3    */`20
X`0C
X
X
X`7B  /* others options from level 2       MENU 16 */
X`7B 9 `7D,`7B
X"Exit"      , 0 , 'e'     , 0 ,           "EXIT" ,           -1 ,
X           "Finish using NEWS",`20
X"See"      , 0 ,  's'     , 0 ,           ""              ,  18 ,
X           "See skip filters and marks `7B`7D",
X"Clear"      , 0 , 'c'     , 0 ,           "" ,                12 ,
X           "Remove kill filters or marks `7B`7D",`20
X"eXport"      , 0 , 'x'   , 1 ,           "" ,                8 ,
X           "Print or extract the item pointed to",`20
X"Quit"      , 0 , 'q'     , 0 ,           "QUIT" ,                -1 ,
X           "Finish using NEWS and do not keep a record of items read",`20
X"sKip"      , 0 , 'k'     , 1 ,           "" ,                10 ,
X           "Skip over some items `7B`7D",`20
X"Noscreen"      , 0 , 'n'     , 0 ,           "NOSCREEN" ,        -1 ,
X           "Switch to scrolling screen mode; use SCREEN to return to current
V mode",
X"enRolment"     , 0  ,'r'     , 2 ,           ""        , 4 ,
X           "Register or deregister from this newsgroup `7B`7D",
X"sHell"         , 0  , 'h'    , 1 ,           ""        , 17   ,
X           "Temporarly return to $ prompt or edit a file `7B`7D"
X       `7D
X`7D,  /** others options from level 3     */`20
X
X`0C
X
X
X`7B  /* shell options  MENU 17 */
X`7B 2 `7D,`7B
X"Edit"      , 0 , 'e'     , 0 ,           "EDIT" ,                -1 ,
X           "Use the editor to create a file",`20
X"spaWn"      , 0 , 'w'     , 3 ,           "SPAWN" ,              -1 ,
X           "*Temporarly return to the $ prompt; enter LOGOUT to return to NE
VWS",`20
X       `7D
X`7D,  /* shell options     */`20
X
X`0C
X
X
X`7B  /* see options  MENU 18 */
X`7B 2 `7D,`7B
X"Filters"    , 0  ,'f'     , 0 ,            "SHOW KILL"   ,     -1 ,
X           "See any kill filters",
X"Marks"      , 0  ,'m'     , 0 ,            "SHOW MARK"   ,      -1 ,
X           "See any marks" ,
X       `7D
X`7D,  /* see    */`20
X
X`7D /* menus information */;
X`0C
X
X
X/***************************************************************************
V*
X *
X * Module - menu
X *
X */
X#define menu_wrap  /* this make menus wrap from one end to the other */
X/*#define menu_nowrap*/ /* this means the menu will not wrap */
X
X/* NOTE: you must define EITHER menu_wrap OR menu_nowrap - but NOT both */
X`20
X`0C
X
X
X/*
X *  get_menu_input
X *
X *  Runs the menu system until either a command or "escape_option" can be
X *  returned.   `20
X */
Xget_menu_input()
X
X`7B
Xint menu_to_run = -1;     /* index number of menu being run */
Xint option_selected = -1; /* option the user selected */
X
Xif (!(smg_active)) `7B  /* menus can not be run from noscreen mode */
X  printf("Menus do not work in NOSCREEN mode.  To use menus return to SCREEN
V mode\n" );
X  printf("by entering the command \"SCREEN\"\n");
X  return( menu_escape_pressed );
X  `7D;
Xif (!auto_restart) `7B
X  smg$erase_line( &my_pb , c$rfi(1), c$rfi(1) );  /* clear where menu will g
Vo */
X  smg$erase_line( &my_pb , c$rfi(2), c$rfi(1) );
X  smg$paste_virtual_display( &my_pb , &pid , c$rfi(devrow-1) , c$rfi(1) );
X  `7D;
X
Xif ( auto_restart ) menu_to_run = saved_menu;
X                                                /* put menu display on scree
Vn*/
Xelse if ( news_context == 1 ) menu_to_run = 0;       /* get number of initia
Vl menu*/
Xelse if ( news_context == 2 ) menu_to_run = 1;       /* to run */
Xelse if ( news_context == 3 ) menu_to_run = 2;
X
Xfor (;;)  `7B /* run menus until either a command or abort selected */
X  option_selected = run_menu( &menu`5B menu_to_run `5D ); /* run current men
Vu */
X  if ( option_selected == escape_option ) `7B           /* check for abort *
V/
X    smg$unpaste_virtual_display( &my_pb , &pid );
X    smg$erase_line( &trailer_vd , c$rfi(1), c$rfi(5) );
X    return( menu_escape_pressed );
X    `7D;
X  if ( option_selected == level_3_up ) `7B
X    smg$erase_line( &trailer_vd , c$rfi(1), c$rfi(5) );
X    auto_restart = 1;
X    saved_menu = menu_to_run;
X    return( "up 1\0" );
X    `7D;
X  if ( option_selected == level_3_page_up ) `7B
X    smg$erase_line( &trailer_vd , c$rfi(1), c$rfi(5) );
X    auto_restart = 1;
X    saved_menu = menu_to_run;
X    return( "up 18\0" );
X    `7D;
X  if ( option_selected == level_3_page_down ) `7B
X    smg$erase_line( &trailer_vd , c$rfi(1), c$rfi(5) );
X    auto_restart = 1;
X    saved_menu = menu_to_run;
X    return( "down 18\0" );
X    `7D;
X  if ( option_selected == level_3_down ) `7B
X    smg$erase_line( &trailer_vd , c$rfi(1), c$rfi(5) );
X    auto_restart = 1;
X    saved_menu = menu_to_run;
X    return( "down 1\0" );
X    `7D;
X  if ( menu`5Bmenu_to_run`5D.option`5B option_selected `5D.next_menu == -1 )
V `7B
X        smg$unpaste_virtual_display( &my_pb , &pid ); /* no more menus to ..
V*/
X        clear_err_line();                             /* run
V                */
X        return(menu`5Bmenu_to_run`5D.option`5B option_selected `5D.resultant
V_command );
X   `7D;
X  menu_to_run = menu`5Bmenu_to_run`5D.option`5B option_selected `5D.next_men
Vu;
X                                         /* get the index of the next menu *
V/
X `7D; /* for */
X smg$set_cursor_abs( &trailer_vd , c$rfi(1) , c$rfi(1) );
X smg$erase_line( &trailer_vd , c$rfi(1), c$rfi(5) );
X`7D;
X`0C
X
X
X/*
X *  run_menu
X *
X *  Runs one menu.  Terminates when an option is selected or abort key press
Ved.
X *  Returns either number of option selected, or a special terminator such a
Vs
X *  user abort or up, down, page up, page down (for level three).
X *
X */
X
Xrun_menu ( to_be_drawn )
XA_MENU *to_be_drawn;
X
X `7B
Xint col_count = 1;        /* keeps track of how far out when drawing up menu
V */
Xint option_count;         /* used to check quick keys of all options */
Xunsigned terminator = 0;  /* user's key press */
Xint levels_down = 0;      /* keeps track of SMG$ batching level */
Xint bolded,  reversed , normaled; /* attributes of screen characters */
Xint current_option = 0;   /* option that reverse bar is on */
X
Xbolded = SMG$M_BOLD;
Xreversed = SMG$M_REVERSE;
Xnormaled = 0;
X
Xif ( !auto_restart ) `7B     /* if menu is not already on screen draw it */
X  smg$erase_line( &my_pb , c$rfi(1), c$rfi(1) ); /* clear space for menu */
X  smg$erase_line( &my_pb , c$rfi(2), c$rfi(1) );
X `20
X  for ( option_count =  0 ; option_count < to_be_drawn->number_of_options ;
V option_count++
X) `7B
X       smg$put_chars(  &my_pb  , c$dsc(to_be_drawn->option`5B option_count`5
VD.text_of_option),
Xc$rfi(1),c$rfi(col_count) );
X    to_be_drawn->option`5B option_count`5D.start_possition = col_count;
X       SMG$CHANGE_RENDITION(  &my_pb  ,  c$rfi(1)  , c$rfi( col_count+to_be_
Vdrawn->option`5B
Xoption_count`5D.quick_key_possition ) , c$rfi(1),c$rfi(1), &bolded );
X    col_count += ( strlen(to_be_drawn->option`5B option_count`5D.text_of_opt
Vion) + 1);
X    `7D;    /* draw up menu */
X  `7D
Xelse `7B  /* if menu already on screen then restart from same option */
X  current_option = saved_option;
X  auto_restart = 0;
X  `7D;
Xif (!( smg$end_pasteboard_update( &pid ) == SMG$_BATWASOFF ) )`7B`20
X  ++levels_down;
X  while(  smg$end_pasteboard_update( &pid )== SMG$_BATSTIPRO ) levels_down++
V;
X  `7D; /* take off batching but remember level */
X
X                   `20
Xfor (;;) `7B   /* main loop in running a menu */
X  if (!( ( terminator == KEY_DOWN_ARROW ) `7C`7C   /* check if assistance te
Vxt */
X         ( terminator == KEY_UP_ARROW   ) `7C`7C   /* updating.  It does NOT
V   */
X         ( terminator == KEY_PAGE_DOWN )  `7C`7C   /* user as move pointer.
V    */
X         (terminator == KEY_PAGE_UP ) ) ) `7B
X     smg$erase_line( &my_pb , c$rfi(2) , c$rfi(1) );
X     smg$put_chars( &my_pb , c$dsc(to_be_drawn->option`5B current_option `5D
V.assistance_text),
Xc$rfi(2),
X     c$rfi(1) ); `20
X     `7D;
X /* `7B char temp`5B255`5D;
X  *sprintf( temp , "%u  ",terminator );
X  * smg$put_chars( &my_pb ,`20
X  * c$dsc( temp ), c$rfi(2),
X  *   c$rfi(1) );   `20
X  * `7D;
X  */
X  SMG$CHANGE_RENDITION( &my_pb , c$rfi(1) ,
X   c$rfi( to_be_drawn->option`5B current_option `5D.start_possition ) , c$rf
Vi(1),
X   c$rfi(strlen(to_be_drawn->option`5B current_option `5D.text_of_option)),
X   &reversed ); /* reverse video the current option */
X  SMG$READ_KEYSTROKE( &kid ,&terminator ); /* read user key press */
X  if (!(  (  terminator  ==  KEY_DOWN_ARROW  )  `7C`7C  (  terminator  ==  K
VEY_UP_ARROW ) `7C`7C (
Xterminator == KEY_PAGE_DOWN )
X       `7C`7C (terminator == KEY_PAGE_UP ) ) ) `7B /* remove reverse bar fro
Vm old */
X    SMG$CHANGE_RENDITION( &my_pb , c$rfi(1) ,/* option */
X     c$rfi( to_be_drawn->option`5B current_option `5D.start_possition ) , c$
Vrfi(1),
X     c$rfi(strlen(to_be_drawn->option`5B current_option `5D.text_of_option))
V,
X     &normaled );
X   SMG$CHANGE_RENDITION( &my_pb , c$rfi(1) ,`20
X    c$rfi(to_be_drawn->option`5B current_option `5D.start_possition +
X    to_be_drawn->option`5B current_option `5D.quick_key_possition ) ,
X    c$rfi(1),c$rfi(1), &bolded ); /* re-bold quick key */
X   `7D;
X`20
X  for ( option_count = 0 ; /* check menu option's quick key to see if one ha
Vs*/
+-+-+-+-+-+-+-+-  END  OF PART 2 +-+-+-+-+-+-+-+-
