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

📄 guistyle_item_generic.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 "osd.h"

int08 guiStyle_item_Generic_GuiMsg( GUI_OPEN_MENU *menu, GUIMSG *msg )
{
    if( msg == NULL || menu == NULL )
        return FAIL;

    switch( msg->type )
    {
        case GUIMSG_LEFT:
            msg->type = GUIMSG_DEC;
            break;
        
        case GUIMSG_DOWN:
            msg->type = GUIMSG_DEC_Y;
            break;
        
        case GUIMSG_RIGHT:
            msg->type = GUIMSG_INC;
            break;
        
        case GUIMSG_UP:
            msg->type = GUIMSG_INC_Y;
            break;
        
        case GUIMSG_SELECT:
            msg->type = GUIMSG_ASSERT;
            break;
        
        case GUIMSG_STRING:
        case GUIMSG_VALUE:
            // pass the message as is
            break;

        default:
            break;
    }    
    
    gui_AppAction_GuiMsg( menu->menuId, menu->itemId, msg );
    
    return PASS;
}

int08 guiStyle_item_Generic_MenuWindowHighlight( int16 itemId, uint08 winNum, BOOL highlight )
{
    /* use a menu window as the highlight window (as specified by winNum) */
    return OSD_SetItemHighlight( itemId, winNum, highlight );
}


int08 guiStyle_item_Generic_ItemWindowHighlight( int16 itemId, uint08 winNum, BOOL highlight )
{
    uint08 winNum2;
       
    /* get the first window in the item, set the highlight property correspondingly */
    if( OSD_GetItemFirstWinNum( itemId, &winNum2 ) != PASS )
        return GUI_ERR_ITEMHIGHLIGHT;
    if( OSD_SetWinHighlight( winNum2, highlight ) != PASS )
        return GUI_ERR_ITEMHIGHLIGHT;
    
    /* hide the menu's highlight bar */
    if( winNum != OSD_ERR_WINNUM_INVALID )
    {
        if( OSD_DisplayWindow( winNum, FALSE ) != PASS )
            return GUI_ERR_ITEMHIGHLIGHT;
    }
    return PASS;
}

int08 guiStyle_item_Generic_GrayOut( int16 itemId, BOOL gray )
{
    int16 fieldId;
    
    /* Set the character color for every field in the item */
    fieldId = OSD_GetFirstFieldID( itemId );
    while( fieldId != OSD_ERR_ID_INVALID )
    {
        if( gray )
        {
            /* set all character strings to gray (color is palette-dependent) */
            OSD_SetCharColor( fieldId, 3 );
        }
        else
        {
            /* set all character strings back to black (color is palette-dependent) */
            OSD_SetCharColor( fieldId, 1 );
        }
        
        fieldId = OSD_GetNextFieldID( fieldId );
    }
    return PASS;
}

⌨️ 快捷键说明

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