#include "mkhibliba.h" /*=============================================================================================== == Search funtion ================================================================================================= == keep in memory the string searched : to do it again later ================================================================================================= == htxt : the hTxt structure to search in == str_search : the strinf to search == is_new : boolean telling if it's a new search ================================================================================================= == return the position of the found string else 0 ===============================================================================================*/ /* short h_searchTxt(h_File * hfile, unsigned char * str_search, BOOL is_new) { static unsigned short pos; unsigned char * str=str_search; unsigned short pos2; if (is_new) { pos=0; } else { pos++; } while (hfile->text[pos]!='\0' && str!=NULL) { //search in all the string str=str_search; if (*str==hfile->text[pos]) { pos2=pos; while (*str==hfile->text[pos2] && *str!='\0') { //compare with every caracters str++; pos2++; } if (*str=='\0') str=NULL; else pos++; } else { pos++; } } if (str!=NULL) return 0; //search the corresponding line pos2=0; while (hfile->hscrlines[pos2].pos_txtlang.next , hcfg->lang.new }; static char str_search[50]; short pos_x=(hfile->width-LENGTH_MENU_SEARCH-7-6)/2; short pos_y=(hfile->height-4-6*2)/2; h_Menu hmenu={ .nb=2, .tab=(char *)tabstr, .level_tab=NULL, .pos_x=pos_x+3, .pos_y=pos_y+2, .width=LENGTH_MENU_SEARCH+7, .nb_draw=2, .font=hcfg->font_msg, .key_able=0, .no_choice=0, .top=0, .move=0 }; hl_fillFrame(pos_x,pos_y,LENGTH_MENU_SEARCH+7+6,4+6*2,1,LCD_MEM,30); hl_drawFrame(pos_x,pos_x+LENGTH_MENU_SEARCH+7+6,pos_y,pos_y+4+6*2,LCD_MEM,30); draw: hl_synchro(hcfg->speed_key); hl_drawMenu(&hmenu,LCD_MEM); switch (hl_keyMenu(&hmenu,hcfg->speed_key,TRUE)) { case HMENU_ESC: return -1; case HMENU_REDRAW: goto draw; } hl_synchro(hcfg->speed_key); if (hmenu.no_choice!=1) { hl_freeSynchro(); h_getStr(hcfg->font_msg,str_search,20,hcfg->lang.search_title,hcfg->lang.search_enter,hfile->width,hfile->height); hl_initSynchro(); if (*str_search=='\0') return 0; } hl_drawMessage(hcfg->font_msg,hcfg->lang.search_title,hcfg->lang.searching,NULL,NULL,1,hfile->width,hfile->height,LCD_MEM); return h_searchTxt(hfile,str_search,(hmenu.no_choice!=1)); }*/