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

📄 setup_show_page.c

📁 Sunplus 8202S source code.
💻 C
📖 第 1 页 / 共 2 页
字号:
/***************************************************************
*  setup_show_page.c
*  include  in setup_tab_ui1.c   when defined DVD_SETUP_REENG
* 
* Creator:  JSLin 
* Date:         2004/07/28
*
* Description : 
*           setup menu precentation engine, 
*           1. transform content into GUI   
*
****************************************************************/


void setup_ShowPage(void);
void setup_ShowPageL1(void);
void setup_ShowPageL2(void);
void setup_ShowPageL3(void);
void setup_ExitPage(void);
void setup_ShowPageCUSTM(void);
void setup_ShowCUSTMMsg(void);



void setup_ShowPage(void)
{
    //printf("\n\nsetup_show_page\n");

    // setup position has no changed, no need to re-draw
    if((setup_pos[0] == setup_last_pos[0]) && (setup_pos[1] == setup_last_pos[1])
        &&(setup_pos[2] == setup_last_pos[2]) && (setup_pos[3] == setup_last_pos[3]))
    {
        return;
    }

    if(full_scrn&CUSTM)
    {
        setup_ShowPageCUSTM();
        return;
    }

    // level 1, show page title and icon bar
    if(((setup_pos[SETUP_ML0] == 1) && (setup_last_pos[SETUP_ML0] <= 1 ))||(setup_pos[1]!=setup_last_pos[1]))
    {
        setup_ShowPageL1();
        #ifdef SHOW_SETUPMENU_SETUP //denghangao 20040929
           show_setupmenu();
        #endif
        
    }

    // level 2, show page items
    if(!((setup_pos[SETUP_ML0] == SETUP_ML3) && (setup_last_pos[SETUP_ML0] == SETUP_ML3)))
    {
        setup_ShowPageL2();
    }
    
    // level 3, show item selections
    if(setup_pos[SETUP_ML0] > SETUP_ML1)
    {
        setup_ShowPageL3();
    }

}//end of setup_show_menu
//====================================================================


void setup_ShowPageL1(void)
{
    int     i;
    #ifdef  SETUP_COLOR_TYPE1   //wangfeng 2003-08-29 17:28
    UINT16 line=SETUP_MAX_WIDTH*16;
    #else
    UINT16 line=SETUP_MAX_WIDTH*16-20;
    #endif

    #ifndef  SETUPMENU_16Mb_NO_ICON
    //printf("\n\nsetup_show_page_L1\n");

    //draw rectangulars
    osd_draw_rect(0, 0, (SETUP_MAX_WIDTH*16), 10+SETUP_BUTTON_HEIGHT+12, setupBGcolorH);                
    osd_draw_rect(10, 10, line, SETUP_BUTTON_HEIGHT+12,setupBGcolorI); 
    osd_draw_rect(0, 10+SETUP_BUTTON_HEIGHT+12, line+20, SETUP_BUTTON_HEIGHT+8, setupBGcolorT);
    osd_draw_rect(0, 10+SETUP_BUTTON_HEIGHT*2+20, (SETUP_MAX_WIDTH*16), (SETUP_MAX_LINE*SETUP_BUTTON_HEIGHT), setupBGcolorB);                
    osd_draw_rect(0, 10+SETUP_BUTTON_HEIGHT*2+20, (SETUP_MAX_WIDTH*16), 2, setupBGcolorSL);                
    osd_draw_rect(0, 10+SETUP_BUTTON_HEIGHT*2+10+(SETUP_MAX_LINE*SETUP_BUTTON_HEIGHT)-100, (SETUP_MAX_WIDTH*16), 18, setupBGcolorF);
    
    // show page title
    const char *str;
    str = _OsdMessegeFont1[osd_font_mode][setup_item[setup_pos[SETUP_ML1]][0][1]];
    osd_DrawString(setup_item[setup_pos[1]][0][3], 2, str, setupFcolorT, setupBGcolorT);
    #else//denghg   draw rectangulars  2004-9-28 13:50
    osd_draw_rect(0, 0, (SETUP_MAX_WIDTH*16), 10+SETUP_BUTTON_HEIGHT+12, setupBGcolorH);                
    osd_draw_rect(10, 10, line, SETUP_BUTTON_HEIGHT+12,setupBGcolorI); 
    osd_draw_rect(0, 10+SETUP_BUTTON_HEIGHT+12, line+20, SETUP_BUTTON_HEIGHT+8, setupBGcolorT);
    osd_draw_rect(0, 10+SETUP_BUTTON_HEIGHT*2+20, (SETUP_MAX_WIDTH*16), (SETUP_MAX_LINE*SETUP_BUTTON_HEIGHT),setupBGcolorB);                
    // osd_draw_rect(0, 10+SETUP_BUTTON_HEIGHT*2+20, (SETUP_MAX_WIDTH*16), 2, setupBGcolorSL);                
    osd_draw_rect(0, 10+SETUP_BUTTON_HEIGHT*2+10+(SETUP_MAX_LINE*SETUP_BUTTON_HEIGHT)-100, (SETUP_MAX_WIDTH*16), 18, setupBGcolorF);
 
    //DENGHG  SHOW  CURSOR 2004-9-28 16:13 
    osd_draw_rect((setup_pos[SETUP_ML1])*line/setup_max_icon, 10, line/setup_max_icon+10,SETUP_BUTTON_HEIGHT+12, setupCURSOR);
    #endif//
    // draw icon bar or  setupIconString  //denghg  2004-9-28 20:18
    for(i=0; i<setup_max_icon; i++)
    {       
         #ifdef SETUPMENU_16Mb_NO_ICON
           const char *setupIconString[MAX_SETUP_PAGE]={"SYS","LAN","AUD","VID","SPE","DIG"};
           osd_DrawSetupIconString(setup_item[i][0][4], 13,setupIconString[setup_item[i][0][2]],IconStringTCOLOR,IconStringBGCOLOR);            	            
         #else
           osd_DrawIcon(setup_item[i][0][4], 13, setup_item[i][0][2], setup_item[setup_pos[SETUP_ML1]][0][2]);       
           //printf("setup_pos[SETUP_ML1]=%4d\n",setup_pos[SETUP_ML1]);  
         #endif          	  
    }
   
}



