📄 osd3.c
字号:
bItemNum = 1; // just use it to keep if this is a seperate line } else bItemNum = 0; // just use it to keep if this is a seperate line if (__bMENUSelect[__bMENUCurrentLevel] > __bMENUDisplayStart[__bMENUCurrentLevel]+GET_MENU_ROW(_pTempMenu)-1) {#ifdef SKIP_DISABLED_ITEM __bMENUDisplayStart[__bMENUCurrentLevel] = __bMENUSelect[__bMENUCurrentLevel] - GET_MENU_ROW(_pTempMenu) +(1+bItemNum);#else __bMENUDisplayStart[__bMENUCurrentLevel] += (1+bItemNum);#endif OSDMENU_DisplayMenu(__bCurrentMenuId, 0xFF, __bMENUCurrentLevel); } else {#ifdef SKIP_DISABLED_ITEM // Brian1.05, don't move cursor onto disabled item. // alan090 _MENU_StrAttr.bTextColor = OSDMENU_ENTRY_TEXT_COLOR_NORMAL; OSDMENU_DrawItem(__bMENUDisplayStart[__bMENUCurrentLevel], (BYTE)(bOrgItem-bItemNum), (BYTE)OSDMENU_ENTRY_ITEM_COLOR_NORMAL);#else OSDMENU_DrawItem(__bMENUDisplayStart[__bMENUCurrentLevel], (BYTE)(__bMENUSelect[__bMENUCurrentLevel]-1-bItemNum), (BYTE)OSDMENU_ENTRY_ITEM_COLOR_NORMAL);#endif } __wMENUCurrentItemId = GET_ITEM_ID(_pTempMenu, __bMENUSelect[__bMENUCurrentLevel]); // clear the previous menu#ifdef SKIP_DISABLED_ITEM _pTempMenu = GET_SUB_MENU(_pTempMenu, bOrgItem-bItemNum);#else _pTempMenu = GET_SUB_MENU(_pTempMenu, __bMENUSelect[__bMENUCurrentLevel]-1-bItemNum);#endif if (_pTempMenu) { OSDMENU_ClearMenu(); __bMENUStatus[__bMENUCurrentLevel+1] &= 0xFE; // clear scroll-up bit __bMENUStatus[__bMENUCurrentLevel+1] &= 0xFD; // clear scroll-down bit } _pTempMenu = _pMenuIndex[__bCurrentMenuId]; _bMENUTemp = __bMENUSelect[__bMENUCurrentLevel]; if(GET_ITEM_ATTRIBUTE(_pTempMenu, _bMENUTemp) == IS_ITEM) { if (*(GET_MENU_ENABLE(_pTempMenu)+_bMENUTemp/8) & (1 << (_bMENUTemp%8))) { // item is enabled, set the text color as normal color _MENU_StrAttr.bTextColor = OSDMENU_ENTRY_TEXT_COLOR_NORMAL; OSDMENU_DrawItem(__bMENUDisplayStart[__bMENUCurrentLevel], __bMENUSelect[__bMENUCurrentLevel], OSDMENU_ENTRY_ITEM_COLOR_HIGHLIGHT); OSDMENU_DisplaySubMenu(__bMENUSelect[__bMENUCurrentLevel], __bMENUCurrentLevel); } else { // item is disabled, set the text color as disable color _MENU_StrAttr.bTextColor = OSDMENU_ENTRY_TEXT_COLOR_DISABLE; OSDMENU_DrawItem(__bMENUDisplayStart[__bMENUCurrentLevel], __bMENUSelect[__bMENUCurrentLevel], OSDMENU_ENTRY_ITEM_COLOR_HIGHLIGHT); } break; } // Brian1.02a,for Dialog like "Parental", "Change Password" else if(GET_ITEM_ATTRIBUTE(_pTempMenu, _bMENUTemp) == IS_DIALOG) { if (*(GET_MENU_ENABLE(_pTempMenu)+_bMENUTemp/8) & (1 << (_bMENUTemp%8))) { // item is enabled, set the text color as normal color _MENU_StrAttr.bTextColor = OSDMENU_ENTRY_TEXT_COLOR_NORMAL; } else { // item is disabled, set the text color as disable color _MENU_StrAttr.bTextColor = OSDMENU_ENTRY_TEXT_COLOR_DISABLE; } } OSDMENU_DrawItem(__bMENUDisplayStart[__bMENUCurrentLevel], __bMENUSelect[__bMENUCurrentLevel], OSDMENU_ENTRY_ITEM_COLOR_HIGHLIGHT); OSDMENU_DisplaySubMenu(__bMENUSelect[__bMENUCurrentLevel], __bMENUCurrentLevel); } break; // Brian1.08a case OSDMENU_GOTO_SUB_MENU: _bMENUTemp = __bMENUSelect[__bMENUCurrentLevel]; if (GET_SUB_MENU(_pTempMenu, __bMENUSelect[__bMENUCurrentLevel]) && *(GET_MENU_ENABLE(_pTempMenu)+_bMENUTemp/8) & (1 << (_bMENUTemp%8)) ) // && __bMENUCurrentLevel < (MENU_LEVEL-1)) { // Brian1.08a, from icon menu to its sub-menu, so clear the clear the display of settings #ifdef SUPPORT_MENU_SETTINGS_DISPLAY if (__bMENUCurrentLevel == 0) { _ClearCurrentSettings(); }#endif __wMENUPrevItemId = __wMENUCurrentItemId; // change the highlight to select // alan090 _MENU_StrAttr.bTextColor = OSDMENU_ENTRY_TEXT_COLOR_NORMAL; OSDMENU_DrawItem(__bMENUDisplayStart[__bMENUCurrentLevel], __bMENUSelect[__bMENUCurrentLevel], OSDMENU_ENTRY_ITEM_COLOR_SELECT); __bMENUParent[__bMENUCurrentLevel+1] = __bCurrentMenuId; _pTempMenu = GET_SUB_MENU(_pTempMenu, __bMENUSelect[__bMENUCurrentLevel]); { __bCurrentMenuId = GET_MENU_ID(_pTempMenu); __bMENUCurrentLevel++; __wMENUCurrentItemId = GET_ITEM_ID(_pTempMenu, __bMENUSelect[__bMENUCurrentLevel]); _bMENUTemp = __bMENUSelect[__bMENUCurrentLevel];#ifdef SKIP_DISABLED_ITEM // Brian1.05, don't move cursor onto disabled item. bOrgItem = __bMENUSelect[__bMENUCurrentLevel]; // keep the current select while(__bMENUSelect[__bMENUCurrentLevel] != bItemNum-1) { _bMENUTemp = __bMENUSelect[__bMENUCurrentLevel]; if(GET_ITEM_ATTRIBUTE(_pTempMenu, _bMENUTemp) == IS_ITEM|| GET_ITEM_ATTRIBUTE(_pTempMenu, _bMENUTemp) == IS_DIALOG) { if (*(GET_MENU_ENABLE(_pTempMenu)+_bMENUTemp/8) & (1 << (_bMENUTemp%8))) // if enabled { __wMENUCurrentItemId = GET_ITEM_ID(_pTempMenu, __bMENUSelect[__bMENUCurrentLevel]); break; // find a enabled item } else { if (__bMENUSelect[__bMENUCurrentLevel] == bItemNum-1) { // no enabled item is found, so the cursor remain still __bMENUSelect[__bMENUCurrentLevel] = bOrgItem; return; } } __bMENUSelect[__bMENUCurrentLevel]++; } // if IS_ITEM else { break; // for value, no such consideration, just move the cursor as usual } } // while#endif if(GET_ITEM_ATTRIBUTE(_pTempMenu, _bMENUTemp) == IS_ITEM || GET_ITEM_ATTRIBUTE(_pTempMenu, _bMENUTemp) == IS_DIALOG) // Brian1.05 { if (*(GET_MENU_ENABLE(_pTempMenu)+_bMENUTemp/8) & (1 << (_bMENUTemp%8))) { // item is enabled, set the text color as normal color _MENU_StrAttr.bTextColor = OSDMENU_ENTRY_TEXT_COLOR_NORMAL; OSDMENU_DrawItem(__bMENUDisplayStart[__bMENUCurrentLevel], __bMENUSelect[__bMENUCurrentLevel], OSDMENU_ENTRY_ITEM_COLOR_HIGHLIGHT); OSDMENU_DisplaySubMenu(__bMENUSelect[__bMENUCurrentLevel], __bMENUCurrentLevel); } else { // item is disabled, set the text color as disable color _MENU_StrAttr.bTextColor = OSDMENU_ENTRY_TEXT_COLOR_DISABLE; OSDMENU_DrawItem(__bMENUDisplayStart[__bMENUCurrentLevel], __bMENUSelect[__bMENUCurrentLevel], OSDMENU_ENTRY_ITEM_COLOR_HIGHLIGHT); } break; } OSDMENU_DrawItem(__bMENUDisplayStart[__bMENUCurrentLevel], __bMENUSelect[__bMENUCurrentLevel], OSDMENU_ENTRY_ITEM_COLOR_HIGHLIGHT); OSDMENU_DisplaySubMenu(__bMENUSelect[__bMENUCurrentLevel], __bMENUCurrentLevel); } } break; // Brian1.08a case OSDMENU_GOTO_PARENT_MENU:// Brian1.08a, support Horizontal icon menu#ifdef SUPPORT_SETUP_HORIZONTAL_ICON_MENU // for Horizontal icon case, KEY_LEFT won't go to icon menu if (__bMENUCurrentLevel == 1 && bKey == KEY_LEFT) { break; } else#endif if (__bMENUCurrentLevel > 0) { __wMENUPrevItemId = __wMENUCurrentItemId; // change the highlight to normal //alan090 _MENU_StrAttr.bTextColor = OSDMENU_ENTRY_TEXT_COLOR_NORMAL; OSDMENU_DrawItem(__bMENUDisplayStart[__bMENUCurrentLevel], __bMENUSelect[__bMENUCurrentLevel], OSDMENU_ENTRY_ITEM_COLOR_NORMAL); // Clear the sub menu _pTempMenu = GET_SUB_MENU(_pTempMenu, __bMENUSelect[__bMENUCurrentLevel]); if (_pTempMenu) { OSDMENU_ClearMenu(); __bMENUStatus[__bMENUCurrentLevel+1] &= 0xFE; // clear scroll-up bit __bMENUStatus[__bMENUCurrentLevel+1] &= 0xFD; // clear scroll-down bit } _pTempMenu = _pMenuIndex[__bMENUParent[__bMENUCurrentLevel]]; if (_pTempMenu) { __bCurrentMenuId = GET_MENU_ID(_pTempMenu); __bMENUCurrentLevel--; __wMENUCurrentItemId = GET_ITEM_ID(_pTempMenu, __bMENUSelect[__bMENUCurrentLevel]); OSDMENU_DrawItem(__bMENUDisplayStart[__bMENUCurrentLevel], __bMENUSelect[__bMENUCurrentLevel], OSDMENU_ENTRY_ITEM_COLOR_HIGHLIGHT); } // Brian1.08a, from sub menu to the icon menu, so display the settings #ifdef SUPPORT_MENU_SETTINGS_DISPLAY if (__bMENUCurrentLevel == 0) { _DisplayCurrentSettings(); }#endif } break; case OSDMENU_SELECT_ITEM: _bMENUTemp = __bMENUSelect[__bMENUCurrentLevel]; if (GET_ITEM_ATTRIBUTE(_pTempMenu, _bMENUTemp) == IS_VALUE) { // the "Read default value" Value has no check if (GET_MENU_CHECK(_pTempMenu) != NULL) { // Brian1.08, search the menu to get item position // the current check item bItemNum = _GetMenuItemPosition(*(GET_MENU_CHECK(_pTempMenu))); if (bItemNum >=__bMENUDisplayStart[__bMENUCurrentLevel] && bItemNum < __bMENUDisplayStart[__bMENUCurrentLevel]+GET_MENU_ROW(_pTempMenu)) { // the current checked item is displayed on the screen, un-check it OSDMENU_DrawCheckMark((BYTE)(bItemNum-__bMENUDisplayStart[__bMENUCurrentLevel]), (BYTE)OSDMENU_ENTRY_ITEM_COLOR_NORMAL, FALSE); } *(GET_MENU_CHECK(_pTempMenu)) = (BYTE)__wMENUCurrentItemId; OSDMENU_DrawCheckMark((BYTE)(_bMENUTemp-__bMENUDisplayStart[__bMENUCurrentLevel]), OSDMENU_ENTRY_ITEM_COLOR_HIGHLIGHT, TRUE); }#ifdef SUPPORT_MENU_CURSOR_STAY_AT_VALUE_AFTER_ENTER // Brian1.08a // menu cursor will stay at the value menu after Key Enter // but the _SaveDataToSetupInfo depends on the __wMENUCurrentItemId which is item ID to save the value to EEPROM and do actions // if the cursor is stay at value menu, then the ID is the value ID, not item ID. // We don't want to change _SaveDataToSetupInfo so much for this option, ===> so we can use a extra variable // to record the Item ID while the __wMENUCurrentItemId is still the value ID as it should be. // And in _SaveDataToSetupInfo, we use the new variable instead. _wMENUTemp = __bMENUParent[__bMENUCurrentLevel]; //_pTempMenu = _pMenuIndex[_wMENUTemp]; // don't change _pTempMenu, or we need to set it back after temp usage __wMENUItemIdAfterEnter = GET_ITEM_ID(_pMenuIndex[_wMENUTemp], __bMENUSelect[__bMENUCurrentLevel-1]);#else // menu cursor will not mov to its parent (by issue a "KEY_LEFT" operation) after KEY_ENTER // Brian1.08a, use operation instead //bKey = KEY_LEFT; bMenuOperation = OSDMENU_GOTO_PARENT_MENU; goto process_key_op;#endif } else { // Brian1.08a bMenuOperation = OSDMENU_GOTO_SUB_MENU; goto process_key_op; } break; }}// *********************************************************************// Function : OSDMENU_DisplayMenu// Description : This function display the single menu// Arguments : bMenuId: the ID of menu // The ID is an index to _pMenuIndex[]// bLevel: the item must be displayed.// Return : None // Side Effect :// *********************************************************************void OSDMENU_DisplayMenu(BYTE bMenuId, BYTE bItem, BYTE bLevel){ _pTempMenu = _pMenuIndex[bMenuId]; if (_pTempMenu) // for Main Menu "Exit" item, the submenu is null { if (bMenuId == SETUP_MENU_MAIN || bMenuId == SETUP_MENU_MAIN_WITH_PROLOGIC) _DisplayIconMenu(); else _DisplayMenu(bItem, bLevel); }}// *********************************************************************// Function : _DisplayIconMenu// Description : This function display the single Icon menu// Arguments : None (assume icon menu is the root (level 0) and no scroll)// Global Var : _pTempMenu: The menu// Return : None // Side Effect :// *********************************************************************// This fuction would only be called when the Root (icon) menu is first displayedvoid _DisplayIconMenu(void){ _bMENUTemp2 = GET_MENU_ITEM_NUM(_pTempMenu); _MENU_StrAttr.bColorKey = 0; for (_bMENUTemp=0; _bMENUTemp <_bMENUTemp2; _bMENUTemp++) {#ifdef REMOVE_SETUP_ICON _MENU_StrAttr.bShadow1 = OSDMENU_ENTRY_TEXT_COLOR_NORMAL; _MENU_StrAttr.bShadow2 = OSDMENU_ENTRY_TEXT_COLOR_DISABLE;#endif // check if disable if(GET_ITEM_ATTRIBUTE(_pTempMenu, _bMENUTemp) == IS_ITEM) {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -