Modified filelists so that they can support arbitrary width. Generalized the 'quicksearch' system and implemented it in Brush Factory screen: Type some letters to locate matching filename.

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1660 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Yves Rizoud
2010-12-17 00:56:58 +00:00
parent e886553314
commit 9b4be3abd1
5 changed files with 184 additions and 108 deletions

View File

@@ -1200,31 +1200,18 @@ void Add_font_or_skin(const char *name)
&& (!strcasecmp(fname + namelength - 4,".png")
|| !strcasecmp(fname + namelength - 4,".gif")))
{
Add_element_to_list(&Skin_files_list, name, 0, ICON_NONE);
Add_element_to_list(&Skin_files_list, fname, Format_filename(fname, 19, 0), 0, ICON_NONE);
if (fname[0]=='\0')
return;
// Remove directory from full name
strcpy(Skin_files_list.First->Full_name, fname);
// Reformat the short name differently
strcpy(Skin_files_list.First->Short_name,
Format_filename(Skin_files_list.First->Full_name, 0)
);
}
else if (namelength>=10 && !strncasecmp(fname, "font_", 5)
&& (!strcasecmp(fname + namelength - 4, ".png")))
{
Add_element_to_list(&Font_files_list, name, 0, ICON_NONE);
Add_element_to_list(&Font_files_list, fname, Format_font_filename(fname), 0, ICON_NONE);
if (fname[0]=='\0')
return;
// Remove directory from full name
strcpy(Font_files_list.First->Full_name, fname);
// Reformat the short name differently
strcpy(Font_files_list.First->Short_name,
Format_font_filename(Font_files_list.First->Full_name));
}
}