📄 guiapp_action_keystonemenu.c
字号:
/*****************************************************************************
** TEXAS INSTRUMENTS PROPRIETARY INFORMATION
**
** (c) Copyright, Texas Instruments Incorporated, 2006.
** All Rights Reserved.
**
** Property of Texas Instruments Incorporated. Restricted Rights -
** Use, duplication, or disclosure is subject to restrictions set
** forth in TI's program license agreement and associated documentation.
******************************************************************************/
#include "common.h"
#include "guiStyle.h"
#include "guiApp_action.h"
#include "osd.h"
#include "eeprom.h"
#include "datapath.h"
#include "dispfmt.h"
#include "guiApp.h"
int16 tempPitch; // save keystone value during user adjustment
/* Initialize the items */
int08 guiApp_action_KeystoneMenu_OnStart( int16 menuId, GUIMSG *msg )
{
int16 min, max;
guiApp_SetMenuPosition( menuId, GUI_BOTTOMCENTER );
#if 0
/* place the menu in the bottom-center of the screen */
if( OSD_GetMenuSize( menuId, &height, &width ) == PASS && OSD_GetActiveRegion(&display) == PASS )
{
OSD_SetMenuPos( menuId, display.Bottom - height,
display.Left + (display.Right-display.Left)/2 - width/2 );
}
#endif
EE_GETVAR( UserMachine.Projector.KeystonePitch, tempPitch );
dispfmt_GetKeystoneAnglePitchLimits( &min, &max );
tempPitch = LMT( min >> 8, tempPitch, max >> 8 );
guiStyle_item_SetSingleValue( ITEM_KEYSTONEADJUSTMENTITEM, tempPitch, min >> 8, max >> 8 );
return PASS;
}
int08 guiApp_action_KeystoneMenu_OnClose( int16 menuId )
{
EE_PUTVAR( UserMachine.Projector.KeystonePitch, tempPitch );
return PASS;
}
/* implement item behavior, system interaction */
/* Note!!! The item style of the first item (ITEM_1DFEATUREITEM) in this menu must use guiStyle_item_Generic_GuiMsg */
/* guiStyle_item_Generic_GuiMsg converts LEFT, RIGHT, UP, DOWN into DEC, INC, DEC_Y, and INC_Y */
int08 guiApp_action_KeystoneMenu_GuiMsg( int16 menuId, int16 itemId, GUIMSG *msg )
{
int16 min, max;
if( msg == NULL )
return FAIL;
switch( msg->type )
{
case GUIMSG_DEC:
if( datapath_UserSetKeystoneAnglePitch( (tempPitch - 1) << 8 ) == PASS )
{
tempPitch--;
dispfmt_GetKeystoneAnglePitchLimits( &min, &max );
guiStyle_item_SetSingleValue( ITEM_KEYSTONEADJUSTMENTITEM, tempPitch, min >> 8, max >> 8 );
}
break;
case GUIMSG_INC:
if( datapath_UserSetKeystoneAnglePitch( (tempPitch + 1) << 8 ) == PASS )
{
tempPitch++;
dispfmt_GetKeystoneAnglePitchLimits( &min, &max );
guiStyle_item_SetSingleValue( ITEM_KEYSTONEADJUSTMENTITEM, tempPitch, min >> 8, max >> 8 );
}
break;
default:
break;
}
return PASS;
}
int08 guiApp_action_KeystoneMenu_Redraw( int16 menuId, GUIMSG *msg )
{
guiApp_SetMenuPosition( menuId, GUI_BOTTOMCENTER );
return PASS;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -