?? message.c
字號:
#include <graphics.h>
#include <bio.inc>
#include <menu.inc>
#include "feedef.h"
extern UC Cursor_on;
extern UL far *Tick_cnt_ptr;
static UC old_cursor_stat;
/* function : display message in the small status win according to mode
* calls : message_win
* called by : this is a general purposed routine
* input : mode -- information kind
* date : 1993.9.20
*/
void message(int mode)
{
UC back_in=8,echo_time=30;
if(mode != MAIN_MES)
sound_alarm();
switch(mode)
{
case MAIN_MES: /* -><- move, ENTER retify */
hz16_disp(MES_LEFT+8,MES_TOP+1, "←↓→↑ 移動 Enter 確認",0);
break;
case PASS_ERR: /* error in password input */
message_win(back_in,"輸入錯誤,請重新輸入!",echo_time);
break;
case RE_PASS: /* pleae Re-enter the password */
message_win(back_in,"請再輸入一遍新密碼!",echo_time);
break;
case RE_PASS_ERR: /* error in Re-entern the password */
message_win(back_in,"兩次輸入不同,請重來!",echo_time);
break;
case NEW_PASS_EN: /* the new password has been valid */
message_win(back_in,"新密碼已經生效!",echo_time);
break;
case TIME_OUT: /* connecting time is out */
message_win(back_in,"打印機聯機錯誤!",echo_time);
break;
case IO_ERR: /* printer I/O error */
message_win(back_in,"打印機I/O錯誤!",echo_time);
break;
case NO_PAPER: /* printer no paper */
message_win(back_in,"打印機無紙!",echo_time);
break;
case PRN_ERR: /* some error in printer */
message_win(back_in,"打印機錯誤!",echo_time);
break;
case PHO_FILE_ERR: /* input phone number first */
message_win(back_in,"請先輸入話機號!",echo_time);
break;
case SPRING_DAY: /* spring festival days must be input */
message_win(back_in,"必須輸入春節日期!",echo_time);
break;
case CONN_ERR: /* connection error in SIO communication */
message_win(back_in,"聯機錯誤!",echo_time);
break;
case REC_TIMEOUT: /* timeout in receiving records or no B8 */
message_win(back_in,"接收錯誤!",echo_time);
break;
case RATE_FILE_ERR: /* input charge rate first */
message_win(back_in,"請先輸入費率!",echo_time);
break;
case NO_NOT_EXIST: /* the phone number input does not exist */
message_win(back_in,"該電話號碼不存在!",echo_time);
break;
case CASH_FILE_ERR:
message_win(back_in,"請先進行押金設定!",echo_time);
break;
case USER_FILE_ERR:
message_win(back_in,"請先進行戶頭設定!",echo_time);
break;
case UNO_NOT_EXIST:
message_win(back_in,"該戶頭號不存在!",echo_time);
break;
}
return;
}
/* function : preserve the old message and display new message in the
* small status win. If anykey is pressed or the time is
* longer than "echo_time", the old message is poped back
* called by : message()
* input : back_in -- from what position in the status window to
* display the information
* msg -- the new information
* echo_time -- the longest displaying time
* date : 1993.9.20
*/
void message_win(UC back_in, UC *msg, UC echo_time)
{
UC old_cursor_stat;
UL start_time;
MOUSE_BAND_STRUCT mouse_band;
pop_back(D_LEFT,D_BOTTOM,MAX_X-S_XAD,MAX_Y,11);
hz16_disp(MES_LEFT+back_in,MES_TOP+1, msg,0);
old_cursor_stat = Cursor_on;
cursor_on();
get_mouse_band(&mouse_band);
clr_keybuf();
start_time = *Tick_cnt_ptr;
while (1)
{
if ( !keybuf_nul() )
{
get_key0();
break;
}
if ( left_pressed() )
break;
if (echo_time)
{
if (*Tick_cnt_ptr-start_time>echo_time)
break;
}
}
cursor_off();
rid_pop();
set_mouse_band(&mouse_band);
if (old_cursor_stat==TRUE)
cursor_on();
return;
}
/* function : display "msg" in the status window. The only method to
* retrieve the old message is to call "message_end", that
* is displaying time of "msg" is not limited by echo_time
* called by : set_record_add() (set_add.c)
* input : back_in, msg -- the same as those in "message_win()"
* date : 1993.9.22.
*/
void message_disp(UC back_in, UC *msg)
{
pop_back(D_LEFT,D_BOTTOM,MAX_X-S_XAD,MAX_Y,11);
hz16_disp(MES_LEFT+back_in,MES_TOP+1, msg,0);
old_cursor_stat = Cursor_on;
cursor_on();
return;
}
/* function : to retrieve the old message preserved by "message_disp()"
* called by : message_disp()
* date : 1993.9.22
*/
void message_end(void)
{
cursor_off();
rid_pop();
if (old_cursor_stat==TRUE)
cursor_on();
return;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -