static PRESULT game_state_callback(POBJECT_HEAD obj, VEVENT event, UINT32 param1, UINT32 param2) { unsigned char ascstr[6]; PRESULT ret = PROC_PASS; switch (event) { case EVN_PRE_DRAW: switch (obj->bID) { case 31: sprintf(ascstr, "%d", level); break; case 32: sprintf(ascstr, "%d", score1); break; case 33: sprintf(ascstr, "%d", score2); break; } ComAscStr2Uni(ascstr, str_value); if((get_game_id()==3)&&obj->bID!=31) { sprintf(ascstr,"%s"," "); ComAscStr2Uni(ascstr, str_value); } OSD_SetTextFieldStrPoint((PTEXT_FIELD)obj, str_value); } return ret; }
static void cti_win_initial() { char stringTemp[100]; char i=0; for(i=0;i<CIT_SUBMENU_ITEM_COUNT;i++) OSD_SetTextFieldStrPoint(pCTI_item_txt[i],display_strs[i]); memset(stringTemp,0,sizeof(stringTemp)); sprintf(stringTemp,"Card Information"); OSD_SetTextFieldContent(&cti_item_txt0, STRING_ANSI, (UINT32)stringTemp); memset(stringTemp,0,sizeof(stringTemp)); sprintf(stringTemp,"Maturity Rating"); OSD_SetTextFieldContent(&cti_item_txt1, STRING_ANSI, (UINT32)stringTemp); memset(stringTemp,0,sizeof(stringTemp)); sprintf(stringTemp,"Card PIN"); OSD_SetTextFieldContent(&cti_item_txt2, STRING_ANSI, (UINT32)stringTemp); memset(stringTemp,0,sizeof(stringTemp)); sprintf(stringTemp,"PPID Information"); OSD_SetTextFieldContent(&cti_item_txt3, STRING_ANSI, (UINT32)stringTemp); memset(stringTemp,0,sizeof(stringTemp)); sprintf(stringTemp,"Mail"); OSD_SetTextFieldContent(&cti_item_txt4, STRING_ANSI, (UINT32)stringTemp); memset(stringTemp,0,sizeof(stringTemp)); sprintf(stringTemp,"User View"); OSD_SetTextFieldContent(&cti_item_txt5, STRING_ANSI, (UINT32)stringTemp); }
static void MailDrawNum0() //对新邮件和邮件总数赋值 ---yuanlin { UINT8 *src; UINT8 tmp[6]={0,}; UINT8 num=GYCA_EMAIL_MAX_CNT;// ------yuanlin UINT16 strLen; OSD_RECT rc; TEXT_FIELD *txt; UINT8 total, newmail; txt = &mail_new; OSD_SetTextFieldStrPoint(txt, len_display_str); src = OSD_GetUnicodeString(RS_CTI_NEW_MAIL); ComUniStrCopyChar((UINT8*)len_display_str, src); strLen = ComUniStrLen(len_display_str); sprintf(tmp, " %d",email_count_unread ); ComAscStr2Uni(tmp, &len_display_str[strLen]); OSD_SetTextFieldContent(txt, STRING_UNICODE, (UINT32)len_display_str); OSD_DrawObject((POBJECT_HEAD)txt, C_UPDATE_ALL); OSD_SetTextFieldStrPoint(txt, NULL); txt = &mail_total; OSD_SetTextFieldStrPoint(txt, len_display_str); MEMSET(len_display_str, 0, sizeof(len_display_str)); MEMSET(tmp, 0, sizeof(tmp)); src = OSD_GetUnicodeString(RS_RESIDUAL_SPACE); ComUniStrCopyChar((UINT8*)len_display_str, src); strLen = ComUniStrLen(len_display_str); sprintf(tmp, " %d",num-email_count); ComAscStr2Uni(tmp, &len_display_str[strLen]); OSD_SetTextFieldContent(txt, STRING_UNICODE, (UINT32)len_display_str); OSD_DrawObject((POBJECT_HEAD)txt, C_UPDATE_ALL); OSD_SetTextFieldStrPoint(txt, NULL); }
static void cti_win_initial() { //char stringTemp[100]; char i=0; for(i=0;i<CIT_SUBMENU_ITEM_COUNT;i++) OSD_SetTextFieldStrPoint(pCTI_item_txt[i],NULL); OSD_SetTextFieldContent(&cti_item_txt0, STRING_ID, (UINT32)RS_CTI_SMC_INFO); OSD_SetTextFieldContent(&cti_item_txt1, STRING_ID, (UINT32)RS_CTI_MATURITY_RATING); OSD_SetTextFieldContent(&cti_item_txt2, STRING_ID, (UINT32)RS_CTI_MODIFY_PIN); OSD_SetTextFieldContent(&cti_item_txt3, STRING_ID, (UINT32)RS_CTI_PROVIDER_INFO); OSD_SetTextFieldContent(&cti_item_txt4, STRING_ID, (UINT32)RS_CTI_MAIL); OSD_SetTextFieldContent(&cti_item_txt5, STRING_ID, (UINT32)RS_CTI_USER_VIEW_CTRL); }
static PRESULT sudoku_state_callback(POBJECT_HEAD obj, VEVENT event, UINT32 param1, UINT32 param2) { unsigned char ascstr[6]; PRESULT ret = PROC_PASS; switch (event) { case EVN_PRE_DRAW: switch (obj->bID) { case 31: sprintf(ascstr, "%d", level); break; } ComAscStr2Uni(ascstr, str_value); OSD_SetTextFieldStrPoint((PTEXT_FIELD)obj, str_value); } return ret; }
void win_progname_draw_infor(void) { UINT16 group_name[MAX_SERVICE_NAME_LENGTH + 1 + 10]; UINT8 group_type,av_mode; UINT16 cur_channel; P_NODE p_node; S_NODE s_node; // T_NODE t_node; char string[100]; char prog_name[MAX_SERVICE_NAME_LENGTH + 1]; INT32 ret,len; UINT32 i,j; BITMAP* bmp; TEXT_FIELD* txt; UINT16 icon; date_time dt; prog_txt_t* p_prog_txt; prog_bmp_t* p_prog_bmp; eit_event_info_t *pe=NULL,*fe=NULL; UINT8 *s1=NULL,*s2=NULL; INT32 strlen; struct ACTIVE_SERVICE_INFO service; struct t_ttx_lang *ttx_lang_list; UINT8 ttx_lang_num; struct t_subt_lang* sub_lang_list; UINT8 sub_lang_num; bmp = &prog_bmp; txt = &prog_text; UINT32 fav_mask; fav_mask = 0; for(i=0;i<MAX_FAVGROUP_NUM;i++) fav_mask |= (0x01<<i); av_mode = sys_data_get_cur_chan_mode(); cur_channel = sys_data_get_cur_group_cur_mode_channel(); ret = get_prog_at(cur_channel,&p_node); get_sat_by_id(p_node.sat_id, &s_node); get_cur_group_name((char*)group_name,&group_type); get_local_time(&dt); /* #ifdef _EPG_MULTI_SERVICE #ifdef EPG_FAST_PARSE epg_fast_pasrse_set(FALSE,NULL,NULL); #endif get_tp_by_id(p_node.tp_id, &t_node); api_epg_parse(p_node.tp_id, t_node.network_id, t_node.t_s_id, p_node.prog_number, epg_type_pf); struct active_service_t service; service.tp_id = p_node.tp_id; service.orig_network_id = t_node.network_id; service.ts_id = t_node.t_s_id; service.service_id = p_node.prog_number; api_epg_set_active_service(&service, 1); api_epg_parse(p_node.tp_id, t_node.network_id, t_node.t_s_id, p_node.prog_number, epg_type_pf); #endif */ service.tp_id = p_node.tp_id; service.service_id = p_node.prog_number; epg_set_active_service(&service, 1); /*current next epg info */ pe=epg_get_cur_service_event((INT32)cur_channel, PRESENT_EVENT, NULL,NULL,NULL, /*event_update*/TRUE); fe=epg_get_cur_service_event((INT32)cur_channel, FOLLOWING_EVENT, NULL,NULL,NULL, event_update); if(event_update==FALSE) { if(pe==NULL || fe==NULL) { event_update = TRUE; } } else { if(pe!=NULL && fe!=NULL) { event_update = FALSE; } } s1=epg_get_event_name(pe, &len); // s1=(UINT8*)epg_get_event_name(pe, present_name, 32); s2=epg_get_event_name(fe, &len); // s2=(UINT8*)epg_get_event_name(fe, following_name, 32); TTXEng_GetInitLang(&ttx_lang_list, &ttx_lang_num); subt_get_language(&sub_lang_list ,&sub_lang_num); if(sub_lang_num == 0) TTXEng_GetSubtLang(&ttx_lang_list,&sub_lang_num); for(i=0;i<PROG_BMP_NUM;i++) { p_prog_bmp = &prog_bmps[i]; icon = INVALID_ID; switch(p_prog_bmp->bmp_type) { case PROG_BMP_STATIC: icon = prog_bmps[i].icon; break; #ifndef MODIFY_FOR_EGYPT_CUSTOMER case PROG_BMP_AV_TYPE: if(av_mode==TV_CHAN) icon = IM_INFO_BAR_TV; else icon = IM_INFO_BAR_RADIO; break; #endif case PROG_BMP_EPG: if( (s1||s2) ) icon = prog_bmps[i].icon; break; case PROG_BMP_TTX: if(ttx_lang_num>0) icon = prog_bmps[i].icon; break; case PROG_BMP_SUBT: if(sub_lang_num>0) icon = prog_bmps[i].icon; break; case PROG_BMP_LOCK: if(p_node.lock_flag) icon = prog_bmps[i].icon; break; case PROG_BMP_FAV: if(p_node.fav_group[0] & fav_mask) icon = prog_bmps[i].icon; break; case PROG_BMP_CA: { #if 0 BOOL b,bFlag; INT8 level,quality,lock; signal_lock_status lock_flag; signal_scramble_status scramble_flag; signal_lnbshort_status lnbshort_flag; signal_parentlock_status parrentlock_flag; bFlag = GetSignalStatus(&lock_flag, &scramble_flag,&lnbshort_flag,&parrentlock_flag); if(bFlag && lock_flag== SIGNAL_STATUS_LOCK && lnbshort_flag==SIGNAL_STATUS_LNBNORMAL && parrentlock_flag==SIGNAL_STATUS_PARENT_UNLOCK && scramble_flag == SIGNAL_STATUS_SCRAMBLED) icon = prog_bmps[i].icon; #else if(p_node.ca_mode) icon = prog_bmps[i].icon; #endif } break; default: break; } OSD_SetBitmapContent(bmp, icon); OSD_SetRect(&bmp->head.frame, p_prog_bmp->left, p_prog_bmp->top, p_prog_bmp->width,p_prog_bmp->height); OSD_DrawObject( (OBJECT_HEAD*) bmp, C_UPDATE_ALL); } for(i=0;i<PROG_TXT_NUM;i++) { p_prog_txt = &prog_txts[i]; string[0] = '\0'; switch(p_prog_txt->txt_type) { case PROG_TXT_PROG_NAME: #ifndef DB_USE_UNICODE_STRING STRCPY(prog_name,p_node.service_name); for(j=0;j<STRLEN(prog_name);j++) if(prog_name[j] >= 0x80) { prog_name[j] = '\0'; break; } if(p_node.ca_mode==0) sprintf(string,"%s(%s)",prog_name,s_node.sat_name); else sprintf(string,"$%s(%s)",prog_name,s_node.sat_name); #else if(p_node.ca_mode==0) STRCPY(string,""); else STRCPY(string,"$"); ComAscStr2Uni(string,len_display_str); strlen = ComUniStrLen( len_display_str); //strcpy_uni(&len_display_str[strlen],p_node.service_name); ComUniStrCopyChar((UINT8 * )&len_display_str[strlen],p_node.service_name); strlen = ComUniStrLen( len_display_str); ComAscStr2Uni("(",&len_display_str[strlen]); strlen = ComUniStrLen( len_display_str); ComUniStrCopyChar((UINT8 * )&len_display_str[strlen],s_node.sat_name); strlen = ComUniStrLen( len_display_str); ComAscStr2Uni(")",&len_display_str[strlen]); #endif break; case PROG_TXT_DATE: sprintf(string,"%02d/%02d",dt.month,dt.day); ComAscStr2Uni(string, (UINT16 *)len_display_str); break; case PROG_TXT_TIME: sprintf(string,"%02d:%02d",dt.hour,dt.min); ComAscStr2Uni(string, (UINT16 *)len_display_str); break; case PROG_TXT_PROG_NUM: sprintf(string,"%04d",cur_channel + 1); ComAscStr2Uni(string, (UINT16 *)len_display_str); break; case PROG_TXT_EPG_NOW: if (s1 ) { sprintf(string,"Now: "); ComAscStr2Uni(string, (UINT16 *)len_display_str); len =ComUniStrLen(len_display_str); ComUniStrCopyChar((UINT8*)&len_display_str[len],s1); } else { OSD_SetTextFieldStrPoint(txt,NULL); OSD_SetTextFieldContent(txt,STRING_ID,RS_EPG_NO_INFORMATION); } break; case PROG_TXT_EPG_NEXT: if (s2) { sprintf(string,"Next: "); ComAscStr2Uni(string, (UINT16 *)len_display_str); len =ComUniStrLen(len_display_str); ComUniStrCopyChar((UINT8*)&len_display_str[len],s2); } else { sprintf(string," "); ComAscStr2Uni(string, (UINT16 *)len_display_str); } break; case PROG_TXT_PROG_GROUP: #ifndef DB_USE_UNICODE_STRING sprintf(string,"%s",group_name); #else ComUniStrCopy(len_display_str, group_name); #endif break; default: ; } #ifndef DB_USE_UNICODE_STRING ComAscStr2Uni(string, (UINT16 *)len_display_str); #else /* if(p_prog_txt->txt_type != PROG_TXT_PROG_NAME && p_prog_txt->txt_type != PROG_TXT_PROG_GROUP &&p_prog_txt->txt_type != PROG_TXT_EPG_NOW &&p_prog_txt->txt_type != PROG_TXT_EPG_NEXT) ComAscStr2Uni(string, (UINT16 *)len_display_str); */ if(p_prog_txt->txt_type == PROG_TXT_PROG_NUM) txt->head.bFont = 2; else txt->head.bFont = 0; #endif OSD_SetRect(&txt->head.frame, p_prog_txt->left, p_prog_txt->top, p_prog_txt->width,p_prog_txt->height); //txt->pText = (UINT8*)len_display_str; txt->head.style.bShowIdx = p_prog_txt->shidx; OSD_DrawObject( (OBJECT_HEAD *)txt, C_UPDATE_ALL); OSD_SetTextFieldContent(txt,STRING_ID,0); OSD_SetTextFieldStrPoint(txt,len_display_str); } #ifdef MODIFY_FOR_EGYPT_CUSTOMER progname_signal_refresh(TRUE); #endif }
static void win_miscset_load_setting(void) { CONTAINER *win,*scditem,*lastitem; MULTISEL *msel; TEXT_FIELD *pTxt; SYSTEM_DATA* sys_data; POBJECT_HEAD pObj; BOOL beeper_flag,lnb_power_flag,chchg_video_flag; sys_data = sys_data_get(); /* LNB Power */ msel =&miscset_sel0; OSD_SetMultiselSel(msel, sys_data->bLNB_power); /* Change change channel type */ if(sys_data->chan_sw>=3) sys_data->chan_sw = 0; msel =&miscset_sel1; OSD_SetMultiselSel(msel, sys_data->chan_sw); /* Change change video type */ msel =&miscset_sel2; OSD_SetMultiselSel(msel, sys_data->chchgvideo_type); /* Beep */ msel =&miscset_sel3; OSD_SetMultiselSel(msel, sys_data->install_beep); win = &g_win_misc_setting; #if( SYS_LNB_POWER_OFF == SYS_FUNC_ON) lnb_power_flag = TRUE; #else lnb_power_flag = FALSE; #endif #ifdef CHANCHG_VIDEOTYPE_SUPPORT chchg_video_flag = TRUE; #else chchg_video_flag = FALSE; #endif #ifdef ANTENNA_INSTALL_BEEP beeper_flag = TRUE; #else beeper_flag = FALSE; #endif if(!lnb_power_flag) remove_menu_item(win, (OBJECT_HEAD *)misc_menu_items[LNBPOWER_ID - 1], CON_H + CON_GAP); if(!chchg_video_flag) remove_menu_item(win, (OBJECT_HEAD *)misc_menu_items[CHANCHG_VIDEO_ID - 1], CON_H + CON_GAP); if(!beeper_flag) remove_menu_item(win, (OBJECT_HEAD *)misc_menu_items[INSTALLBEEP_ID - 1], CON_H + CON_GAP); #ifndef RAM_TMS_TEST remove_menu_item(win, (OBJECT_HEAD *)&miscset_item5, CON_H + CON_GAP); #endif #if !defined(AUTOMATIC_STANDBY) remove_menu_item(win,(POBJECT_HEAD)&miscset_item3,CON_H + CON_GAP); #endif remove_menu_item(win,(POBJECT_HEAD)&miscset_item0,CON_H + CON_GAP); remove_menu_item(win,(POBJECT_HEAD)&miscset_item1,CON_H + CON_GAP); /*Disable/Endable auto standby*/ msel = &miscset_sel4; pTxt = &miscset_txt4; OSD_SetMultiselSel(msel,sys_data->auto_standby_en); OSD_SetTextFieldStrPoint(pTxt,display_strs[1]); // OSD_SetTextFieldContent(pTxt,STRING_ANSI,(UINT32)"Auto Standby"); OSD_SetTextFieldContent(pTxt, STRING_UNICODE,(UINT32)OSD_GetUnicodeString(RS_AUTO_STANDBY)); /* Disable/Endable ram timeshift */ #ifdef RAM_TMS_TEST msel = &miscset_sel5; pTxt = &miscset_txt5; OSD_SetMultiselSel(msel,sys_data->ram_tms_en); OSD_SetTextFieldStrPoint(pTxt,display_strs[2]); OSD_SetTextFieldContent(pTxt,STRING_ANSI,(UINT32)"RAM Timeshift"); #endif #ifdef ORDER_GZ1207009 msel = &miscset_sel6; pTxt = &miscset_txt6; OSD_SetMultiselSel(msel,sys_data->standbymode); OSD_SetTextFieldStrPoint(pTxt,display_strs[3]); // OSD_SetTextFieldContent(pTxt,STRING_ANSI,(UINT32)"Auto Standby"); OSD_SetTextFieldContent(pTxt, STRING_UNICODE,(UINT32)OSD_GetUnicodeString(RS_STANDBY_MODE)); #endif }
void find_init_keys(void) { //static UINT32 flag = 0; UINT32 i,row,col; UINT16 l0,w0,x,y,w,h; TEXT_FIELD *txt,*txto; UINT8 bID,bLeftID,bRightID,bUpID,bDownID; UINT8 ch; //if(flag) // return; l0 = w0 = 0; txto = &find_txt_char; OSD_SetColor(txto,KEY_1_TXT_SH_IDX,KEY_1_TXT_HL_IDX,KEY_1_TXT_SH_IDX,KEY_1_TXT_SH_IDX); for(i=0;i<KEY_CNT;i++) { txt = &find_txt_chars[i]; MEMCPY(txt,txto,sizeof(TEXT_FIELD)); row = i/KEY_COLS; col = i%KEY_COLS; if(col==0) { l0 = 0; w0 = 0; } if(key_chars[i] == ' ' || key_chars[i] ==0xFF) { w = KEY2_W; OSD_SetColor(txt,KEY_2_TXT_SH_IDX,KEY_2_TXT_HL_IDX,KEY_2_TXT_SH_IDX,KEY_2_TXT_SH_IDX); } else w = KEY1_W; h = KEY_H; x = W_L + KEY_L0 + l0; //if(w0) x += KEY_L_GAP; y = W_T + KEY_T0 + (KEY_H + KEY_T_GAP)*row; OSD_SetRect(&txt->head.frame, x, y, w, h); bID = i+1; #ifdef LEFT_RIGHT_ORDER if(i != 0) bLeftID = bID-1; else bLeftID = KEY_CNT; #else if(col == 0) bLeftID = (row + 1)*KEY_COLS; else bLeftID = bID-1; #endif if(bLeftID > KEY_CNT) bLeftID = KEY_CNT; #ifdef LEFT_RIGHT_ORDER if( i != (KEY_CNT - 1) ) bRightID = bID+1; else bRightID = 1; #else if(col == (KEY_COLS - 1) || i==(KEY_CNT - 1) ) bRightID = (row + 1)*KEY_COLS + 1; else bRightID = bID+1; #endif if(bRightID > KEY_CNT) bRightID = KEY_CNT; if(row == 0) { if(col == 0 || col == 1) bUpID = (KEY_ROWS - 1)*KEY_COLS + 1; else if(col==2 || col == 3) bUpID = (KEY_ROWS - 1)*KEY_COLS + col; else bUpID = KEY_CNT; } else if( row == (KEY_ROWS - 1) ) { if(col == 0) bUpID = (row -1)* KEY_COLS + 1; else if(col == 1 || col == 2) bUpID = (row - 1) * KEY_COLS + 2 + col; else bUpID = row * KEY_COLS; } else bUpID = (row - 1)* KEY_COLS + 1 + col; if(bUpID > KEY_CNT) bUpID = KEY_CNT; if(row == (KEY_ROWS - 2) ) { if(col == 0 || col == 1) bDownID = (KEY_ROWS - 1)*KEY_COLS + 1; else if(col == 2 || col == 3) bDownID = (KEY_ROWS - 1)*KEY_COLS + col; else bDownID = (KEY_ROWS - 1)*KEY_COLS + 4; } else if(row == (KEY_ROWS - 1) ) { if(col == 0) bDownID = 1; else if(col == 1 || col == 2) bDownID = col + 2; else bDownID = KEY_COLS; } else bDownID = (row + 1)*KEY_COLS + 1 + col; if(bDownID > KEY_CNT) bDownID = KEY_CNT; OSD_SetID(txt, bID, bLeftID, bRightID, bUpID, bDownID); //soc_printf("%d,%d,%d,%d,%d\n",bID, bLeftID, bRightID, bUpID, bDownID); OSD_SetTextFieldStrPoint(txt, &display_strs[row][5*col]); if(i != KEY_CNT - 1) OSD_SetObjpNext(txt, &find_txt_chars[i+1]); else OSD_SetObjpNext(txt,NULL); l0 += (w + KEY_L_GAP); w0 = w; } //flag = 1; }
void win_timerlist_loadsetting(void) { SYSTEM_DATA* sys_data; TIMER_SET_CONTENT* timer; INT32 i; CONTAINER* con; TEXT_FIELD* txt; UINT16* pstr; char str[30]; UINT16 strID; P_NODE p_node; sys_data = sys_data_get(); for(i=0;i < MAX_TIMER_NUM;i++) { LOAD_ONE_TIMER: timer = &sys_data->timer_set.TimerContent[i]; con = timers_conts[i]; pstr = display_strs[2*i]; /*Number */ txt = (TEXT_FIELD*)OSD_GetContainerNextObj(con); OSD_SetTextFieldStrPoint(txt,pstr); OSD_SetTextFieldContent(txt, STRING_NUMBER, i+1); pstr += 3; /*Mode */ txt = (TEXT_FIELD*)OSD_GetObjpNext(txt); strID = TimerModeStr_id[timer->timer_mode]; OSD_SetTextFieldContent(txt, STRING_ID,(UINT32)strID); /*Service */ txt = (TEXT_FIELD*)OSD_GetObjpNext(txt); if(timer->timer_mode!= TIMER_MODE_OFF) strID = TimerServiceStr_id[timer->timer_service]; else strID = 0; OSD_SetTextFieldContent(txt, STRING_ID,(UINT32)strID); /*Content */ strID = 0; txt = (TEXT_FIELD*)OSD_GetObjpNext(txt); if(timer->timer_mode!= TIMER_MODE_OFF) { if(timer->timer_service == TIMER_SERVICE_MESSAGE) { strID = WakeupMessageStr_id[timer->wakeup_message]; pstr = NULL; } else { if(get_prog_by_id(timer->wakeup_channel,&p_node) == DB_SUCCES) { if(p_node.ca_mode) ComAscStr2Uni("$", pstr); ComUniStrCopyChar((UINT8*)&pstr[p_node.ca_mode], p_node.service_name); } else { /* When the specified channel not exit, turn off the timer */ timer->timer_mode = TIMER_MODE_OFF; pstr = NULL; goto LOAD_ONE_TIMER; } } } else pstr = NULL; OSD_SetTextFieldStrPoint(txt,pstr); OSD_SetTextFieldContent(txt, STRING_ID,(UINT32)strID); pstr = display_strs[2*i + 1]; /*Date&Time*/ txt = (TEXT_FIELD*)OSD_GetObjpNext(txt); str[0] = '\0'; if(timer->timer_mode!= TIMER_MODE_OFF) sprintf(str,"%02d/%02d/%04d %02d:%02d", timer->wakeup_month,timer->wakeup_day,timer->wakeup_year, timer->wakeup_time/60,timer->wakeup_time%60); OSD_SetTextFieldStrPoint(txt,pstr); OSD_SetTextFieldContent(txt, STRING_ANSI,(UINT32)str); pstr += 20; /*Duration*/ txt = (TEXT_FIELD*)OSD_GetObjpNext(txt); str[0] = '\0'; if(timer->timer_mode!= TIMER_MODE_OFF && (timer->timer_service == TIMER_SERVICE_CHANNEL #ifdef DVR_PVR_SUPPORT || timer->timer_service == TIMER_SERVICE_DVR_RECORD #endif ) ) sprintf(str,"%02d:%02d",timer->wakeup_duration_time/60,timer->wakeup_duration_time%60); ComAscStr2Uni(str, pstr); OSD_SetTextFieldStrPoint(txt,pstr); OSD_SetTextFieldContent(txt, STRING_ANSI,(UINT32)str); } #if 0 sys_data_set_cur_chan_mode(cur_chan_mode); recreate_prog_view(VIEW_ALL | cur_chan_mode,0); #endif }
void wifi_password_init_keys(void) { UINT32 i,row,col; UINT16 l0,w0,x,y,w,h; TEXT_FIELD *txt,*txto; UINT8 bID,bLeftID,bRightID,bUpID,bDownID; UINT8 ch; l0 = w0 = 0; txto = &wifi_password_txt_char; OSD_SetColor(txto,KEY_1_TXT_SH_IDX,KEY_1_TXT_HL_IDX,KEY_1_TXT_SH_IDX,KEY_1_TXT_SH_IDX); for(i=0;i<KEY_CNT;i++) { txt = &wifi_password_txt_chars[i]; MEMCPY(txt,txto,sizeof(TEXT_FIELD)); row = i/KEY_COLS; col = i%KEY_COLS; if(col==0) { l0 = 0; w0 = 0; } if(wifi_password_key_chars[i] == ' ' || wifi_password_key_chars[i] ==0xFF) { w = KEY2_W; OSD_SetColor(txt,KEY_2_TXT_SH_IDX,KEY_2_TXT_HL_IDX,KEY_2_TXT_SH_IDX,KEY_2_TXT_SH_IDX); } else { w = KEY1_W; } h = KEY_H; x = W_L + KEY_L0 + l0; //if(w0) x += KEY_L_GAP; y = W_T + KEY_T0 + (KEY_H + KEY_T_GAP)*row; OSD_SetRect(&txt->head.frame, x, y, w, h); bID = i+1; #ifdef LEFT_RIGHT_ORDER if(i != 0) { bLeftID = bID-1; } else { bLeftID = KEY_CNT; } #else if(col == 0) { bLeftID = (row + 1)*KEY_COLS; } else { bLeftID = bID-1; } #endif if(bLeftID > KEY_CNT) { bLeftID = KEY_CNT; } #ifdef LEFT_RIGHT_ORDER if( i != (KEY_CNT - 1) ) { bRightID = bID+1; } else { bRightID = 1; } #else if(col == (KEY_COLS - 1) || i==(KEY_CNT - 1) ) { bRightID = (row + 1)*KEY_COLS + 1; } else { bRightID = bID+1; } #endif if(bRightID > KEY_CNT) { bRightID = KEY_CNT; } if(row == 0) { if(col == 0 || col == 1) { bUpID = (KEY_ROWS - 1)*KEY_COLS + 1; } else if(col==2 || col == 3) { bUpID = (KEY_ROWS - 1)*KEY_COLS + col; } else { bUpID = KEY_CNT; } } else if( row == (KEY_ROWS - 1) ) { if(col == 0) { bUpID = (row -1)* KEY_COLS + 1; } else if(col == 1 || col == 2) { bUpID = (row - 1) * KEY_COLS + 2 + col; } else { bUpID = row * KEY_COLS; } } else { bUpID = (row - 1)* KEY_COLS + 1 + col; } if(bUpID > KEY_CNT) { bUpID = KEY_CNT; } if(row == (KEY_ROWS - 2) ) { if(col == 0 || col == 1) { bDownID = (KEY_ROWS - 1)*KEY_COLS + 1; } else if(col == 2 || col == 3) { bDownID = (KEY_ROWS - 1)*KEY_COLS + col; } else { bDownID = (KEY_ROWS - 1)*KEY_COLS + 4; } } else if(row == (KEY_ROWS - 1) ) { if(col == 0) { bDownID = 1; } else if(col == 1 || col == 2) { bDownID = col + 2; } else { bDownID = KEY_COLS; } } else bDownID = (row + 1)*KEY_COLS + 1 + col; if(bDownID > KEY_CNT) { bDownID = KEY_CNT; } OSD_SetID(txt, bID, bLeftID, bRightID, bUpID, bDownID); OSD_SetTextFieldStrPoint(txt, &display_strs[row][5*col]); if(i != KEY_CNT - 1) { OSD_SetObjpNext(txt, &wifi_password_txt_chars[i+1]); } else { OSD_SetObjpNext(txt,NULL); } l0 += (w + KEY_L_GAP); w0 = w; } }
/*qjzheng ,2010.7.15 未完成,只支持输入数字*/ BOOL win_input_open(char *title, UINT32 input_type) { char ch; UINT32 hkey,vkey; UINT32* exit_pwd_keys; UINT32 exit_pwd_keycnt; UINT32 i,vscr_idx; UINT32 pwd_u32; BOOL ret = TRUE; struct OSDRect* frame; POBJECT_HEAD win; POBJECT_HEAD pObj; CONTAINER* con; BOOL old_value = ap_enable_key_task_get_key(TRUE); con = &win_input_con; if(!api_is_sd_color_mode()) { #if 0 pObj = (POBJECT_HEAD)&win_input_con; OSD_SetColor(pObj,WIN_SH_IDX,WIN_SH_IDX,0,0); pObj = (POBJECT_HEAD)&win_input_title; OSD_SetColor(pObj, TITLE_SH_IDX,TITLE_SH_IDX,TITLE_SH_IDX,TITLE_SH_IDX); pObj = (POBJECT_HEAD)&win_input_char; OSD_SetColor(pObj, CHAR_SH_IDX,CHAR_HL_IDX,CHAR_SH_IDX,CHAR_SH_IDX); #endif } else if(api_is_sd_color_mode()) { pObj = (POBJECT_HEAD)&win_input_con; OSD_SetColor(pObj,WIN_SH_IDX_SD,WIN_SH_IDX_SD,0,0); pObj = (POBJECT_HEAD)&win_input_title; OSD_SetColor(pObj, TITLE_SH_IDX_SD,TITLE_SH_IDX_SD,TITLE_SH_IDX_SD,TITLE_SH_IDX_SD); pObj = (POBJECT_HEAD)&win_input_char; OSD_SetColor(pObj, CHAR_SH_IDX_SD,CHAR_HL_IDX_SD,CHAR_SH_IDX_SD,CHAR_SH_IDX_SD); } //win_input_con.head.frame.uHeight=W_H; //win_input_title.wStringID=RS_SYSTME_PARENTAL_LOCK_INPUT_PASSWORD; if(title!=NULL) { OSD_SetTextFieldStrPoint(&win_input_title,display_strs[0]); OSD_SetTextFieldContent(&win_input_title,STRING_ANSI,(UINT32)title); } else { OSD_SetTextFieldStrPoint(&win_input_title,NULL); OSD_SetTextFieldContent(&win_input_title,STRING_ID,RS_SYSTME_PARENTAL_LOCK_INPUT_PASSWORD); } exit_pwd_keys = default_key_exit; exit_pwd_keycnt = sizeof(default_key_exit)/sizeof(default_key_exit[0]); win = (POBJECT_HEAD)&win_input_con; /* Start to try to save backgrand */ wincom_backup_region(&win->frame); /* End of try to save backgrand */ input_char_cnt = 0; OSD_DrawObject(win, C_UPDATE_ALL); win_input_draw_chars(); while(1) { hkey = ap_get_key_msg(); if(hkey == INVALID_HK || hkey == INVALID_MSG) continue; ap_hk_to_vk(0, hkey, &vkey); for(i=0;i<exit_pwd_keycnt;i++) { if(vkey == exit_pwd_keys[i]) { ret = FALSE; goto EXIT; } } if(vkey<=V_KEY_9) { ch = (char)('0' + (vkey - V_KEY_0)); if(input_char_cnt < input_length) { input_chars[input_char_cnt] = ch; input_char_cnt ++; } win_input_draw_chars(); if(input_char_cnt == input_length) { ret = TRUE; goto EXIT; } } else if(vkey==V_KEY_LEFT) { if(input_char_cnt) { input_char_cnt--; win_input_draw_chars(); } } }; EXIT: wincom_restore_region(); if((!ret) && ((vkey != V_KEY_EXIT) && (vkey != V_KEY_MENU))) { ap_send_msg(CTRL_MSG_SUBTYPE_KEY, hkey, FALSE);/*if exit key got,repatch the messages again*/ } ap_enable_key_task_get_key(old_value); return ret; }