📄 adconst.c
字号:
/****************************************************************
** *
** FILE : ADConst.C *
** COPYRIGHT : (c) 2001 .Xiamen Yaxon NetWork CO.LTD *
** *
** *
** By : CCH 2002.1.15 *
****************************************************************/
#include "includes.h"
#include "tools.h"
#include "keyboard.h"
#include "hstctl.h"
#include "screen.h"
#include "winstack.h"
#include "itemmenu.h"
#include "handset.h"
#include "adconst.h"
#if EN_HANDSET > 0
/*
********************************************************************************
* DEFINE CONFIG PARAMETERS
********************************************************************************
*/
#define MAX_STEP 9
#define INIT_STEP 4
#define VALUE_STEP 3
/*
********************************************************************************
* DEFINE MODULE VARIANTS
********************************************************************************
*/
static INT8U curvalue;
static KEY_STRUCT curkey;
static void DisplayProc(void)
{
INT8U linesize;
AdjustContrast();
linesize = GetScreenLineSize();
VTL_ClearScreen();
VTL_ScreenPrintStr("对比度\n ----------+");
VTL_AbsMovCursor(linesize + 2);
VTL_ScreenPrintChar(0x83, curvalue);
OverWriteScreen();
}
static void TurnUp(void)
{
if (curvalue < MAX_STEP) curvalue++;
DisplayProc();
}
static void TurnDown(void)
{
if (curvalue > 0) curvalue--;
DisplayProc();
}
static void HdlKeyProc(void)
{
GetKeyMsg(&curkey);
switch (curkey.key)
{
case KEY_UP:
TurnUp();
break;
case KEY_DOWN:
TurnDown();
break;
case KEY_ACK:
PopWinStack();
break;
case KEY_NAK:
PopWinStack();
break;
default:
break;
}
}
static WINSTACKENTRY_STRUCT WinStackEntry = {DisplayProc, 0, 0, DisplayProc, HdlKeyProc};
static void ActivateADConst(void)
{
PushWinStack(&WinStackEntry);
}
ITEMMENU_STRUCT MENU_ADCONST = {ITEM_FCN, " 调节\n 对比度", ActivateADConst, 0, 0};
void InitADConst(void)
{
curvalue = INIT_STEP;
}
void AdjustContrast(void)
{
CtlHstContrast(4 + curvalue * VALUE_STEP);
}
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -