⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 guiapp_action_magnifymenu.c

📁 IT projecotr reference design.
💻 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 "datapath.h"
#include "dispfmt.h"
#include "guiApp.h"

/* Initialize the items */
int08 guiApp_action_MagnifyMenu_OnStart( int16 menuId, GUIMSG *msg )
{
    int16 tempMagnify, min, max;
    
    guiApp_SetMenuPosition( menuId, GUI_BOTTOMCENTER );
    
    /* no magnify value stored in EEPROM, so poll display formatting module for value */
    dispfmt_GetMagnifyLimits( &min, &max );
    dispfmt_GetMagnify( &tempMagnify );
        
    guiStyle_item_SetSingleValue( ITEM_MAGNIFYADJUSTMENTITEM, tempMagnify, min, max );
       
    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_MagnifyMenu_GuiMsg( int16 menuId, int16 itemId, GUIMSG *msg )
{
    int16 tempMagnify, min, max;

    if( msg == NULL )
        return FAIL;

    switch( msg->type )
    {
        case GUIMSG_DEC:
            if( dispfmt_GetMagnifyLimits( &min, &max ) == PASS &&
                dispfmt_GetMagnify( &tempMagnify ) == PASS )
            {
                if( datapath_UserSetMagnify( tempMagnify - 1 ) == PASS )
                  {
                      tempMagnify--;
                      guiStyle_item_SetSingleValue( ITEM_MAGNIFYADJUSTMENTITEM, tempMagnify, min, max );            
                  }
            }
            break;

        case GUIMSG_INC:
            if( dispfmt_GetMagnifyLimits( &min, &max ) == PASS &&
                dispfmt_GetMagnify( &tempMagnify ) == PASS )
            {
                if( datapath_UserSetMagnify( tempMagnify + 1 ) == PASS )
                {
                    tempMagnify++;
                    guiStyle_item_SetSingleValue( ITEM_MAGNIFYADJUSTMENTITEM, tempMagnify, min, max );            
                }
            }
            break; 
        
        default:
            break;        
    }
        
    return PASS;
}

int08 guiApp_action_MagnifyMenu_Redraw( int16 menuId, GUIMSG *msg )
{
    guiApp_SetMenuPosition( menuId, GUI_BOTTOMCENTER );

    return PASS;   
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -