home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1997 April (Special)
/
Chip-Special_1997-04_cd.bin
/
canon
/
bj364
/
bj364d1.exe
/
BJL.BIN
/
SOURCE.ZIP
/
HOT_KEY.C
< prev
next >
Wrap
C/C++ Source or Header
|
1996-04-16
|
24KB
|
638 lines
// ========================================================================================
// BJ Printer Setup Utility Program
// DOS Base
// BJ Printer (such as the A250 and A240)
//
// 1. Version 1.00 [August 18, '95] : Tsukasa Jackie AIBA : Created new
// 2. Version 1.01 [September 21, '95] : Tsukasa Jackie AIBA : Added A240
// 3. Version 1.02 [September 26, '95] : Tsukasa Jackie AIBA : Added mono display
// 4. Version 1.03 [March 12, '96] : Tsukasa Jackie AIBA : Added MultiPASS C2500
// 5. Version 1.10 [April 30, '96] : Tsukasa Jackie AIBA : Added BJC-80/240/4200/4550
//
// Copyright Canon Information Systems, Inc. 1995, 1996
// ========================================================================================
/*
HOT_KEY.c
C-scape for DOS version 4.0.1. Software
Copyright (c) 1992 by Liant Software Corporation.
ALL RIGHTS RESERVED.
This program is A250 setup utility how to use a mouse with C-scape for DOS version 4.0.1.
You can select windows by moving the mouse over the desired window.
When you are finished you can quit by pressing ESC or by
clicking the mouse on the field that says "exit".
*/
// ***********************************************************************
// include standard headers
// ***********************************************************************
#include <stdio.h>
#include <string.h>
#include <time.h> // for popdecl.h
// ***********************************************************************
// include original headers
// ***********************************************************************
#include "..\h\cscape.h"
#include "..\h\ostdlib.h" // for exit(), otolower()
#include "..\h\popdecl.h" // for popups
#include "..\h\scancode.h" // for event codes
#include "..\h\useful.h" // for STATE_2NAMES
#include "..\h\cmwinobj.h" // for bcwin_Class
#include "..\h\dpref.h"
#include "..\h\ogldecl.h"
#include "..\h\slug.h"
#include "..\h\pmwinobj.h" // for pmwin stuff
#include "..\h\disppvs.h" // for PCCOLS, disp_GetPixval, disp_FreePixval
#include "..\h\framer.h"
#include "..\h\oakalloc.h" // for omalloc of icon title string
#include "..\h\oaktag.h" // tags for omalloc
#include "..\h\helpdecl.h" // for the help system
#include "bjsetup.h"
// ***********************************************************************
// function name : boolean spc_Jump(sed_type sed, int scancode)
// function : Tab key's jump next window
// input : sed_type sed
// : int scancode
// output : TRUE
// : FALSE
// ***********************************************************************
boolean spc_Jump(sed_type sed, int scancode)
{
mev_struct mev;
int a240_order, autoPowerOn;
if(printerID >= 4)
autoPowerOn = 1;
else
autoPowerOn = 0;
if((printerID >= 2) && (printerID <= 4))
a240_order = 1;
else
{
if(printerID >= MPC2500)
a240_order = -1;
else
a240_order = 0;
}
//// Help 2
if((sed_GetLabel(sed) == 1) & (sed_GetFieldNo(sed_GetWin(sedlist[3])) == 5))
{
if(scancode == FN1)
{
kb_Stuff(ENTER);
return(TRUE);
}
}
switch(scancode)
{
case TAB:
switch(sed_GetLabel(sed)) // Go next window
{
case 2: // File : sedlist[0]
sed_ToggleExit(sed); // Quit this window
sed_SetNextWin(sed, sed_GetWin(sedlist[1]));
break;
case 3: // Action : sedlist[1]
sed_ToggleExit(sed); // Quit this window
sed_SetNextWin(sed, sed_GetWin(sedlist[2]));
break;
case 4: // Param : sedlist[2]
sed_ToggleExit(sed); // Quit this window
sed_SetNextWin(sed, sed_GetWin(sedlist[3]));
break;
case 1: // Menu : sedlist[3]
switch(sed_GetFieldNo(sed_GetWin(sedlist[3])))
{
case 0:
sed_GotoField(sed_GetWin(sedlist[3]), 1);
break;
case 1:
sed_GotoField(sed_GetWin(sedlist[3]), 2);
break;
case 2:
sed_GotoField(sed_GetWin(sedlist[3]), 3);
break;
case 3:
sed_GotoField(sed_GetWin(sedlist[3]), 4);
break;
case 4:
sed_GotoLastField(sed_GetWin(sedlist[3]));
break;
case 5:
sed_ToggleExit(sed); // Quit this window
sed_SetNextWin(sed, sed_GetWin(sedlist[0]));
break;
}
default:
break;
}
return(TRUE);
case SHFT_TAB:
switch(sed_GetLabel(sed)) // Go next window
{
case 2:
sed_ToggleExit(sed); // Quit this window
sed_SetNextWin(sed, sed_GetWin(sedlist[3]));
sed_GotoLastField(sed_GetWin(sedlist[3]));
break;
case 3:
sed_ToggleExit(sed); // Quit this window
sed_SetNextWin(sed, sed_GetWin(sedlist[0]));
break;
case 4:
sed_ToggleExit(sed); // Quit this window
sed_SetNextWin(sed, sed_GetWin(sedlist[1]));
break;
case 1:
switch(sed_GetFieldNo(sed_GetWin(sedlist[3])))
{
case 5:
sed_GotoField(sed_GetWin(sedlist[3]), 4);
break;
case 4:
sed_GotoField(sed_GetWin(sedlist[3]), 3);
break;
case 3:
sed_GotoField(sed_GetWin(sedlist[3]), 2);
break;
case 2:
sed_GotoField(sed_GetWin(sedlist[3]), 1);
break;
case 1:
sed_GotoFirstField(sed_GetWin(sedlist[3]));
break;
case 0:
sed_ToggleExit(sed); // Quit this window
sed_SetNextWin(sed, sed_GetWin(sedlist[2]));
break;
}
default:
break;
}
return(TRUE);
case DOWN: // for wrap around scrolling
switch(sed_GetLabel(sed))
{
case 2: case 3: case 4:
if (sed_IncField(sed) == SED_STUCK)
sed_GotoFirstField(sed);
break;
default:
break;
}
return(TRUE);
case UP: // for wrap around scrolling
switch(sed_GetLabel(sed))
{
case 2: case 3: case 4:
if (sed_DecField(sed) == SED_STUCK)
sed_GotoLastField(sed);
break;
default:
break;
}
return(TRUE);
//// Exit
case FN10:
sed_ToggleExit(sed); // Quit this window
sed_SetNextWin(sed, sed_GetWin(sedlist[3]));
return(TRUE);
//// Status
case FN5:
if(sed != sed_GetWin(sedlist[3]))
{
sed_ToggleExit(sed); // Quit this window
sed_SetNextWin(sed, sed_GetWin(sedlist[3]));
}
sed_GotoField(sed_GetWin(sedlist[3]), 1);
return(TRUE);
//// Send
case FN6:
if(sed != sed_GetWin(sedlist[3]))
{
sed_ToggleExit(sed); // Quit this window
sed_SetNextWin(sed, sed_GetWin(sedlist[3]));
}
sed_GotoField(sed_GetWin(sedlist[3]), 2);
return(TRUE);
//// Default
case FN7:
if(sed != sed_GetWin(sedlist[3]))
{
sed_ToggleExit(sed); // Quit this window
sed_SetNextWin(sed, sed_GetWin(sedlist[3]));
}
sed_GotoField(sed_GetWin(sedlist[3]), 3);
return(TRUE);
//// About
case FN8:
if(sed != sed_GetWin(sedlist[3]))
{
sed_ToggleExit(sed); // Quit this window
sed_SetNextWin(sed, sed_GetWin(sedlist[3]));
}
sed_GotoField(sed_GetWin(sedlist[3]), 4);
return(TRUE);
//// Help 1
case FN9:
if(sed != sed_GetWin(sedlist[3]))
{
sed_ToggleExit(sed); // Quit this window
sed_SetNextWin(sed, sed_GetWin(sedlist[3]));
}
sed_GotoLastField(sed_GetWin(sedlist[3]));
return(TRUE);
// ------------------------------------------------------------------------------------
//// Printer
case CTRL_P:
if(sed != sed_GetWin(sedlist[0]))
{
sed_ToggleExit(sed); // Quit this window
sed_SetNextWin(sed, sed_GetWin(sedlist[0]));
}
sed_GotoFirstField(sed_GetWin(sedlist[0]));
return(TRUE);
//// Setting Mode
case CTRL_M:
if(sed != sed_GetWin(sedlist[0]))
{
sed_ToggleExit(sed); // Quit this window
sed_SetNextWin(sed, sed_GetWin(sedlist[0]));
}
sed_GotoField(sed_GetWin(sedlist[0]), 1);
return(TRUE);
//// Open File...
case CTRL_O:
if(sed != sed_GetWin(sedlist[0]))
{
sed_ToggleExit(sed); // Quit this window
sed_SetNextWin(sed, sed_GetWin(sedlist[0]));
}
sed_GotoField(sed_GetWin(sedlist[0]), 2);
return(TRUE);
//// Save File...
case CTRL_S:
if(sed != sed_GetWin(sedlist[0]))
{
sed_ToggleExit(sed); // Quit this window
sed_SetNextWin(sed, sed_GetWin(sedlist[0]));
}
sed_GotoField(sed_GetWin(sedlist[0]), 3);
return(TRUE);
//// Delete File...
case CTRL_D:
if(sed != sed_GetWin(sedlist[0]))
{
sed_ToggleExit(sed); // Quit this window
sed_SetNextWin(sed, sed_GetWin(sedlist[0]));
}
sed_GotoLastField(sed_GetWin(sedlist[0]));
return(TRUE);
// --------------------------------------------------------------------------------
//// Power Off
case ALT_1:
if(sed != sed_GetWin(sedlist[1]))
{
sed_ToggleExit(sed); // Quit this window
sed_SetNextWin(sed, sed_GetWin(sedlist[1]));
}
sed_GotoFirstField(sed_GetWin(sedlist[1]));
return(TRUE);
//// Reset Printer
case ALT_2:
if(sed != sed_GetWin(sedlist[1]))
{
sed_ToggleExit(sed); // Quit this window
sed_SetNextWin(sed, sed_GetWin(sedlist[1]));
}
sed_GotoField(sed_GetWin(sedlist[1]), 1);
return(TRUE);
//// Eject Page
case ALT_3:
if(sed != sed_GetWin(sedlist[1]))
{
sed_ToggleExit(sed); // Quit this window
sed_SetNextWin(sed, sed_GetWin(sedlist[1]));
}
sed_GotoField(sed_GetWin(sedlist[1]), 2);
return(TRUE);
//// Set Control Mode
case ALT_4:
if(sed != sed_GetWin(sedlist[1]))
{
sed_ToggleExit(sed); // Quit this window
sed_SetNextWin(sed, sed_GetWin(sedlist[1]));
}
sed_GotoField(sed_GetWin(sedlist[1]), 3);
return(TRUE);
//// Print Test Pattern
case ALT_5:
if(sed != sed_GetWin(sedlist[1]))
{
sed_ToggleExit(sed); // Quit this window
sed_SetNextWin(sed, sed_GetWin(sedlist[1]));
}
sed_GotoField(sed_GetWin(sedlist[1]), 4);
return(TRUE);
//// Print Settings
case ALT_6:
if(sed != sed_GetWin(sedlist[1]))
{
sed_ToggleExit(sed); // Quit this window
sed_SetNextWin(sed, sed_GetWin(sedlist[1]));
}
sed_GotoField(sed_GetWin(sedlist[1]), 5);
return(TRUE);
//// Change Ink Cartridge
case ALT_7:
if(sed != sed_GetWin(sedlist[1]))
{
sed_ToggleExit(sed); // Quit this window
sed_SetNextWin(sed, sed_GetWin(sedlist[1]));
}
sed_GotoField(sed_GetWin(sedlist[1]), 6);
return(TRUE);
//// Clean Ink Head
case ALT_8:
if(sed != sed_GetWin(sedlist[1]))
{
sed_ToggleExit(sed); // Quit this window
sed_SetNextWin(sed, sed_GetWin(sedlist[1]));
}
sed_GotoField(sed_GetWin(sedlist[1]), 7);
return(TRUE);
//// Printer Preset Status
case ALT_9:
if(sed != sed_GetWin(sedlist[1]))
{
sed_ToggleExit(sed); // Quit this window
sed_SetNextWin(sed, sed_GetWin(sedlist[1]));
}
sed_GotoField(sed_GetWin(sedlist[1]), 8);
return(TRUE);
//// Dump Mode
case ALT_0:
if(sed != sed_GetWin(sedlist[1]))
{
sed_ToggleExit(sed); // Quit this window
sed_SetNextWin(sed, sed_GetWin(sedlist[1]));
}
sed_GotoLastField(sed_GetWin(sedlist[1]));
return(TRUE);
// --------------------------------------------------------------------------------
//// Paper Selection
case ALT_P:
if(sed != sed_GetWin(sedlist[2]))
{
sed_ToggleExit(sed); // Quit this window
sed_SetNextWin(sed, sed_GetWin(sedlist[2]));
}
sed_GotoFirstField(sed_GetWin(sedlist[2]));
return(TRUE);
//// Print Mode
case ALT_M:
if(sed != sed_GetWin(sedlist[2]))
{
sed_ToggleExit(sed); // Quit this window
sed_SetNextWin(sed, sed_GetWin(sedlist[2]));
}
sed_GotoField(sed_GetWin(sedlist[2]), 1);
return(TRUE);
//// Smoothing
case ALT_S:
if(sed != sed_GetWin(sedlist[2]))
{
sed_ToggleExit(sed); // Quit this window
sed_SetNextWin(sed, sed_GetWin(sedlist[2]));
}
sed_GotoField(sed_GetWin(sedlist[2]), 2);
return(TRUE);
//// Reduction
case ALT_U:
if(sed != sed_GetWin(sedlist[2]))
{
sed_ToggleExit(sed); // Quit this window
sed_SetNextWin(sed, sed_GetWin(sedlist[2]));
}
sed_GotoField(sed_GetWin(sedlist[2]), 3);
return(TRUE);
//// Auto Power On
case ALT_E:
if(sed != sed_GetWin(sedlist[2]))
{
sed_ToggleExit(sed); // Quit this window
sed_SetNextWin(sed, sed_GetWin(sedlist[2]));
}
sed_GotoField(sed_GetWin(sedlist[2]), a240_order+3);
return(TRUE);
//// Auto Power Off
case ALT_W:
if(sed != sed_GetWin(sedlist[2]))
{
sed_ToggleExit(sed); // Quit this window
sed_SetNextWin(sed, sed_GetWin(sedlist[2]));
}
sed_GotoField(sed_GetWin(sedlist[2]), autoPowerOn+a240_order+3);
return(TRUE);
//// Font
case ALT_F:
if(sed != sed_GetWin(sedlist[2]))
{
sed_ToggleExit(sed); // Quit this window
sed_SetNextWin(sed, sed_GetWin(sedlist[2]));
}
sed_GotoField(sed_GetWin(sedlist[2]), autoPowerOn+a240_order+4);
return(TRUE);
//// Code Page
case ALT_D:
if(sed != sed_GetWin(sedlist[2]))
{
sed_ToggleExit(sed); // Quit this window
sed_SetNextWin(sed, sed_GetWin(sedlist[2]));
}
sed_GotoField(sed_GetWin(sedlist[2]), autoPowerOn+a240_order+5);
return(TRUE);
//// Page Length
case ALT_L:
if(sed != sed_GetWin(sedlist[2]))
{
sed_ToggleExit(sed); // Quit this window
sed_SetNextWin(sed, sed_GetWin(sedlist[2]));
}
sed_GotoField(sed_GetWin(sedlist[2]), autoPowerOn+a240_order+6);
return(TRUE);
//// Character Set
case ALT_H:
if(sed != sed_GetWin(sedlist[2]))
{
sed_ToggleExit(sed); // Quit this window
sed_SetNextWin(sed, sed_GetWin(sedlist[2]));
}
sed_GotoField(sed_GetWin(sedlist[2]), autoPowerOn+a240_order+7);
return(TRUE);
//// Text Scale
case ALT_T:
if(sed != sed_GetWin(sedlist[2]))
{
sed_ToggleExit(sed); // Quit this window
sed_SetNextWin(sed, sed_GetWin(sedlist[2]));
}
sed_GotoField(sed_GetWin(sedlist[2]), autoPowerOn+a240_order+8);
return(TRUE);
//// Download Buffer
case ALT_B:
if(sed != sed_GetWin(sedlist[2]))
{
sed_ToggleExit(sed); // Quit this window
sed_SetNextWin(sed, sed_GetWin(sedlist[2]));
}
sed_GotoField(sed_GetWin(sedlist[2]), autoPowerOn+a240_order+9);
return(TRUE);
//// Auto LF
case ALT_A:
if(sed != sed_GetWin(sedlist[2]))
{
sed_ToggleExit(sed); // Quit this window
sed_SetNextWin(sed, sed_GetWin(sedlist[2]));
}
sed_GotoField(sed_GetWin(sedlist[2]), autoPowerOn+a240_order+10);
return(TRUE);
//// Auto CR
case ALT_R:
if(sed != sed_GetWin(sedlist[2]))
{
sed_ToggleExit(sed); // Quit this window
sed_SetNextWin(sed, sed_GetWin(sedlist[2]));
}
sed_GotoField(sed_GetWin(sedlist[2]), autoPowerOn+a240_order+11);
return(TRUE);
//// Auto AGM
case ALT_G:
if(sed != sed_GetWin(sedlist[2]))
{
sed_ToggleExit(sed); // Quit this window
sed_SetNextWin(sed, sed_GetWin(sedlist[2]));
}
sed_GotoField(sed_GetWin(sedlist[2]), autoPowerOn+a240_order+12);
return(TRUE);
//// International
case ALT_I:
if(sed != sed_GetWin(sedlist[2]))
{
sed_ToggleExit(sed); // Quit this window
sed_SetNextWin(sed, sed_GetWin(sedlist[2]));
}
sed_GotoField(sed_GetWin(sedlist[2]), autoPowerOn+a240_order+13);
return(TRUE);
//// Top Margin
case ALT_O:
if(sed != sed_GetWin(sedlist[2]))
{
sed_ToggleExit(sed); // Quit this window
sed_SetNextWin(sed, sed_GetWin(sedlist[2]));
}
sed_GotoField(sed_GetWin(sedlist[2]), autoPowerOn+a240_order+14);
return(TRUE);
//// Font Lock
case ALT_C:
if(sed != sed_GetWin(sedlist[2]))
{
sed_ToggleExit(sed); // Quit this window
sed_SetNextWin(sed, sed_GetWin(sedlist[2]));
}
sed_GotoField(sed_GetWin(sedlist[2]), autoPowerOn+a240_order+15);
return(TRUE);
//// Port
case ALT_N:
if(sed != sed_GetWin(sedlist[2]))
{
sed_ToggleExit(sed); // Quit this window
sed_SetNextWin(sed, sed_GetWin(sedlist[2]));
}
sed_GotoLastField(sed_GetWin(sedlist[2]));
return(TRUE);
// ---------------------------------------------------------------------------------
case MOU_CLICK:
win_MouseCurrEvent(&mev);
if((sed_GetLabel(sed) != 1) | (sed_GetFieldNo(sed_GetWin(sedlist[3])) != 5))
{
if(mev_IsButton2Down(&mev) | mev_IsButton3Down(&mev))
{
kb_Stuff(FN1);
return(TRUE);
}
}
if(sed == sed_GetWin(sedlist[3]))
kb_Stuff(ENTER);
case ENTER:
if(sed == sed_GetWin(sedlist[2]))
kb_Stuff(RIGHT);
else
return(FALSE);
case MOU_NOFIELD:
return(TRUE); // Keep mouse events from exiting program
}
return(FALSE);
}