FONT* arial_16 = "Arial#16";
TEXT* editor_list;
PANEL* editor_listpan;
void editor_ShowList(TEXT* _txt,_lines)
{
STRING* pan_str = "";
STRING* editor_temp = "";
editor_StatusList = 1;
if(_lines > 10)
{
_lines = 10;
}
editor_list = txt_create(10,12);
int i;
for(i=0; i<_lines; i++)
{
if((editor_list.pstring)[i])
{
str_cpy((editor_list.pstring)[i],(_txt.pstring)[i]);
str_for_num(editor_temp,16*i+20);
str_cat(pan_str,"button(5,");
str_cat(pan_str,editor_temp);
str_cat(pan_str,",btn_Small2,btn_Small1,btn_Small2,NULL,NULL,NULL;");
}
}
str_cat(pan_str,"button(393,1,btn_close2,btn_close1,btn_close2,editor_exitList,NULL,NULL);");
editor_listpan = pan_create(pan_str,10);
editor_listpan.red = 128;
editor_listpan.green = 128;
editor_listpan.blue = 128;
editor_listpan.size_x = 410;
editor_listpan.size_y = 25 + _lines*16;
editor_listpan.pos_x = (screen_size.x - editor_listpan.size_x) / 2;
editor_listpan.pos_y = 150;
editor_list.pos_x = editor_listpan.pos_x + 10;
editor_list.pos_y = editor_listpan.pos_y + 20;
editor_list.font = arial_16;
set(editor_listpan,SHOW|LIGHT);
set(editor_list,SHOW);
}
void editor_unloadList()
{
int i;
reset(editor_list,SHOW);
reset(editor_listpan,SHOW);
for(i=0; i<editor_list.strings; i++)
{
if((editor_list.pstring)[i])
{
ptr_remove((editor_list.pstring)[i]);
}
}
ptr_remove(editor_list);
ptr_remove(editor_listpan);
}