|
|
1.1 root 1: /* this routine will take a pointer to a window and row/col
2: * coordinates and print a filename found at the coordinates
3: * in INVERSE video.
4: */
5:
6: #include <stdio.h>
7: #include <curses.h>
8: #include "contents.h"
9: #include "maillist.h"
10:
11: int lite(win1, row, col, liteflag, main_menu)
12:
13: WINDOW *win1;
14: int row, col, liteflag, main_menu;
15:
16: {
17:
18: int x,y;
19: char litestring[15];
20:
21: if(main_menu==1)
22: col = 0;
23:
24: wmove(win1, row,col);
25:
26: /* get existing filename char by char, deleting each
27: * char as it is read into a string variable.
28: */
29:
30: for(x=0; x<15; x++)
31: {
32: litestring[x] = winch(win1);
33:
34: /* if we hit a blank, stop */
35: if(litestring[x] == ' ')
36: break;
37:
38: wdelch(win1);
39: }
40:
41: litestring[x] = '\0';
42:
43: /* we need to test what Litestring is, in case we're picking
44: * up a 2 name state (ie. West Virginia). If we are, then we
45: * continue to read the rest of the state name to get the
46: * full, proper name.
47: */
48:
49: if( (strcmp(litestring,"New")==0) || (strcmp(litestring,"North")==0)|| (strcmp(litestring,"South")==0) || (strcmp(litestring,"West")==0) || (strcmp(litestring,"Rhode")==0) )
50: {
51: wdelch(win1);
52: litestring[x] = ' ';
53: for(y=x+1;y<15;y++)
54: {
55: litestring[y] = winch(win1);
56: if (litestring[y] == ' ')
57: break;
58: wdelch(win1);
59: }
60: litestring[y] = '\0';
61: x = y;
62: }
63:
64: /* repad the spaces to keep the remaning filenames
65: * on this row in their proper columns.
66: */
67:
68: /* if(main_menu != 1) */
69: for(y=0;y<x;y++)
70: winsch(win1,' ');
71:
72: if (liteflag == 1)
73: wstandout(win1);
74:
75: waddstr(win1, litestring);
76: wmove(win1, row, col);
77:
78: if (liteflag == 1)
79: wstandend(win1);
80:
81:
82: /* copy filename to a string to be displayed on stdscr.
83: * as a filename is highlited, it is also displayed on
84: * stdscr. 'selection' will be used in case the user
85: * hits return to locate the filename's entry in the
86: * Contents file.
87: */
88:
89: /* if we were called from the main menu functions, then we need to
90: * copy this to the 'workfile' string, not the selection string.
91: */
92:
93: if(main_menu==1)
94: strcpy(workfile,litestring);
95: else
96: strcpy(selection, litestring);
97:
98:
99: move (23,0);
100:
101: if(main_menu==1)
102: printw("Selected filename is: %14s", workfile);
103: else
104: printw("Selected filename is: %14s",selection);
105:
106:
107: refresh();
108: wrefresh(win1);
109:
110: return(0);
111:
112: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.