Exemplo n.º 1
0
char *getNChars( int n )
{
	extern SDL_Window *window;
	SDL_Widget *label_edit;
	static char buf[32] = {0};
	
	label_edit = printStr( "Please input MBSN into this editor.", 400, 275 );
	
	drawEdit();
	SDL_WidgetSetFocus(input_edit);
	
	while (edit_length < n) {
		SDL_Delay(50);
	}
	
	char *str = SDL_EditGetText(input_edit);

	sprintf(buf, "%s", str);	
//	sprintf(buf, "Your inputs is %s.", str);
//	printMsg( buf );
	
	SDL_WidgetClose(label_edit);
	SDL_WidgetClose(input_edit);
	refreshWin();
	
	edit_length = 0;

	return buf;
}
Exemplo n.º 2
0
char *getNCharsPrompt( int n, char *prompt)
{
//        printf( "len %d, prompt %s", n, prompt);
//        SDL_Delay( 5000);
        
	extern SDL_Window *window;
	SDL_Widget *label_edit;
	static char buf[32] = {0};
	char strPrompt[4096] = {0};
	sprintf( strPrompt, "Please inpute %s into this editer.", prompt);
	
	label_edit = printStr( strPrompt, 400, 275 );
	
	drawEdit();
	SDL_WidgetSetFocus(input_edit);
	
	while (edit_length < n) {
		SDL_Delay(50);
	}
	
	char *str = SDL_EditGetText(input_edit);

	sprintf(buf, "%s", str);	
//	sprintf(buf, "Your inputs is %s.", str);
//	printMsg( buf );
	
	SDL_WidgetClose(label_edit);
	SDL_WidgetClose(input_edit);
	refreshWin();
	
	edit_length = 0;

	return buf;
}
Exemplo n.º 3
0
void SONGDBUI_Play(int player_nr)
{
    int tab;
    struct SongDBEntry *e;
    tab = SDL_NotebookGetCurrentPage(Widgets->Tabs);

    PLAYER_GetPlayingEntry(player_nr,&e);
    tab = SONGDB_FindSubgroup(e);
    SDL_NotebookSetCurrentTab(Widgets->Tabs,tab);
    if(e)
    {
        SDL_TableSetStyle(SDL_NotebookGetChildWidget(Widgets->Tabs),e->id,0xff0000);
        SDL_TableEnsureRowVisible(SDL_NotebookGetChildWidget(Widgets->Tabs),e->id);
        SDL_WidgetSetFocus(SDL_NotebookGetChildWidget(Widgets->Tabs));
    }
}