📄 eng_act.c
字号:
/*
* Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
* All rights reserved.
*
* This software is copyrighted by and is the sole property of
* VIA Networking Technologies, Inc. This software may only be used
* in accordance with the corresponding license agreement. Any unauthorized
* use, duplication, transmission, distribution, or disclosure of this
* software is expressly forbidden.
*
* This software is provided by VIA Networking Technologies, Inc. "as is"
* and any express or implied warranties, including, but not limited to, the
* implied warranties of merchantability and fitness for a particular purpose
* are disclaimed. In no event shall VIA Networking Technologies, Inc.
* be liable for any direct, indirect, incidental, special, exemplary, or
* consequential damages.
*
*
* File: eng_act.c
*
* Purpose: UI engine action bar functions
*
* Author: Jenda Jao
*
* Date: Jan 08, 2002
*
* Functions:
*
* Revision History:
*
*/
#if !defined(__KEY_H__)
#include "key.h"
#endif
#include "tty.h"
#include "allpages.h"
#include "engine.h"
#include "eng_io.h"
#include "eng_act.h"
#include "eng_move.h"
// define general action item strings
char g_strActionQuit[] = "<Quit>";
char g_strActionEdit[] = "<Edit>";
char g_strActionSave[] = "<Save>";
char g_strActionAdd[] = "<Add>";
char g_strActionDel[] = "<Delete>";
char g_strActionRefresh[] = "<Refresh>";
char g_strActionApply[] = "<Apply>";
void ENGvPrintActionItem(UINT8 byCurID, BOOL bHighlight)
{
TTY_vSetCurPos(g_aSCurActionList[byCurID].SPos.byRow, g_aSCurActionList[byCurID].SPos.byCol);
if (bHighlight) // highlight item
TTY_vRevChar();
TTY_vPutStr(g_aSCurActionList[byCurID].strLabel);
if (bHighlight) // highlight item
TTY_vRstChar();
}
// print whole action bar
void ENGvPrintActionbar(void)
{
UINT8 ui;
//// print whole bar
TTY_vPutStrOnPos(22,2,"Actions->");
for (ui=0; ui<g_pSCurPage->byActItemNum; ui++)
ENGvPrintActionItem(ui, 0);
}
void ENGvRunActionBar(void)
{
UINT8 byItemID = 0;
// To generate msg bar
ENGvClearMsgBar();
while (1) {
if (g_byCurKey)
ENGvPrintActionItem(byItemID, PRINT_ITEM_HIGHLIGHT);
g_byCurKey = TTY_cGetChar();
if (g_bSemaphoreTtyLogout) {
g_byCurPageID = PAGE_LOGIN;
g_bSemaphoreTtyLogout = FALSE;
return;
}
else if (g_byCurKey == MK_V_UP || g_byCurKey == MK_V_LEFT || g_byCurKey == MK_BACKSPACE) {
ENGvPrintActionItem(byItemID, PRINT_ITEM_NORMAL);
byItemID = (byItemID + g_pSCurPage->byActItemNum -1) % g_pSCurPage->byActItemNum;
}
else if (g_byCurKey == MK_V_DOWN || g_byCurKey == MK_V_RIGHT || g_byCurKey == MK_TAB || g_byCurKey == MK_SPACE) {
ENGvPrintActionItem(byItemID, PRINT_ITEM_NORMAL);
byItemID = (byItemID + 1) % g_pSCurPage->byActItemNum;
}
else if (g_byCurKey == MK_ENTER || g_byCurKey == '0' || g_byCurKey == MK_ESCAPE) {
ENGvPrintActionItem(byItemID, PRINT_ITEM_NORMAL);
if (g_byCurKey != MK_ENTER)
byItemID = 0;
if (g_aSCurActionList[byItemID].bActFunc())
return;
ENGvClearMsgBar(); // To clear msg bar
}
// input key not valid
else {
g_byCurKey = 0;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -