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:
parent
5a01415960
commit
230baa77e7
31
buttons.c
31
buttons.c
@ -962,19 +962,28 @@ void Button_Settings(void)
|
|||||||
void Add_skin(const char *name)
|
void Add_skin(const char *name)
|
||||||
{
|
{
|
||||||
char * fname;
|
char * fname;
|
||||||
|
int namelength;
|
||||||
Add_element_to_list(name, 0);
|
|
||||||
Filelist_nb_elements++;
|
|
||||||
|
|
||||||
// Cut the long name to keep only filename (no directory)
|
// Cut the long name to keep only filename (no directory)
|
||||||
fname = Find_last_slash(Filelist->Full_name);
|
fname = Find_last_slash(name);
|
||||||
if (fname[0]=='\0')
|
if (fname)
|
||||||
return;
|
fname++;
|
||||||
|
else
|
||||||
strcpy(Filelist->Full_name, fname+1);
|
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++;
|
||||||
|
|
||||||
|
if (fname[0]=='\0')
|
||||||
|
return;
|
||||||
|
|
||||||
// Reformat the short name
|
strcpy(Filelist->Full_name, fname);
|
||||||
strcpy(Filelist->Short_name,Format_filename(Filelist->Full_name, 0));
|
|
||||||
|
// 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
|
// List of skins
|
||||||
skin_list = Window_set_list_button(
|
skin_list = Window_set_list_button(
|
||||||
// Fileselector
|
// 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
|
// Scroller du fileselector
|
||||||
(file_scroller = Window_set_scroller_button(160,FILESEL_Y+1,82,Filelist_nb_elements,10,selector_position)), // 3
|
(file_scroller = Window_set_scroller_button(160,FILESEL_Y+1,82,Filelist_nb_elements,10,selector_position)), // 3
|
||||||
Draw_one_skin_name); // 4
|
Draw_one_skin_name); // 4
|
||||||
|
|||||||
24
engine.c
24
engine.c
@ -2681,7 +2681,8 @@ short Window_clicked_button(void)
|
|||||||
list->Scroller->Position=list->List_start;
|
list->Scroller->Position=list->List_start;
|
||||||
Window_draw_slider(list->Scroller);
|
Window_draw_slider(list->Scroller);
|
||||||
}
|
}
|
||||||
Window_redraw_list(list);// reduce redraw?
|
Window_redraw_list(list);
|
||||||
|
Display_cursor();
|
||||||
// Store the selected value as attribute2
|
// Store the selected value as attribute2
|
||||||
Window_attribute2=list->List_start + list->Cursor_position;
|
Window_attribute2=list->List_start + list->Cursor_position;
|
||||||
// Return the control ID of the list.
|
// Return the control ID of the list.
|
||||||
@ -2700,7 +2701,8 @@ short Window_clicked_button(void)
|
|||||||
list->Scroller->Position=list->List_start;
|
list->Scroller->Position=list->List_start;
|
||||||
Window_draw_slider(list->Scroller);
|
Window_draw_slider(list->Scroller);
|
||||||
}
|
}
|
||||||
Window_redraw_list(list);// reduce redraw?
|
Window_redraw_list(list);
|
||||||
|
Display_cursor();
|
||||||
// Store the selected value as attribute2
|
// Store the selected value as attribute2
|
||||||
Window_attribute2=list->List_start + list->Cursor_position;
|
Window_attribute2=list->List_start + list->Cursor_position;
|
||||||
// Return the control ID of the list.
|
// Return the control ID of the list.
|
||||||
@ -2715,7 +2717,8 @@ short Window_clicked_button(void)
|
|||||||
// Mise à jour du scroller
|
// Mise à jour du scroller
|
||||||
list->Scroller->Position=list->List_start;
|
list->Scroller->Position=list->List_start;
|
||||||
Window_draw_slider(list->Scroller);
|
Window_draw_slider(list->Scroller);
|
||||||
Window_redraw_list(list);// reduce redraw?
|
Window_redraw_list(list);
|
||||||
|
Display_cursor();
|
||||||
// Store the selected value as attribute2
|
// Store the selected value as attribute2
|
||||||
Window_attribute2=list->List_start + list->Cursor_position;
|
Window_attribute2=list->List_start + list->Cursor_position;
|
||||||
// Return the control ID of the list.
|
// Return the control ID of the list.
|
||||||
@ -2734,7 +2737,8 @@ short Window_clicked_button(void)
|
|||||||
list->Scroller->Position=list->List_start;
|
list->Scroller->Position=list->List_start;
|
||||||
Window_draw_slider(list->Scroller);
|
Window_draw_slider(list->Scroller);
|
||||||
}
|
}
|
||||||
Window_redraw_list(list);// reduce redraw?
|
Window_redraw_list(list);
|
||||||
|
Display_cursor();
|
||||||
// Store the selected value as attribute2
|
// Store the selected value as attribute2
|
||||||
Window_attribute2=list->List_start + list->Cursor_position;
|
Window_attribute2=list->List_start + list->Cursor_position;
|
||||||
// Return the control ID of the list.
|
// Return the control ID of the list.
|
||||||
@ -2763,7 +2767,8 @@ short Window_clicked_button(void)
|
|||||||
list->Scroller->Position=list->List_start;
|
list->Scroller->Position=list->List_start;
|
||||||
Window_draw_slider(list->Scroller);
|
Window_draw_slider(list->Scroller);
|
||||||
}
|
}
|
||||||
Window_redraw_list(list);// reduce redraw?
|
Window_redraw_list(list);
|
||||||
|
Display_cursor();
|
||||||
// Store the selected value as attribute2
|
// Store the selected value as attribute2
|
||||||
Window_attribute2=list->List_start + list->Cursor_position;
|
Window_attribute2=list->List_start + list->Cursor_position;
|
||||||
// Return the control ID of the list.
|
// Return the control ID of the list.
|
||||||
@ -2788,7 +2793,8 @@ short Window_clicked_button(void)
|
|||||||
list->Scroller->Position=list->List_start;
|
list->Scroller->Position=list->List_start;
|
||||||
Window_draw_slider(list->Scroller);
|
Window_draw_slider(list->Scroller);
|
||||||
}
|
}
|
||||||
Window_redraw_list(list);// reduce redraw?
|
Window_redraw_list(list);
|
||||||
|
Display_cursor();
|
||||||
// Store the selected value as attribute2
|
// Store the selected value as attribute2
|
||||||
Window_attribute2=list->List_start + list->Cursor_position;
|
Window_attribute2=list->List_start + list->Cursor_position;
|
||||||
// Return the control ID of the list.
|
// Return the control ID of the list.
|
||||||
@ -2804,10 +2810,11 @@ short Window_clicked_button(void)
|
|||||||
list->Cursor_position-=list->List_start;
|
list->Cursor_position-=list->List_start;
|
||||||
// On affiche à nouveau la liste
|
// On affiche à nouveau la liste
|
||||||
Hide_cursor();
|
Hide_cursor();
|
||||||
Window_redraw_list(list);// reduce redraw?
|
Window_redraw_list(list);
|
||||||
// Mise à jour du scroller
|
// Mise à jour du scroller
|
||||||
list->Scroller->Position=list->List_start;
|
list->Scroller->Position=list->List_start;
|
||||||
Window_draw_slider(list->Scroller);
|
Window_draw_slider(list->Scroller);
|
||||||
|
Display_cursor();
|
||||||
}
|
}
|
||||||
if (Key==KEY_MOUSEWHEELDOWN && list->List_start<list->Scroller->Nb_elements-list->Scroller->Nb_visibles)
|
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;
|
list->Cursor_position-=list->List_start;
|
||||||
// On affiche à nouveau la liste
|
// On affiche à nouveau la liste
|
||||||
Hide_cursor();
|
Hide_cursor();
|
||||||
Window_redraw_list(list);// reduce redraw?
|
Window_redraw_list(list);
|
||||||
// Mise à jour du scroller
|
// Mise à jour du scroller
|
||||||
list->Scroller->Position=list->List_start;
|
list->Scroller->Position=list->List_start;
|
||||||
Window_draw_slider(list->Scroller);
|
Window_draw_slider(list->Scroller);
|
||||||
|
Display_cursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
skins/_classic.png
Normal file
BIN
skins/_classic.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.6 KiB |
BIN
skins/_fairlight.png
Normal file
BIN
skins/_fairlight.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.6 KiB |
BIN
skins/_fun.png
Normal file
BIN
skins/_fun.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.7 KiB |
BIN
skins/_melon.png
Normal file
BIN
skins/_melon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.7 KiB |
Loading…
x
Reference in New Issue
Block a user