static PRESULT win_sat_edit_name(POBJECT_HEAD pobj) { EDIT_FIELD *eft; UINT32 sat_longitude; UINT8* new_name; UINT16 uni_name[50]; UINT32 value; eft = &sate_edt2; sat_longitude = OSD_GetEditFieldContent(eft);//backup the content eft = &sate_edt1; value =OSD_GetEditFieldContent(eft); ComUniStrCopy(uni_name, (UINT16 *)value); #ifndef KEYBOARD_SUPPORT if(win_rename_open(uni_name,&new_name,NULL)) #else if(win_keyboard_rename_open(uni_name,&new_name,NULL)) #endif { ComUniStrCopy(uni_name,new_name); OSD_SetEditFieldContent(eft, STRING_UNICODE, (UINT32)uni_name); } eft = &sate_edt2; OSD_SetEditFieldContent(eft, STRING_NUMBER, sat_longitude);//fill the backup content eft = &sate_edt1; OSD_TrackObject((POBJECT_HEAD)eft, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL); }
static void win_tpe_load_setting(void) { EDIT_FIELD *edf; MULTISEL *msel; T_NODE t_node; edit_tp_ok = 0; edit_tp_exist = 0; if(edit_tp_mode == EDIT_TP_MODE_EDIT) get_tp_by_id(edit_tp_id, &t_node); else { t_node.frq = 3000; t_node.sym = 1000; t_node.pol = 0; } edf = &tpe_edt1; OSD_SetEditFieldSuffix(edf, STRING_ANSI, (UINT32)" MHz"); OSD_SetEditFieldContent(edf, STRING_NUMBER, t_node.frq); OSD_SetEditFieldStyle(edf,NORMAL_EDIT_MODE | SELECT_STATUS); edf = &tpe_edt2; OSD_SetEditFieldSuffix(edf, STRING_ANSI, (UINT32)" KS/s"); OSD_SetEditFieldContent(edf, STRING_NUMBER, t_node.sym); OSD_SetEditFieldStyle(edf,NORMAL_EDIT_MODE | SELECT_STATUS); msel = &tpe_msel3; OSD_SetMultiselSel(msel, t_node.pol); OSD_SetEditFieldStyle(edf,NORMAL_EDIT_MODE | SELECT_STATUS); }
void win_timer_load(TIMER_SET_CONTENT *settimer) { MULTISEL *msel; EDIT_FIELD *edf; TEXT_FIELD *txt; P_NODE p_node; UINT16 ch_idx, ch_cnt; UINT32 value; UINT8 action; win_timerset_set_currenttime(FALSE); /* TIMER_MODE*/ msel = &timer_msel_mode; if (settimer->timer_mode >= OSD_GetMultiselCount(msel)) settimer->timer_mode = TIMER_MODE_OFF; OSD_SetMultiselSel(msel, settimer->timer_mode); /* TIMER_SERVICE */ msel = &timer_msel_servicetype; if (settimer->timer_service >= OSD_GetMultiselCount(msel)) settimer->timer_service = 0; OSD_SetMultiselSel(msel, settimer->timer_service); /* TIMER service information: message or channel */ txt = &timer_txt_serviceinfo; OSD_SetTextFieldContent(txt, STRING_ID, (UINT32)TimerServiceTxtStr_id[settimer->timer_service]); win_timerset_timerservice_change(FALSE); edf = &timer_edf_wakeupdate; value = settimer->wakeup_year *10000+settimer->wakeup_month *100+settimer->wakeup_day; OSD_SetEditFieldContent(edf, STRING_NUMBER, value); edf = &timer_edf_wakeuptime; value = (settimer->wakeup_time / 3600) *10000+((settimer->wakeup_time / 60) % 60)*100 + settimer->wakeup_time%60; timerSec = settimer->wakeup_time % 60; OSD_SetEditFieldContent(edf, STRING_NUMBER, value); edf = &timer_edf_duration; value = settimer->wakeup_duration_time / 3600 * 10000 + (settimer->wakeup_duration_time/60%60)*100 + settimer->wakeup_duration_time%60; OSD_SetEditFieldContent(edf, STRING_NUMBER, value); win_timerset_timermode_change(FALSE); }
static PRESULT win_newcamd_input(POBJECT_HEAD pobj) { EDIT_FIELD *eft; UINT8* new_name; UINT16 uni_name[50]; UINT32 value; eft = (EDIT_FIELD*)pobj; value =OSD_GetEditFieldContent(eft); ComUniStrCopy(uni_name, (UINT16 *)value); #ifndef KEYBOARD_SUPPORT if(win_rename_open(uni_name,&new_name,NULL)) #else if(win_keyboard_rename_open(uni_name,&new_name,NULL)) #endif { ComUniStrCopy(uni_name,new_name); OSD_SetEditFieldContent(eft, STRING_UNICODE, (UINT32)uni_name); } OSD_TrackObject((POBJECT_HEAD)eft, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL); }
UINT8 win_map_search_input_menu_open(char *string) { CONTAINER *win; PRESULT ret = PROC_LOOP; UINT32 hkey; TEXT_FIELD *txt; EDIT_FIELD *eft; UINT16 strID; UINT32 value = 0; UINT8 input_string[MAP_SEARCH_INPUT_LEN]; BOOL old_value = ap_enable_key_task_get_key(TRUE); bMapSearchInputOK = FALSE; txt = &txt_map_search_input_title; strID = RS_HELP_SEARCH; OSD_SetTextFieldContent(txt, STRING_ID,(UINT32)strID); eft = &edt_map_search_input_item; OSD_SetEditFieldContent(eft, STRING_ANSI, ""); win = &g_win_map_search_input; OSD_SetContainerFocus(win, 1); OSD_SetTextFieldContent(&txt_map_search_input_caps,STRING_ANSI,(UINT32)btn_txt_strs[0]); OSD_SetTextFieldContent(&txt_map_search_input_del,STRING_ANSI,(UINT32)btn_txt_strs[1]); OSD_SetTextFieldContent(&txt_map_search_input_ok,STRING_ANSI,(UINT32)btn_txt_strs[2]); OSD_SetTextFieldContent(&txt_map_search_input_cancel,STRING_ANSI,(UINT32)btn_txt_strs[3]); wincom_backup_region(&(win->head.frame)); OSD_ObjOpen((POBJECT_HEAD)win, 0); while(ret != PROC_LEAVE) { hkey = ap_get_key_msg(); if(hkey == INVALID_HK || hkey == INVALID_MSG) continue; ret = OSD_ObjProc((POBJECT_HEAD)win, (MSG_TYPE_KEY<<16),hkey, 0); } if (bMapSearchInputOK) { eft = &edt_map_search_input_item; value = OSD_GetEditFieldContent(eft); ComUniStrToAsc((UINT8 *)value, input_string); map_search_input_get_string(string, input_string); } wincom_restore_region(); ap_enable_key_task_get_key(old_value); return bMapSearchInputOK; }
static void localset_init() { get_local_ip_cfg(&net_local_cfg); // libc_printf("start dhcp: %d\n", net_local_cfg.dhcp_on); OSD_SetMultiselSel(&localset_item_dhcp, net_local_cfg.dhcp_on); localset_hdcp_on(FALSE, net_local_cfg.dhcp_on); OSD_SetEditFieldContent(&localset_item_ip_addr, STRING_NUMBER, ntohl(net_local_cfg.ip_addr)); OSD_SetEditFieldContent(&localset_item_subnet_mask, STRING_NUMBER, ntohl(net_local_cfg.subnet_mask)); OSD_SetEditFieldContent(&localset_item_gateway, STRING_NUMBER, ntohl(net_local_cfg.gateway)); OSD_SetEditFieldContent(&localset_item_dns1, STRING_NUMBER, ntohl(net_local_cfg.dns)); OSD_SetEditFieldContent(&localset_item_dns2, STRING_NUMBER, ntohl(net_local_cfg.dns2)); }
void win_otaset_load_FreqSymbPid_display(void) { EDIT_FIELD* edf; MULTISEL* msel; edf = &wota_num2; OSD_SetEditFieldContent(edf, STRING_NUMBER, (UINT32)ota_freq); edf = & wota_num3; OSD_SetEditFieldContent(edf, STRING_NUMBER, (UINT32)ota_symb); edf = &wota_num5; OSD_SetEditFieldContent(edf, STRING_NUMBER, (UINT32)ota_pid); msel = &wota_num4; OSD_SetMultiselSel(msel, ota_pol);
BOOL win_keyboard_rename_open(UINT16* set_name,UINT8** ret_name,check_name_func check_func ) { UINT16 strID; UINT32 hkey; PRESULT ret; TEXT_FIELD *txt; EDIT_FIELD *edf; CONTAINER *win; win = &g_win_find; wincom_backup_region(&win->head.frame); set_color_style(); BOOL old_value = ap_enable_key_task_get_key(TRUE); strID = RS_HELP_RENAME; win_keyboard_set_title(strID); name_valid_func = check_func; check_ok = FALSE; #ifndef KEYBOARD_SUPPORT edf = &find_edt1; MEMSET(input_name_str,0,sizeof(input_name_str)); OSD_SetEditFieldContent(edf, STRING_UNICODE, (UINT32)set_name); #else txt = &find_input; MEMSET(input_name_str,0,sizeof(input_name_str)); OSD_SetTextFieldContent(txt, STRING_UNICODE,(UINT32)set_name); #endif win = &g_win_find; set_keyboard_flag(TRUE); find_init_keys(); find_set_key_display(); ret = OSD_ObjOpen((POBJECT_HEAD)win, 0); while(ret != PROC_LEAVE) { hkey = ap_get_key_msg(); if(hkey == INVALID_HK || hkey == INVALID_MSG) continue; ret = OSD_ObjProc((POBJECT_HEAD)win, (MSG_TYPE_KEY<<16),hkey, 0); } if(check_ok) { *ret_name = (UINT8*)input_name_str; } else { *ret_name = NULL; } set_keyboard_flag(FALSE); wincom_restore_region(); ap_enable_key_task_get_key(old_value); return (check_ok); }
static void localset_display(void) { int j = 0; // struct net_device *dev; libnet_get_ipconfig(&net_local_cfg); OSD_SetEditFieldContent(&localset_item_ip_addr, STRING_NUMBER, ntohl(net_local_cfg.ip_addr)); OSD_SetEditFieldContent(&localset_item_subnet_mask, STRING_NUMBER, ntohl(net_local_cfg.subnet_mask)); OSD_SetEditFieldContent(&localset_item_gateway, STRING_NUMBER, ntohl(net_local_cfg.gateway)); OSD_SetEditFieldContent(&localset_item_dns1, STRING_NUMBER, ntohl(net_local_cfg.dns)); OSD_SetEditFieldContent(&localset_item_dns2, STRING_NUMBER, ntohl(net_local_cfg.dns2)); for( j = 0; j < ARRAY_SIZE(localset_cons); j++) { OSD_DrawObject( (POBJECT_HEAD)localset_cons[j], C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL); } }
void nc_change_domain_ip(BOOL update) { char strTemp[100]; UINT8 idx = current_index-1; if(newcamd_serinfo[idx].use_ip_domain==0) { newcamd_serinfo[idx].use_ip_domain=1; memset(strTemp,0,sizeof(strTemp)); sprintf(strTemp,"Server Domain"); OSD_SetTextFieldContent(&nc_item_txt2, STRING_ANSI, (UINT32)strTemp); memset(strTemp,0,sizeof(strTemp)); sprintf(strTemp,"%s",newcamd_serinfo[idx].domain); #if defined(ORDER_GZ1006005)||defined(ORDER_GZ1006006) OSD_SetEditFieldPattern(&nc_item_edit2,string2_pat); #else OSD_SetEditFieldPattern(&nc_item_edit2,string_pat); #endif OSD_SetEditFieldContent(&nc_item_edit2, STRING_ANSI, (UINT32)strTemp); } else { newcamd_serinfo[idx].use_ip_domain=0; memset(strTemp,0,sizeof(strTemp)); sprintf(strTemp,"Server IP"); OSD_SetTextFieldContent(&nc_item_txt2, STRING_ANSI, (UINT32)strTemp); OSD_SetEditFieldPattern(&nc_item_edit2,ip_pat); OSD_SetEditFieldContent(&nc_item_edit2, STRING_NUMBER, ntohl(newcamd_serinfo[idx].ip)); } if(update) { OSD_TrackObject( (POBJECT_HEAD)&nc_item_con2, C_UPDATE_ALL); } }
static void nc_serinfo_display(UINT8 seridx,BOOL update) { char strTemp[100],str2[20]; UINT8 idx = seridx-1, i=0; UINT8 action; //memset(strTemp,0,sizeof(strTemp)); //sprintf(strTemp,"%s",newcamd_serinfo[idx].name); //OSD_SetEditFieldContent(&nc_item_edit1, STRING_ANSI, (UINT32)strTemp); memset(strTemp,0,sizeof(strTemp)); if(newcamd_serinfo[idx].use_ip_domain==1) { sprintf(strTemp,"%s",newcamd_serinfo[idx].domain); OSD_SetEditFieldPattern(&nc_item_edit2,string_pat); OSD_SetEditFieldContent(&nc_item_edit2, STRING_ANSI, (UINT32)strTemp); } else { OSD_SetEditFieldPattern(&nc_item_edit2,ip_pat); OSD_SetEditFieldContent(&nc_item_edit2, STRING_NUMBER, ntohl(newcamd_serinfo[idx].ip)); } memset(strTemp,0,sizeof(strTemp)); OSD_SetEditFieldContent(&nc_item_edit3, STRING_NUMBER, (UINT32)(newcamd_serinfo[idx].port)); memset(strTemp,0,sizeof(strTemp)); sprintf(strTemp,"%s",newcamd_serinfo[idx].username); OSD_SetEditFieldContent(&nc_item_edit4, STRING_ANSI, (UINT32)strTemp); memset(strTemp,0,sizeof(strTemp)); sprintf(strTemp,"%s",newcamd_serinfo[idx].userpwd); OSD_SetEditFieldContent(&nc_item_edit5, STRING_ANSI, (UINT32)strTemp); memset(strTemp,0,sizeof(strTemp)); sprintf(strTemp,"%02X",newcamd_serinfo[idx].deskey[0]); for(i=1;i<DESKEY_LENTH;i++) { memset(str2,0,sizeof(str2)); if((i*2)%(SEPERATE_MODE)==0) sprintf(str2,"%c%02X",seperate_ch[SEPERATE_CH],newcamd_serinfo[idx].deskey[i]); else sprintf(str2,"%02X",newcamd_serinfo[idx].deskey[i]); strcat(strTemp,str2); } OSD_SetEditFieldContent(&nc_item_edit6, STRING_ANSI, (UINT32)strTemp); nc_item_sel_active(newcamd_serinfo[idx].bActive,newcamd_serinfo[current_index-1].bAutouser,FALSE); nc_item_sel_DNSenable(newcamd_serinfo[idx].bDNS_enable,FALSE); //nc_item_sel_autouser(newcamd_serinfo[idx].bActive,newcamd_serinfo[idx].bAutouser,FALSE); if(update) { nc_redraw_items(); } }
static PRESULT tpsrch_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2) { PRESULT ret = PROC_PASS; UINT16 crn; static BOOL bFirstTime = TRUE; switch(event) { case EVN_PRE_OPEN: if(bFirstTime) { win_tpsrch_mode_init(); bFirstTime = FALSE; } #ifdef PID_SEARCH_SUPPORT crn = OSD_GetMultiselSel(&tpsrch_sel0); win_tpsrch_mode_switch(crn,FALSE); OSD_SetEditFieldContent(&tpsrch_edt1,STRING_NUMBER,8190); OSD_SetEditFieldContent(&tpsrch_edt2,STRING_NUMBER,8190); OSD_SetEditFieldContent(&tpsrch_edt3,STRING_NUMBER,8190); #endif break; case EVN_POST_OPEN: break; case EVN_PRE_CLOSE: /* Make OSD not flickering */ *((UINT32*)param2) &= ~C_CLOSE_CLRBACK_FLG; break; case EVN_POST_CLOSE: break; } return ret; }
static void nc_serinfo_display(UINT8 seridx,BOOL update) { char strTemp[100],str2[20]; UINT8 idx = seridx-1, i=0; UINT8 action; memset(strTemp,0,sizeof(strTemp)); if(CccamNewcamdData.spidercam[0]>='0'&&CccamNewcamdData.spidercam[0]<='9') sprintf(strTemp,"%c",CccamNewcamdData.spidercam[0]); else sprintf(strTemp,"%c",'0'); for(i=1;i<SP_LENTH;i++) { memset(str2,0,sizeof(str2)); if((i*2)%(SEPERATE_MODE)==0) { #if defined(ORDER_GZ1204004)||defined(ORDER_GZ1204005) if(CccamNewcamdData.spidercam[i]>='0'&&CccamNewcamdData.spidercam[i]<='9') sprintf(str2,"%c",CccamNewcamdData.spidercam[i]); else sprintf(str2,"%c",'0'); #else if(CccamNewcamdData.spidercam[i]>='0'&&CccamNewcamdData.spidercam[i]<='9') sprintf(str2,"%c%c",seperate_ch[SEPERATE_CH],CccamNewcamdData.spidercam[i]); else sprintf(str2,"%c%c",seperate_ch[SEPERATE_CH],'0'); #endif } else { if(CccamNewcamdData.spidercam[i]>='0'&&CccamNewcamdData.spidercam[i]<='9') sprintf(str2,"%c",CccamNewcamdData.spidercam[i]); else sprintf(str2,"%c",'0'); } strcat(strTemp,str2); } OSD_SetEditFieldContent(&sp_item_edit6, STRING_ANSI, (UINT32)strTemp); //sp_item_sel_active(newcamd_serinfo[idx].bActive,newcamd_serinfo[current_index-1].bAutouser,FALSE); }
void win_otaset_load_FreqSymbPid_display(void) { EDIT_FIELD* edf; MULTISEL* msel; UINT16 freq_def, symb_def; UINT8 dot_pos; int sel; /* FREQ */ edf = &wota_num2; wincom_mbs_to_i_with_dot(otaset_display_strs[0], &freq_def, &dot_pos); if(freq_def==0) wincom_i_to_mbs_with_dot(otaset_display_strs[0], ota_freq, DVBC_OTA_EDIT_LEN - 1/*without dot*/, 0x02/*xxx.xx*/); OSD_SetEditFieldSuffix(edf, STRING_ANSI, (UINT32)" MHz"); OSD_SetEditFieldStyle(edf,NORMAL_EDIT_MODE | SELECT_STATUS); //OSD_SetEditFieldContent(edf, STRING_NUMBER, (UINT32)ota_freq); /* SYMBOL */ edf = & wota_num3; OSD_SetEditFieldSuffix(edf, STRING_ANSI, (UINT32)" KBps"); wincom_i_to_mbs(otaset_display_strs[1], ota_symb, DVBC_OTA_EDIT_LEN - 1); OSD_SetEditFieldStyle(edf,NORMAL_EDIT_MODE | SELECT_STATUS); //OSD_SetEditFieldContent(edf, STRING_NUMBER, (UINT32)ota_symb); /* QAM */ msel = &wota_num4; sel = ota_modulation - QAM16; sel = sel > 0 ? sel : 0; OSD_SetMultiselSel(msel, sel); /* PID */ edf = &wota_num5; OSD_SetEditFieldContent(edf, STRING_NUMBER, (UINT32)ota_pid);
static void win_atnsetm_load_motor_antenna_setting(BOOL update) { MULTISEL* msel; EDIT_FIELD* edf; CONTAINER* item; SYSTEM_DATA* sys_data; antenna_t* pAntenna; Usals_Local* pLocal; UINT32 val = 0; sys_data = sys_data_get(); pAntenna = &sys_data->tuner_lnb_antenna[antset_cur_tuner]; pLocal = &sys_data->local; val = pLocal->local_longitude & 0x7FFF; if(val>18000) pLocal->local_longitude = 0; val = pLocal->local_latitude & 0x7FFF; if(val>9000) pLocal->local_latitude = 0; /* LNB type */ msel = anesetm_msels[LNB_ID - 1]; OSD_SetMultiselCount(msel, get_lnb_type_cnt()); val = get_lnb_type_index(pAntenna->lnb_type,pAntenna->lnb_low,pAntenna->lnb_high); if(val >= get_lnb_type_cnt()) val = 0; msel->nSel = val; item = anesetm_items[LNB_ID - 1]; if(update) OSD_DrawObject((POBJECT_HEAD)item, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL); /* Motor type */ msel = anesetm_msels[MOTOR_ID - 1]; if(pAntenna->motor_type != LNB_MOTOR_DISEQC12 && pAntenna->motor_type != LNB_MOTOR_USAL) pAntenna->motor_type = LNB_MOTOR_DISEQC12; if(pAntenna->motor_type == LNB_MOTOR_DISEQC12) val = 0; else val = 1; msel->nSel = val; item = anesetm_items[MOTOR_ID - 1]; if(update) OSD_DrawObject((POBJECT_HEAD)item, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL); /* Local longitute */ edf = anesetm_edfs[0]; OSD_SetEditFieldContent(edf,STRING_NUMBER,pLocal->local_longitude & 0x7FFF); if(pLocal->local_longitude & 0x8000) val = 1; else val = 0; OSD_SetEditFieldSuffix(edf, STRING_ANSI, (UINT32)longitute_sub_chars[val]); longitute_sub_idx = val; /* Local latitute */ edf = anesetm_edfs[1]; OSD_SetEditFieldContent(edf,STRING_NUMBER,pLocal->local_latitude & 0x7FFF); if(pLocal->local_latitude & 0x8000) val = 1; else val = 0; OSD_SetEditFieldSuffix(edf, STRING_ANSI, (UINT32)latitute_sub_chars[val]); latitute_sub_idx = val; win_atnsetm_load_local_action(update); }
void win_timer_load(TIMER_SET_CONTENT* settimer) { MULTISEL *msel; EDIT_FIELD *edf; TEXT_FIELD *txt; P_NODE p_node; UINT16 ch_idx,ch_cnt; UINT32 value; UINT8 action; win_timerset_set_currenttime(FALSE); /* TIMER_MODE*/ msel = &timer_msel_mode; if(settimer->timer_mode >= OSD_GetMultiselCount(msel)) settimer->timer_mode = TIMER_MODE_OFF; OSD_SetMultiselSel(msel, settimer->timer_mode); /* TIMER_WEEKDAY*/ msel = &timer_msel_wakeupweekday; if(settimer->wakeup_weekday >= OSD_GetMultiselCount(msel)) settimer->wakeup_weekday = SUNDAY; OSD_SetMultiselSel(msel, settimer->wakeup_weekday); /* TIMER_SERVICE */ msel = &timer_msel_servicetype; if(settimer->timer_service >= OSD_GetMultiselCount(msel)) settimer->timer_service = 0; OSD_SetMultiselSel(msel, settimer->timer_service); if(!pvr_info.hdd_valid)//guop add OSD_SetMultiselSel(msel, 0); /* TIMER service information: message or channel */ txt = &timer_txt_serviceinfo; OSD_SetTextFieldContent(txt, STRING_ID, (UINT32)TimerServiceTxtStr_id[settimer->timer_service]); win_timerset_timerservice_change(FALSE); edf = &timer_edf_wakeupdate; value = settimer->wakeup_year*10000 + settimer->wakeup_month*100 + settimer->wakeup_day; OSD_SetEditFieldContent(edf, STRING_NUMBER, value); edf = &timer_edf_wakeuptime; value = settimer->wakeup_time/60 * 100 + settimer->wakeup_time%60; OSD_SetEditFieldContent(edf, STRING_NUMBER, value); edf = &timer_edf_duration; if(settimer->timer_mode == TIMER_MODE_OFF) // set 2 hour as default!! settimer->wakeup_duration_time = 120; value = settimer->wakeup_duration_time/60 * 100 + settimer->wakeup_duration_time%60; OSD_SetEditFieldContent(edf, STRING_NUMBER, value); msel = &timer_msel_rec_type; if(settimer->wakeup_message > 2) settimer->wakeup_message = 0; OSD_SetMultiselSel(&timer_msel_rec_type, settimer->wakeup_message); win_timerset_timermode_change(FALSE); }
void set_time_clock(void) { OSD_SetEditFieldContent(&time_item_edit5, STRING_NUMBER, win_time_local_time.hour*100+win_time_local_time.min); }
void set_time_data(void) { OSD_SetEditFieldContent(&time_item_edit4, STRING_NUMBER, win_time_local_time.year*10000+win_time_local_time.month*100+win_time_local_time.day); }
UINT8 win_news_edit_menu_open(UINT8 mode, NEWS_ADDR_T *news_addr) { CONTAINER *win; PRESULT ret = PROC_LOOP; UINT32 hkey; TEXT_FIELD *txt; EDIT_FIELD *eft; UINT16 strID; UINT32 value = 0; UINT16 *unistr=NULL; BOOL old_value = ap_enable_key_task_get_key(TRUE); news_addr_edit_mode = mode; bNewsAddrEditOK = FALSE; txt = &txt_news_edit_title; if(mode == 0) strID = RS_HELP_EDIT; else strID = RS_HELP_ADD; OSD_SetTextFieldContent(txt, STRING_ID,(UINT32)strID); eft = &edt_news_edit_item1; OSD_SetEditFieldContent(eft, STRING_UNICODE, news_addr->news_addr_name); eft = &edt_news_edit_item2; OSD_SetEditFieldContent(eft, STRING_ANSI, news_addr->news_addr_url); win = &g_win_news_edit; OSD_SetContainerFocus(win, 1); #if 1 unistr = OSD_GetUnicodeString(btn_txt_strs[0]); OSD_SetTextFieldContent(&txt_news_edit_caps,STRING_UNICODE,(UINT32)unistr); unistr = OSD_GetUnicodeString(btn_txt_strs[1]); OSD_SetTextFieldContent(&txt_news_edit_del,STRING_UNICODE,(UINT32)unistr); unistr = OSD_GetUnicodeString(btn_txt_strs[2]); OSD_SetTextFieldContent(&txt_news_edit_ok,STRING_UNICODE,(UINT32)unistr); unistr = OSD_GetUnicodeString(btn_txt_strs[3]); OSD_SetTextFieldContent(&txt_news_edit_cancel,STRING_UNICODE,(UINT32)unistr); #endif wincom_backup_region(&(win->head.frame)); OSD_ObjOpen((POBJECT_HEAD)win, 0); while(ret != PROC_LEAVE) { hkey = ap_get_key_msg(); if(hkey == INVALID_HK || hkey == INVALID_MSG) continue; ret = OSD_ObjProc((POBJECT_HEAD)win, (MSG_TYPE_KEY<<16),hkey, 0); } if (bNewsAddrEditOK) { eft = &edt_news_edit_item1; value = OSD_GetEditFieldContent(eft); //ComUniStrToAsc((UINT8 *)value, news_addr->news_addr_name); ComUniStrCopyChar(news_addr->news_addr_name,(UINT8 *)value); eft = &edt_news_edit_item2; value = OSD_GetEditFieldContent(eft); ComUniStrToAsc((UINT8 *)value, news_addr->news_addr_url); } wincom_restore_region(); ap_enable_key_task_get_key(old_value); return bNewsAddrEditOK; }
static PRESULT find_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2) { PRESULT ret = PROC_PASS; VACTION unact; mobile_input_type_t mobile_input_type; mobile_input_type.type = MOBILE_INPUT_NORMAL; mobile_input_type.caps_flag = MOBILE_CAPS_INIT_LOW; mobile_input_type.maxlen = MAX_INPUT_STR_LEN; mobile_input_type.fixlen_flag = 0; mobile_input_type.callback = input_callback; switch(event) { case EVN_PRE_OPEN: if(!edit_keyboard_flag) win_keyboard_set_title(RS_HELP_FIND); win_find_prog_num = 0; mobile_input_init(&find_edt1,&mobile_input_type); //patch for clear find editfield content if(menu_stack_get(-1) == NULL) OSD_SetEditFieldContent(&find_edt1,STRING_UNICODE,(UINT32)""); break; case EVN_POST_OPEN: draw_caps_flag(CAPSFLG_L,CAPSFLG_T, 1); //draw_caps_del_colbtn(COLBTN_L, COLBTN_T,1); //draw_ok_cancel_colbtn(COLBTN_L, COLBTN_T + 40,1); draw_caps_colbtn(COLBTN_L, COLBTN_T, 1); draw_del_colbtn(COLBTN_L + 100, COLBTN_T, 1); draw_ok_colbtn(COLBTN_L, COLBTN_T + 40, 1); draw_cancel_colbtn(COLBTN_L+ 100, COLBTN_T + 40, 1); break; case EVN_PRE_CLOSE: /* Make OSD not flickering */ //*((UINT32*)param2) &= ~C_CLOSE_CLRBACK_FLG; break; case EVN_POST_CLOSE: break; case EVN_UNKNOWN_ACTION: unact = (VACTION)(param1>>16); if(unact == VACT_OK) { if(!edit_keyboard_flag) { if(win_find_prog_num == 0) ret = PROC_LEAVE; else { //OSD_ObjClose(((POBJECT_HEAD)&g_win_find,C_UPDATE_ALL); OSD_ClearObject((POBJECT_HEAD)&g_win_find, C_UPDATE_ALL); menu_stack_pop(); menu_stack_push((POBJECT_HEAD)&g_win_com_lst); ret = PROC_LOOP; } } else { check_ok = TRUE; ret = PROC_LEAVE; if(name_valid_func != NULL) { if(name_valid_func(input_name_str) == 0) { ret = PROC_LEAVE; } else { ret = PROC_LOOP; } } } } else if(unact == VACT_CANCEL) { if(!edit_keyboard_flag) { if(win_find_prog_num > 0) OSD_ClearObject((POBJECT_HEAD)&g_win_com_lst, C_UPDATE_ALL); ret = PROC_LEAVE; } else { ret = PROC_LEAVE; } } } return ret; }