//====================================================================


void setup_ShowPageL2(void)
{
    int     i;
    BYTE    xStart, yStart, xLen;//, xOffset, fColor, bgColor, upDown;
    //const char   *str;    

    //printf("\n\nsetup_show_page_L2\n");
    yStart = 0;
    //for setup_level = 1, left/right walking on page(1st) level, just list all items of this page
    if(((setup_pos[SETUP_ML2] == 0) && (setup_pos[SETUP_ML0] == SETUP_ML1))
        ||setup_refresh) 
    {            
        //clear level 2 area
        osd_draw_rect(10, 10+SETUP_BUTTON_HEIGHT*2+22, (SETUP_MAX_WIDTH*8)-16, (MAX_PAGE_ITEM*SETUP_BUTTON_HEIGHT)+10, setupBGcolorL2);
        //clear level 3 area
        #ifndef SHOW_SETUPMENU_SETUP//denghangao 20040929
        osd_draw_rect((SETUP_MAX_WIDTH*8)-8, 10+SETUP_BUTTON_HEIGHT*2+22, (SETUP_MAX_WIDTH*8)-10, (MAX_PAGE_ITEM*SETUP_BUTTON_HEIGHT)+10, setupBGcolorL3);
        #endif
		xStart = SETUP_MENU_XSTART;
        xLen = SETUP_SUB_XSTART-SETUP_MENU_XSTART-1;
        setup_itemType= SETUP_itemNormal;
        
        for(i=1; i<=MAX_PAGE_ITEM; i++)
        {
        	if((setup_item[setup_pos[1]][i][0]!=SET_NE)&&(setup_item[setup_pos[1]][i][0]!=SET_SPACE))
        	{
            	yStart = SETUP_MENU_YSTART + i;
            	id = setup_item[setup_pos[SETUP_ML1]][i][1];
            	setup_draw_item(xStart, yStart, xLen, id, setup_itemType);
            }
        }
    }


    //for setup_level =2, up/down walking on item(2nd) level, highlight the corresponding item
    if(setup_pos[SETUP_ML0] == SETUP_ML2)
    {
        //clear level 3 area
        osd_draw_rect((SETUP_MAX_WIDTH*8)-8, 10+SETUP_BUTTON_HEIGHT*2+22, (SETUP_MAX_WIDTH*8)-10, (MAX_PAGE_ITEM*SETUP_BUTTON_HEIGHT)+10, setupBGcolorL3);

        xStart = SETUP_MENU_XSTART;
        xLen = SETUP_SUB_XSTART-SETUP_MENU_XSTART-1;
            
        //unmark last located item
        if(setup_last_pos[SETUP_ML2] != 0)
        {
            yStart = SETUP_MENU_YSTART + setup_last_pos[SETUP_ML2];
            id = setup_item[setup_last_pos[SETUP_ML1]][setup_last_pos[SETUP_ML2]][1];
            setup_itemType= SETUP_itemNormal;
            setup_draw_item(xStart, yStart, xLen, id, setup_itemType);
        }

        // mark current located item
        if(setup_pos[SETUP_ML2] != 0)
        {
            yStart = SETUP_MENU_YSTART + setup_pos[SETUP_ML2];      
            id = setup_item[setup_pos[SETUP_ML1]][setup_pos[SETUP_ML2]][1];
            setup_itemType= SETUP_itemMark;
            setup_draw_item(xStart, yStart, xLen, id, setup_itemType);
        }

        //draw arrow
        if((setup_item[setup_pos[1]][setup_pos[2]][0]!=SET_SH)&&(setup_item[setup_pos[1]][setup_pos[2]][0]!=SET_LINK))
        {
            osd_DrawString(SETUP_SUB_XSTART-1, yStart, Ch_arrorR, setupFcolorAL2, setupBGcolorAL2);
        }
    }

    // for setup_level from 2 to 3, change the color of selected item
    if((setup_pos[0] == SETUP_ML3) && (setup_last_pos[0] == SETUP_ML2))
    {
                xStart = SETUP_MENU_XSTART;
        xLen = SETUP_SUB_XSTART-SETUP_MENU_XSTART-1;
        
        yStart = SETUP_MENU_YSTART + setup_pos[SETUP_ML2];
        id = setup_item[setup_pos[1]][setup_pos[2]][1];
        setup_itemType = SETUP_itemSelected;
        setup_draw_item(xStart, yStart, xLen, id, setup_itemType);

        //draw arrow
        osd_DrawString(SETUP_SUB_XSTART-1, yStart, Ch_arrorR, setupFcolorAL3, setupBGcolorAL3);
    }
}
//====================================================================


void setup_ShowPageL3(void)
{
    int         i;//, j;
    BYTE    xStart, yStart, xLen;//, xOffset, fColor, bgColor, upDown;
    UINT8   itemType, itemSel;
        
    //printf("\n\nsetup_show_page_L3\n");

    itemType = setup_item[setup_pos[1]][setup_pos[2]][0];

    xStart = SETUP_SUB_XSTART;
    xLen = SETUP_MAX_WIDTH-SETUP_SUB_XSTART-2;
    
    //for setup_level = 2, up/down walking on item(2nd) level, just list all selection of this item 
    if(setup_pos[0] == SETUP_ML2)
    {
        switch(itemType)
        {
            case SET_FUNC:
                        itemSel = setup_sel[setup_pos[1]][setup_pos[2]];

                for(i=2; i<MAX_ITEM_SEL; i++)
                {
                    id = setup_item[setup_pos[1]][setup_pos[2]][i];
                    if (id == 0) break;

                    yStart = setup_item[setup_pos[1]][setup_pos[2]][MAX_ITEM_SEL]+i+1;
                    if(itemSel==i)
                        setup_itemType= SETUP_itemSelected;
                    else
                        setup_itemType= SETUP_itemNormal;
                    
                    setup_draw_item(xStart, yStart, xLen, id, setup_itemType);
                }
                break;
            case SET_SCALE:
                id = setup_item[setup_pos[1]][setup_pos[2]][1];
                setup_DrawScaleForm( id, 0);
                setup_DrawScaleCursor(id, 0);
                break;
            case SET_NM:
                setup_pos[3] = setup_sel[setup_pos[1]][setup_pos[2]];
                id = setup_item[setup_pos[1]][setup_pos[2]][setup_pos[3]];
                yStart = setup_pos[2]+SETUP_MENU_YSTART;
                setup_itemType = SETUP_itemSelected;
                setup_draw_item(xStart, yStart, xLen, id, setup_itemType);
                break;
                
            case SET_SH:
            case SET_NE:
            case SET_SPACE:
                break;
        }
    }

    //for setup_level from 2 to 3
    if((setup_pos[0] == SETUP_ML3) && (setup_last_pos[0] == SETUP_ML2))
    {

        switch(itemType)
        {
            case SET_FUNC:

⌨️ 快捷键说明

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