GUI Listboxes: fixed mouse cursor display while using keyboard;

Skin selector: tweaked position and made it ignore files that don't end in .PNG .GIF, or those that start with '_';
Added 2 old fonts and 2 new ones (thanks Ilkke) as files skins/_fontname.png


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@883 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Yves Rizoud 2009-06-22 21:30:54 +00:00
parent 5a01415960
commit 230baa77e7
6 changed files with 36 additions and 19 deletions

View File

@ -962,19 +962,28 @@ void Button_Settings(void)
void Add_skin(const char *name)
{
char * fname;
Add_element_to_list(name, 0);
Filelist_nb_elements++;
int namelength;
// Cut the long name to keep only filename (no directory)
fname = Find_last_slash(Filelist->Full_name);
if (fname[0]=='\0')
return;
fname = Find_last_slash(name);
if (fname)
fname++;
else
fname=name;
namelength = strlen(fname);
if (namelength>=5 && fname[0]!='_' && (!stricmp(fname+namelength-4,".png") || !stricmp(fname+namelength-4,".gif")))
{
Add_element_to_list(name, 0);
Filelist_nb_elements++;
strcpy(Filelist->Full_name, fname+1);
if (fname[0]=='\0')
return;
// Reformat the short name
strcpy(Filelist->Short_name,Format_filename(Filelist->Full_name, 0));
strcpy(Filelist->Full_name, fname);
// Reformat the short name
strcpy(Filelist->Short_name,Format_filename(Filelist->Full_name, 0));
}
}
@ -1055,7 +1064,7 @@ void Button_Skins(void)
// List of skins
skin_list = Window_set_list_button(
// Fileselector
Window_set_special_button(9,FILESEL_Y+2,144,80), // 2
Window_set_special_button(8,FILESEL_Y+1,144,80), // 2
// Scroller du fileselector
(file_scroller = Window_set_scroller_button(160,FILESEL_Y+1,82,Filelist_nb_elements,10,selector_position)), // 3
Draw_one_skin_name); // 4

View File

@ -2681,7 +2681,8 @@ short Window_clicked_button(void)
list->Scroller->Position=list->List_start;
Window_draw_slider(list->Scroller);
}
Window_redraw_list(list);// reduce redraw?
Window_redraw_list(list);
Display_cursor();
// Store the selected value as attribute2
Window_attribute2=list->List_start + list->Cursor_position;
// Return the control ID of the list.
@ -2700,7 +2701,8 @@ short Window_clicked_button(void)
list->Scroller->Position=list->List_start;
Window_draw_slider(list->Scroller);
}
Window_redraw_list(list);// reduce redraw?
Window_redraw_list(list);
Display_cursor();
// Store the selected value as attribute2
Window_attribute2=list->List_start + list->Cursor_position;
// Return the control ID of the list.
@ -2715,7 +2717,8 @@ short Window_clicked_button(void)
// Mise à jour du scroller
list->Scroller->Position=list->List_start;
Window_draw_slider(list->Scroller);
Window_redraw_list(list);// reduce redraw?
Window_redraw_list(list);
Display_cursor();
// Store the selected value as attribute2
Window_attribute2=list->List_start + list->Cursor_position;
// Return the control ID of the list.
@ -2734,7 +2737,8 @@ short Window_clicked_button(void)
list->Scroller->Position=list->List_start;
Window_draw_slider(list->Scroller);
}
Window_redraw_list(list);// reduce redraw?
Window_redraw_list(list);
Display_cursor();
// Store the selected value as attribute2
Window_attribute2=list->List_start + list->Cursor_position;
// Return the control ID of the list.
@ -2763,7 +2767,8 @@ short Window_clicked_button(void)
list->Scroller->Position=list->List_start;
Window_draw_slider(list->Scroller);
}
Window_redraw_list(list);// reduce redraw?
Window_redraw_list(list);
Display_cursor();
// Store the selected value as attribute2
Window_attribute2=list->List_start + list->Cursor_position;
// Return the control ID of the list.
@ -2788,7 +2793,8 @@ short Window_clicked_button(void)
list->Scroller->Position=list->List_start;
Window_draw_slider(list->Scroller);
}
Window_redraw_list(list);// reduce redraw?
Window_redraw_list(list);
Display_cursor();
// Store the selected value as attribute2
Window_attribute2=list->List_start + list->Cursor_position;
// Return the control ID of the list.
@ -2804,10 +2810,11 @@ short Window_clicked_button(void)
list->Cursor_position-=list->List_start;
// On affiche à nouveau la liste
Hide_cursor();
Window_redraw_list(list);// reduce redraw?
Window_redraw_list(list);
// Mise à jour du scroller
list->Scroller->Position=list->List_start;
Window_draw_slider(list->Scroller);
Display_cursor();
}
if (Key==KEY_MOUSEWHEELDOWN && list->List_start<list->Scroller->Nb_elements-list->Scroller->Nb_visibles)
{
@ -2820,10 +2827,11 @@ short Window_clicked_button(void)
list->Cursor_position-=list->List_start;
// On affiche à nouveau la liste
Hide_cursor();
Window_redraw_list(list);// reduce redraw?
Window_redraw_list(list);
// Mise à jour du scroller
list->Scroller->Position=list->List_start;
Window_draw_slider(list->Scroller);
Display_cursor();
}
}

BIN
skins/_classic.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
skins/_fairlight.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
skins/_fun.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
skins/_melon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB