Esempio n. 1
0
BOOL submenu_scroll_down(sub_menu_t* sub_menu)
{
    UINT32 count = sub_menu->item_count;
    UINT32 depth = sub_menu->list_page;
    UINT32 top_pos = sub_menu->list_top;
    UINT32 cur_sel = sub_menu->list_sel;
    UINT32 cur_pos = cur_sel - top_pos;
    //UINT32 old_sel = cur_sel;
    //UINT32 old_top = top_pos;
    UINT32 i;
    BOOL ret = TRUE;

    for (i = 0; i < count; i++)
    {
        ret = OSD_ScrollLineDown(count, depth, &top_pos, &cur_pos);
        if (!ret)
            return FALSE;

        cur_sel = top_pos + cur_pos;
        if (submenu_item_attr(sub_menu, cur_sel) == C_ATTR_ACTIVE)
        {
            sub_menu->list_top = top_pos;
            sub_menu->list_sel = cur_sel;
            return TRUE;
        }
    }
    return FALSE;
}
Esempio n. 2
0
BOOL submenu_unknown_act(sub_menu_t *sub_menu, UINT32 vact)
{
    UINT32 count = sub_menu->item_count;
    UINT32 depth = sub_menu->list_page;
    UINT32 top_pos = sub_menu->list_top;
    UINT32 cur_sel = sub_menu->list_sel;
    UINT32 cur_pos = cur_sel - top_pos;
    UINT32 old_sel = cur_sel;
    UINT32 old_top = top_pos;
    UINT32 i;
    BOOL ret = TRUE;
	
    TEXT_FIELD* txt1;	
   TEXT_FIELD* txt2;	
	if (vact >= VACT_NUM_1 && vact<= VACT_NUM_9)
	{
        OSD_ChangeFocus((POBJECT_HEAD)&g_win_submenu, vact - VACT_NUM_0, C_UPDATE_FOCUS);
        return TRUE;
	}

	if(vact == VACT_FOCUS_P_UP || vact == VACT_FOCUS_P_DOWN)
	{
	    if (vact == VACT_FOCUS_P_UP)
	        ret = OSD_ScrollLinePgUp(count, depth, &top_pos, &cur_pos);
	    else
	        ret = OSD_ScrollLinePgDown(count, depth, &top_pos, &cur_pos);
	    if (!ret)
	        return FALSE;

	    cur_sel = top_pos + cur_pos;
	    if (cur_sel == old_sel)
	        return FALSE;
	    if (submenu_item_attr(sub_menu, cur_sel) == C_ATTR_ACTIVE)
		{
	        vact = VACT_PASS;
	    }
		else
		{
		    if (vact == VACT_FOCUS_P_UP)
		        vact = VACT_FOCUS_UP;
		    else
		        vact = VACT_FOCUS_DOWN;
		}
	}
	
	if(vact == VACT_FOCUS_UP || vact == VACT_FOCUS_DOWN)
	{
	    for (i = 0; i < count; i++)
	    {
	        if (vact == VACT_FOCUS_UP)
	            ret = OSD_ScrollLineUp(count, depth, &top_pos, &cur_pos);
	        else
	            ret = OSD_ScrollLineDown(count, depth, &top_pos, &cur_pos);
	        if (!ret)
	            return FALSE;

	        cur_sel = top_pos + cur_pos;
	        if (cur_sel == old_sel)
	            return FALSE;
	        if (submenu_item_attr(sub_menu, cur_sel) == C_ATTR_ACTIVE)
	            break;
	    }
    if (i == count)
        return FALSE;
	}

    if (cur_sel != old_sel)
    {
        sub_menu->list_top = top_pos;
        sub_menu->list_sel = cur_sel;
    	OSD_SetScrollBarPos(&subm_scrollbar, cur_sel);

        if (old_top == top_pos)
        {
            OSD_ChangeFocus((POBJECT_HEAD)&g_win_submenu, cur_pos + 1, C_DRAW_SIGN_EVN_FLG |C_UPDATE_FOCUS);
	/*	txt1 = submenu_txt[cur_pos];
		txt1->head.bFont = 2;
		txt2 = submenu_txt[old_sel];
		txt2->head.bFont = 0;	   
	*/
            OSD_DrawObject((POBJECT_HEAD)&subm_scrollbar, C_UPDATE_ALL);
        }
        else
        {
            submenu_set_one_page(sub_menu);

        	OSD_TrackObject((POBJECT_HEAD)&g_win_submenu, C_UPDATE_CONTENT);
        }
    }
    
    return TRUE;
}
Esempio n. 3
0
BOOL submenu_unknown_act(sub_menu_t *sub_menu, UINT32 vact)
{
    UINT32 count = sub_menu->item_count;
    UINT32 depth = sub_menu->list_page;
    UINT32 top_pos = sub_menu->list_top;
    UINT32 cur_sel = sub_menu->list_sel;
    UINT32 cur_pos = cur_sel - top_pos;
    UINT32 old_sel = cur_sel;
    UINT32 old_top = top_pos;
    UINT32 i;
    BOOL ret = TRUE;
#ifndef PREVIEW_SUBMENU  //-a by wangyang 
	if (vact >= VACT_NUM_1 && vact<= VACT_NUM_9)
	{
        OSD_ChangeFocus((POBJECT_HEAD)&g_win_submenu, vact - VACT_NUM_0, C_UPDATE_FOCUS);
        return TRUE;
	}

	if(vact == VACT_FOCUS_P_UP || vact == VACT_FOCUS_P_DOWN)
	{
	    if (vact == VACT_FOCUS_P_UP)
	        ret = OSD_ScrollLinePgUp(count, depth, &top_pos, &cur_pos);
	    else
	        ret = OSD_ScrollLinePgDown(count, depth, &top_pos, &cur_pos);
	    if (!ret)
	        return FALSE;

	    cur_sel = top_pos + cur_pos;
	    if (cur_sel == old_sel)
	        return FALSE;
	    if (submenu_item_attr(sub_menu, cur_sel) == C_ATTR_ACTIVE)
		{
	        vact = VACT_PASS;
	    }
		else
		{
		    if (vact == VACT_FOCUS_P_UP)
		        vact = VACT_FOCUS_UP;
		    else
		        vact = VACT_FOCUS_DOWN;
		}
	}
#endif	
	if(vact == VACT_FOCUS_UP || vact == VACT_FOCUS_DOWN)
	{
	    for (i = 0; i < count; i++)
	    {
	        if (vact == VACT_FOCUS_UP)
	            ret = OSD_ScrollLineUp(count, depth, &top_pos, &cur_pos);
	        else
	            ret = OSD_ScrollLineDown(count, depth, &top_pos, &cur_pos);
	        if (!ret)
	            return FALSE;

	        cur_sel = top_pos + cur_pos;
	        if (cur_sel == old_sel)
	            return FALSE;
	        if (submenu_item_attr(sub_menu, cur_sel) == C_ATTR_ACTIVE)
	            break;
	    }
    if (i == count)
        return FALSE;
	}

    if (cur_sel != old_sel)
    {
        sub_menu->list_top = top_pos;
        sub_menu->list_sel = cur_sel;
    	//OSD_SetScrollBarPos(&subm_scrollbar, cur_sel);

        if (old_top == top_pos)
        {
            OSD_ChangeFocus((POBJECT_HEAD)&g_win_submenu, cur_pos + 1, C_UPDATE_FOCUS);
        //    OSD_DrawObject((POBJECT_HEAD)&subm_scrollbar, C_UPDATE_ALL);
        }
        else
        {
            submenu_set_one_page(sub_menu);

        	OSD_TrackObject((POBJECT_HEAD)&g_win_submenu, C_UPDATE_CONTENT);
        }
    }
 #ifdef EXIT_KEY_EXIT_ALL_MENU
	if(vact == VACT_CLOSE_ALL_MENU)
 	{
	 exit_key_flag =TRUE;
 	OSD_ObjClose((POBJECT_HEAD)&g_win_submenu,C_CLOSE_CLRBACK_FLG);	
 		mm_leave_all_menu();
	//	ap_clear_all_menus();
	//	ap_exit_key_clear_all_menus();
	//		ap_send_msg(CTRL_MSG_SUBTYPE_CMD_ENTER_ROOT, (UINT32)&win_diag, TRUE);
	}
   #endif
    return TRUE;
}