📄 guiapp_action_languagemenu.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 "app_Cfg.h"
#include "eeprom.h"
const int16 languageIndexArray[] = {ITEM_ENGLISHITEM, ITEM_GERMANITEM, ITEM_CHINESEITEM, ITEM_JAPANESEITEM, ITEM_ARABICITEM};
static uint08 languageIndexVal; /* index stored in EEPROM */
/* Initialize the items */
int08 guiApp_action_LanguageMenu_OnStart( int16 menuId, GUIMSG *msg )
{
int16 languageItemId;
EE_GETVAR( UserMachine.Projector.Language, languageIndexVal );
languageItemId = languageIndexArray[languageIndexVal];
/* set the active radio button on the item representing the current language */
guiStyle_item_SetListIndex( languageItemId, TRUE );
return PASS;
}
int08 guiApp_action_LanguageMenu_OnClose( int16 menuId )
{
/* save the current language to the eeprom*/
EE_PUTVAR( UserMachine.Projector.Language, languageIndexVal );
return PASS;
}
/* specify the highlight window as required by the GUI Style ADL */
int08 guiApp_action_LanguageMenu_GetHighlightWindow( int16 menuId, uint08 *window )
{
*window = WIND_LANGUAGEMENUHIGHLIGHT;
return PASS;
}
/* implement item behavior, system interaction */
int08 guiApp_action_LanguageMenu_GuiMsg( int16 menuId, int16 itemId, GUIMSG *msg )
{
if( msg == NULL )
return FAIL;
switch( itemId )
{
case ITEM_ENGLISHITEM:
switch( msg->type )
{
case GUIMSG_ASSERT:
guiStyle_item_SetListIndex( itemId, TRUE );
if( OSD_SetLanguage( LANG_ENGLISH ) == PASS )
{
languageIndexVal = 0;
guiStyle_Reload();
}
break;
default:
break;
}
break;
case ITEM_GERMANITEM:
switch( msg->type )
{
case GUIMSG_ASSERT:
guiStyle_item_SetListIndex( itemId, TRUE );
if( OSD_SetLanguage( LANG_GERMAN ) == PASS )
{
languageIndexVal = 1;
guiStyle_Reload();
}
break;
default:
break;
}
break;
case ITEM_CHINESEITEM:
switch( msg->type )
{
case GUIMSG_ASSERT:
guiStyle_item_SetListIndex( itemId, TRUE );
if( OSD_SetLanguage( LANG_CHINESE ) == PASS )
{
languageIndexVal = 2;
guiStyle_Reload();
}
break;
default:
break;
}
break;
case ITEM_JAPANESEITEM:
switch( msg->type )
{
case GUIMSG_ASSERT:
guiStyle_item_SetListIndex( itemId, TRUE );
if( OSD_SetLanguage( LANG_JAPANESE ) == PASS )
{
languageIndexVal = 3;
guiStyle_Reload();
}
break;
default:
break;
}
break;
case ITEM_ARABICITEM:
switch( msg->type )
{
case GUIMSG_ASSERT:
guiStyle_item_SetListIndex( itemId, TRUE );
if( OSD_SetLanguage( LANG_ARABIC ) == PASS )
{
languageIndexVal = 4;
guiStyle_Reload();
}
break;
default:
break;
}
break;
default:
return FAIL;
}
return PASS;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -