/*===========================================================================*\
| PULLWORK.C - Work Window functions for main work area ver 2.0, 04-15-89 |
| for PULLSHEL.C |
| This file contains all the procedures executed for the Work Window. These |
| are the main steps of your program. With this, you can create a sophisti- |
| cated multi-level window environment. |
| Copyright (c) 1989 James H. LeMay, All rights reserved. |
| Conversion to Turbo C by Jordan Gallagher / Wisdom Research |
\*===========================================================================*/
#include "pullc20.h"
#include "pullshel.h"
/*========================= Work Window Steps ===============================*\
| This module will have all the functions for the work window(s). |
| Each step assumes that some keystroke has been pressed and returns a value |
| for key and extkey and any necessary change to workwndwstep. |
\*---------------------------------------------------------------------------*/
int start1=AINT_DE;
#ifdef MULTIWORKWNDWS
extern int topworkwndwname = WINDOW1;
/*=========================| resetworkwndwstep |============================*\
\*==========================================================================*/
void resetworkwndwstep(void)
{
switch(tws.wsname) {
WINDOW1: workwndwstep = 1; break;
WINDOW2: workwndwstep = 3; break;
}
}
/*============================| hideworkwndw |==============================*\
\*==========================================================================*/
void hideworkwndw(void)
{
hidewindow();
topworkwndwname = tws.wsname;
resetworkwndwstep();
}
/*===========================| accessworkwndw |=============================*\
\*==========================================================================*/
void accessworkwndw( int wn )
{
if(wn != tws.wsname) {
/* -- if accessing a PERMMODE window, hide all upper windows. -- */
if(getlevelindex(wn) <= pli)
while(li>pli)
hidewindow(); /* Use removewindow for serial access */
accesswindow(wn);
resetworkwndwstep();
}
}
#endif
/*==============================| kbdidle |=================================*\
\*==========================================================================*/
void kbdidle(void)
{
/* Nothing to include this time, but fill in what you want to do while */
/* the keyboard is idle. */
}
/*=============================| showfields |===============================*\
\*==========================================================================*/
void showfields(void)
{
wwrite( 2, 3, "Int:" );
displayfields( AINT_DE, AINT_DE );
}
#if 0
/*===========================| makeworkwndw2 |==============================*\
\*==========================================================================*/
void makeworkwndw2(void)
{
setwindowmodes( HIDDENMODE );
makewindow( 8, 21, 10, 40, LIGHTBLUE+LIGHTGRAY_BG, LIGHTBLUE+LIGHTGRAY_BG,
DOUBLE_BORDER, WINDOW2 );
setwindowmodes(0);
writetohidden( WINDOW2 );
titlewindow( TOP, LEFT ,SAMEATTR, "2" );
titlewindow( TOP, CENTER,SAMEATTR, " Work Window 2 " );
titlewindow( BOTTOM,CENTER,SAMEATTR, " Press ESC to Hide " );
wwritec( 1, "Type in any input" );
wgotorc( 2, 1 );
writetocrt();
}
#endif
void editfields(void)
{
enterseq( AINT_DE, AINT_DE, &start1 );
}
void initworkwndws(void)
{
showfields();
workwndwstep = 1;
key = NULLKEY; /* 0x00 */
}
void workwndw(void)
{
#ifdef MULTIWORKWNDWS
accessworkwndw( topworkwndwname );
#endif
switch(workwndwstep) {
case 0: initworkwndws(); break;
case 1: editfields(); break;
}
}