home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
beehive
/
utilitys
/
xwp11src.arc
/
XWPHELP.C
< prev
next >
Wrap
Text File
|
1990-07-21
|
3KB
|
151 lines
/* XWPHELP.C
**
** HELP facility for Executive Workplace
*/
#include "a:stdio.h"
#include "b:oxege.h"
char GLprname[12], *GLprinter, FLprstat;
int GLprnums;
extern char FLerror;
#define HLINE 5
#define HCOL 26
signon( timeout )
int timeout;
{
int count;
count = 0;
savewindow( HLINE, HCOL, HLINE+10, HCOL+29, 0, 0 );
outline( HLINE, HCOL, HLINE+10, HCOL+29,
OUTBLK | ATTINV, ATTDIM | ATTALT );
fill( HLINE+1, HCOL+1, HLINE+9, HCOL+28, ' ', ATTBRT );
logo( HLINE+2, HCOL+13 );
spoke( HLINE+5, HCOL+2, " THE EXECUTIVE WORKPLACE ", ATTBRT | INVATT);
spoke( HLINE+6, HCOL+2, " Version 1.1 ", ATTBRT | INVATT);
spoke( HLINE+7, HCOL+2, " Copyright (c) 1987 ", ATTBRT | INVATT);
spoke( HLINE+8, HCOL+2, " by Ted A. Campbell ", ATTBRT | INVATT);
if ( timeout )
{
while ( count < 30000 )
{
count++;
}
}
else
{
wait( 1 );
}
savewindow( HLINE, HCOL, HLINE+10, HCOL+29, 1, 0 );
}
los( string )
char string[];
{
char *pointer;
pointer = string;
while( *pointer != NULL )
{
lo( *pointer );
++pointer;
}
}
/* PRINTER - Printer Setup Routine
**
** FLprstat = status of printer initialization:
** 0 = not initialized
** 1 = initialized and ok
** 127 = attempt to initialize failed
**
** GLprinter data structure:
** 10 possible fields of:
** 10 bytes identifier string
** 15 bytes string to send to printer
**
** GLprnums = number of strings found by dailinit()
*/
printer()
{
int counter, choice, draw;
char *pointer;
/* First check FLprstat status and initialize if necessary */
if( FLprstat == NULL )
{
prntinit();
}
if( FLprstat == 127 )
{
error( "XWP.PRN NOT FOUND" );
FLerror = 0;
return;
}
/* Now set up menu areas */
pointer = GLprinter;
counter = 0;
while( counter < GLprnums )
{
strcpy( scratch, " " );
strcat( scratch, pointer );
setmenu( counter+1, 14, scratch );
pointer += 25;
++counter;
}
setmenu( counter+1, 14, " RETURN " );
/* Save the environment */
savewindow( 2, 1, 6+GLprnums, 16, 0, 1 );
/* Draw menu area */
outline( 2, 1, 6+GLprnums, 16, OUTBLK, ATTDIM | ATTALT );
fill( 3, 2, 3, 15, ' ' | ATTINV, ATTDIM | ATTUND );
spoke( 3, 2, " PRINTER: ", ATTDIM | ATTUND );
fill( 4, 2, 4, 15, ' ' | ATTINV, ATTDIM | ATTUND );
spoke( 4, 3, GLprname, ATTDIM | ATTUND );
draw = 1;
while( 1 )
{
choice = menu( 5, 2, 1, GLprnums+1, 14, draw );
draw = 0;
if( choice > GLprnums )
{
savewindow( 2, 1, 6+GLprnums, 16, 1, 1 );
return;
}
if( choice <= GLprnums )
{
cpoke( 4+choice, 15, '*' | ATTINV, ATTDIM | ATTUND );
pointer = GLprinter-15+( choice*25);
los( pointer );
}
}
}
prntinit()
{
int pdatfile, counter;
char *pointer;
if( ( pdatfile = fopen( "XWP.PRN", "r" ) ) == NULL )
{
FLprstat = 127;
return;
}
FLprstat = 1;
pointer = GLprinter = malloc( 500 );
counter = 0;
/* Get printer name */
fscanf( pdatfile, "%s", GLprname );
while( !feof( pdatfile ) )
{
fscanf( pdatfile, "%s %s", pointer, pointer+10 );
pointer += 25;
++counter;
}
GLprnums = counter-1; /* subtract the last (null) line */
}
pointer, pointer+10 );
pointer += 25;
++counter;
}
GLprnums =