Commit 67aa3a18 authored by David Bruce's avatar David Bruce

code clean up of titlescreen.c


git-svn-id: svn://svn.debian.org/svn/tux4kids/tuxtype/trunk@766 47d30e19-490b-0410-9d18-e851f4e465b3
parent fb82c668
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Tux Typing 1.5.16\n"
"Report-Msgid-Bugs-To: tux4kids-tuxtype-dev@lists.alioth.debian.org\n"
"POT-Creation-Date: 2008-10-16 21:12-0500\n"
"POT-Creation-Date: 2008-11-10 06:37-0600\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Mobin M <mobinmohan@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Tux Typing 1.5.16\n"
"Report-Msgid-Bugs-To: tux4kids-tuxtype-dev@lists.alioth.debian.org\n"
"POT-Creation-Date: 2008-10-16 21:12-0500\n"
"POT-Creation-Date: 2008-11-10 06:37-0600\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Mobin M <mobinmohan@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Tux Typing 1.5.16\n"
"Report-Msgid-Bugs-To: tux4kids-tuxtype-dev@lists.alioth.debian.org\n"
"POT-Creation-Date: 2008-10-16 21:12-0500\n"
"POT-Creation-Date: 2008-11-10 06:37-0600\n"
"PO-Revision-Date: 2007-11-10 16:36+0100\n"
"Last-Translator: JardaK <krejci@zstenis.com>\n"
"Language-Team: czech <cs@li.org>\n"
......
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Tux Typing 1.5.16\n"
"Report-Msgid-Bugs-To: tux4kids-tuxtype-dev@lists.alioth.debian.org\n"
"POT-Creation-Date: 2008-10-16 21:12-0500\n"
"POT-Creation-Date: 2008-11-10 06:37-0600\n"
"PO-Revision-Date: 2003-05-08 17:58+0200\n"
"Last-Translator: Nikolai Beier <beier@ofir.dk>\n"
"Language-Team: Danish\n"
......
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Tux Typing 1.5.16\n"
"Report-Msgid-Bugs-To: tux4kids-tuxtype-dev@lists.alioth.debian.org\n"
"POT-Creation-Date: 2008-10-16 21:12-0500\n"
"POT-Creation-Date: 2008-11-10 06:37-0600\n"
"PO-Revision-Date: 2003-06-14 19:00+0000\n"
"Last-Translator: Andreas Ramm <ace1@gmx.net>\n"
"Language-Team: German\n"
......
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Tux Typing 1.5.16\n"
"Report-Msgid-Bugs-To: tux4kids-tuxtype-dev@lists.alioth.debian.org\n"
"POT-Creation-Date: 2008-10-16 21:12-0500\n"
"POT-Creation-Date: 2008-11-10 06:37-0600\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......
......@@ -31,8 +31,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Tux Typing 1.7.0\n"
"Report-Msgid-Bugs-To: tux4kids-tuxtype-dev@lists.alioth.debian.org\n"
"POT-Creation-Date: 2008-10-16 21:12-0500\n"
"PO-Revision-Date: 2008-10-16 21:12-0500\n"
"POT-Creation-Date: 2008-11-10 06:37-0600\n"
"PO-Revision-Date: 2008-11-10 06:37-0600\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
......
......@@ -28,8 +28,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Tux Typing 1.7.0\n"
"Report-Msgid-Bugs-To: tux4kids-tuxtype-dev@lists.alioth.debian.org\n"
"POT-Creation-Date: 2008-10-16 21:12-0500\n"
"PO-Revision-Date: 2008-10-16 21:12-0500\n"
"POT-Creation-Date: 2008-11-10 06:37-0600\n"
"PO-Revision-Date: 2008-11-10 06:37-0600\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
......
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Tuxtype\n"
"Report-Msgid-Bugs-To: tux4kids-tuxtype-dev@lists.alioth.debian.org\n"
"POT-Creation-Date: 2008-10-16 21:12-0500\n"
"POT-Creation-Date: 2008-11-10 06:37-0600\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Mobin M <mobinmohan@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Tux Typing 1.5.16\n"
"Report-Msgid-Bugs-To: tux4kids-tuxtype-dev@lists.alioth.debian.org\n"
"POT-Creation-Date: 2008-10-16 21:12-0500\n"
"POT-Creation-Date: 2008-11-10 06:37-0600\n"
"PO-Revision-Date: 2007-09-16 19:00+0000\n"
"Last-Translator: Amaya Rodrigo <amaya@debian.org>\n"
"Language-Team: Spanish\n"
......
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Tux Typing 1.5.16\n"
"Report-Msgid-Bugs-To: tux4kids-tuxtype-dev@lists.alioth.debian.org\n"
"POT-Creation-Date: 2008-10-16 21:12-0500\n"
"POT-Creation-Date: 2008-11-10 06:37-0600\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Tux Typing 1.5.16\n"
"Report-Msgid-Bugs-To: tux4kids-tuxtype-dev@lists.alioth.debian.org\n"
"POT-Creation-Date: 2008-10-16 21:12-0500\n"
"POT-Creation-Date: 2008-11-10 06:37-0600\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Tux Typing 1.5.16\n"
"Report-Msgid-Bugs-To: tux4kids-tuxtype-dev@lists.alioth.debian.org\n"
"POT-Creation-Date: 2008-10-16 21:12-0500\n"
"POT-Creation-Date: 2008-11-10 06:37-0600\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......
......@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Tux Typing 1.5.16\n"
"Report-Msgid-Bugs-To: tux4kids-tuxtype-dev@lists.alioth.debian.org\n"
"POT-Creation-Date: 2008-10-16 21:12-0500\n"
"POT-Creation-Date: 2008-11-10 06:37-0600\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Tux Typing 1.5.16\n"
"Report-Msgid-Bugs-To: tux4kids-tuxtype-dev@lists.alioth.debian.org\n"
"POT-Creation-Date: 2008-10-16 21:12-0500\n"
"POT-Creation-Date: 2008-11-10 06:37-0600\n"
"PO-Revision-Date: 2004-10-20\n"
"Last-Translator: Gintautas Grigas <grigas@ktl.mii.lt>\n"
"Language-Team: Lithuanian\n"
......
No preview for this file type
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Tuxtype\n"
"Report-Msgid-Bugs-To: tux4kids-tuxtype-dev@lists.alioth.debian.org\n"
"POT-Creation-Date: 2008-10-16 21:12-0500\n"
"POT-Creation-Date: 2008-11-10 06:37-0600\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Mobin M <mobinmohan@gmail.com>\n"
"Language-Team: Swathanthra|സ്വതന്ത്ര Malayalam|മലയാളം Computing|കമ്പ്യൂട്ടിങ്ങ് <smc-"
......
......@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Tux Typing 1.5.16\n"
"Report-Msgid-Bugs-To: tux4kids-tuxtype-dev@lists.alioth.debian.org\n"
"POT-Creation-Date: 2008-10-16 21:12-0500\n"
"POT-Creation-Date: 2008-11-10 06:37-0600\n"
"PO-Revision-Date: 2005-10-20 21:24+0200\n"
"Last-Translator: Trond Mæhlum <trondm@skolelinux.no>\n"
"Language-Team: Norwegian Bokmål <i18n-nb@lister.ping.uio.no>\n"
......
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Tux Typing 1.5.16\n"
"Report-Msgid-Bugs-To: tux4kids-tuxtype-dev@lists.alioth.debian.org\n"
"POT-Creation-Date: 2008-10-16 21:12-0500\n"
"POT-Creation-Date: 2008-11-10 06:37-0600\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Mobin M <mobinmohan@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Tuxtype\n"
"Report-Msgid-Bugs-To: tux4kids-tuxtype-dev@lists.alioth.debian.org\n"
"POT-Creation-Date: 2008-10-16 21:12-0500\n"
"POT-Creation-Date: 2008-11-10 06:37-0600\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......
......@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Tux Typing 1.5.16\n"
"Report-Msgid-Bugs-To: tux4kids-tuxtype-dev@lists.alioth.debian.org\n"
"POT-Creation-Date: 2008-10-16 21:12-0500\n"
"POT-Creation-Date: 2008-11-10 06:37-0600\n"
"PO-Revision-Date: 2005-02-12 13:13+0100\n"
"Last-Translator: Karl Ove Hufthammer <karl@huftis.org>\n"
"Language-Team: Norwegian Nynorsk <i18n-nn@lister.ping.uio.no>\n"
......
......@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Tux Typing 1.5.16\n"
"Report-Msgid-Bugs-To: tux4kids-tuxtype-dev@lists.alioth.debian.org\n"
"POT-Creation-Date: 2008-10-16 21:12-0500\n"
"POT-Creation-Date: 2008-11-10 06:37-0600\n"
"PO-Revision-Date: 2007-02-07 16:08+0000\n"
"Last-Translator: Hudson G M Figueredo <kynder@pquilinux.org>\n"
"Language-Team: <pt@li.org>\n"
......
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Tux Typing 1.5.16\n"
"Report-Msgid-Bugs-To: tux4kids-tuxtype-dev@lists.alioth.debian.org\n"
"POT-Creation-Date: 2008-10-16 21:12-0500\n"
"POT-Creation-Date: 2008-11-10 06:37-0600\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Mobin M <mobinmohan@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......
......@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tuxtype2 1.5.1\n"
"Report-Msgid-Bugs-To: tux4kids-tuxtype-dev@lists.alioth.debian.org\n"
"POT-Creation-Date: 2008-10-16 21:12-0500\n"
"POT-Creation-Date: 2008-11-10 06:37-0600\n"
"PO-Revision-Date: 2003-07-23 17:44+0200\n"
"Last-Translator: Göran Uddeborg <goeran@uddeborg.se>\n"
"Language-Team: Swedish <sv@li.org>\n"
......
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Tux Typing 1.5.16\n"
"Report-Msgid-Bugs-To: tux4kids-tuxtype-dev@lists.alioth.debian.org\n"
"POT-Creation-Date: 2008-10-16 21:12-0500\n"
"POT-Creation-Date: 2008-11-10 06:37-0600\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......
......@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: tux4kids-tuxtype-dev@lists.alioth.debian.org\n"
"POT-Creation-Date: 2008-10-16 21:12-0500\n"
"POT-Creation-Date: 2008-11-10 06:37-0600\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Tux Typing 1.5.16\n"
"Report-Msgid-Bugs-To: tux4kids-tuxtype-dev@lists.alioth.debian.org\n"
"POT-Creation-Date: 2008-10-16 21:12-0500\n"
"POT-Creation-Date: 2008-11-10 06:37-0600\n"
"PO-Revision-Date: 2007-09-25 09:50-0000\n"
"Last-Translator: Ousmane Faty Ndongo et Dominique Rochefort <alfanet@anafa."
"org>\n"
......
......@@ -1436,92 +1436,115 @@ static int chooseWordlist(void)
break;
case SDL_MOUSEBUTTONDOWN:
if (inRect( leftRect, event.button.x, event.button.y ))
if (loc-(loc%8)-8 >= 0) {
loc=loc-(loc%8)-8;
break;
}
if (inRect( rightRect, event.button.x, event.button.y ))
if (loc-(loc%8)+8 < lists) {
loc=loc-(loc%8)+8;
break;
}
for (i=0; (i<8) && (loc-(loc%8)+i<lists); i++)
if (inRect(titleRects[i], event.button.x, event.button.y)) {
loc = loc-(loc%8)+i;
ClearWordList(); /* clear old selection */
//if (loc==0)
// UseAlphabet();
//else
GenerateWordList(wordlistFile[loc]);
stop = 1;
break;
}
break;
case SDL_KEYDOWN:
if (event.key.keysym.sym == SDLK_ESCAPE) { stop = 2; break; }
if (event.key.keysym.sym == SDLK_RETURN) {
ClearWordList(); /* clear old selection */
//if (loc==0)
// UseAlphabet();
//else
GenerateWordList(wordlistFile[loc]);
stop = 1;
break;
}
if ((event.key.keysym.sym == SDLK_LEFT) || (event.key.keysym.sym == SDLK_PAGEUP)) {
if (loc-(loc%8)-8 >= 0)
loc=loc-(loc%8)-8;
}
if ((event.key.keysym.sym == SDLK_RIGHT) || (event.key.keysym.sym == SDLK_PAGEDOWN)) {
if (loc-(loc%8)+8 < lists)
loc=(loc-(loc%8)+8);
}
if (event.key.keysym.sym == SDLK_UP) {
if (loc > 0)
loc--;
}
if (event.key.keysym.sym == SDLK_DOWN) {
if (loc+1<lists)
loc++;
}
if (inRect( leftRect, event.button.x, event.button.y ))
{
if (loc - (loc % 8) - 8 >= 0)
{
loc = loc - (loc % 8) - 8;
break;
}
}
if (inRect(rightRect, event.button.x, event.button.y))
{
if (loc - (loc % 8) + 8 < lists)
{
loc = loc - (loc % 8) + 8;
break;
}
}
for (i = 0; (i < 8) && (loc - (loc % 8) + i < lists); i++)
{
if (inRect(titleRects[i], event.button.x, event.button.y))
{
loc = loc - (loc % 8) + i;
ClearWordList(); /* clear old selection */
GenerateWordList(wordlistFile[loc]);
stop = 1;
break;
}
}
break;
case SDL_KEYDOWN:
if (event.key.keysym.sym == SDLK_ESCAPE)
{
stop = 2;
break;
}
if (event.key.keysym.sym == SDLK_RETURN)
{
ClearWordList(); /* clear old selection */
GenerateWordList(wordlistFile[loc]);
stop = 1;
break;
}
if ((event.key.keysym.sym == SDLK_LEFT)
|| (event.key.keysym.sym == SDLK_PAGEUP))
{
if (loc - (loc % 8) - 8 >= 0)
loc = loc - (loc % 8) - 8;
}
if ((event.key.keysym.sym == SDLK_RIGHT)
|| (event.key.keysym.sym == SDLK_PAGEDOWN))
{
if (loc - (loc % 8) + 8 < lists)
loc = (loc - (loc % 8) + 8);
}
if (event.key.keysym.sym == SDLK_UP)
{
if (loc > 0)
loc--;
}
if (event.key.keysym.sym == SDLK_DOWN)
{
if (loc+1<lists)
loc++;
}
}
}
if (old_loc != loc) {
int start;
/* Redraw if we have changed location: */
if (old_loc != loc)
{
int start;
SDL_BlitSurface(CurrentBkgd(), NULL, screen, NULL );
SDL_BlitSurface(CurrentBkgd(), NULL, screen, NULL );
start = loc - (loc % 8);
for (i = start; i<MIN(start+8,lists); i++) {
titleRects[i%8].x = screen->w/2 - (titles[i]->w/2);
if (i == loc)
SDL_BlitSurface(select[loc], NULL, screen, &titleRects[i%8]);
else
SDL_BlitSurface(titles[i], NULL, screen, &titleRects[i%8]);
}
start = loc - (loc % 8);
/* --- draw buttons --- */
for (i = start; i< MIN(start + 8,lists); i++)
{
titleRects[i % 8].x = screen->w/2 - (titles[i]->w/2);
if (i == loc) /* Draw selected text in yellow: */
SDL_BlitSurface(select[loc], NULL, screen, &titleRects[i%8]);
else /* Draw unselected text in white: */
SDL_BlitSurface(titles[i], NULL, screen, &titleRects[i%8]);
}
if (start>0)
SDL_BlitSurface( left, NULL, screen, &leftRect );
/* --- draw arrow buttons --- */
if (start > 0)
SDL_BlitSurface(left, NULL, screen, &leftRect);
if (start+8<lists)
SDL_BlitSurface( right, NULL, screen, &rightRect );
if (start + 8 < lists)
SDL_BlitSurface(right, NULL, screen, &rightRect);
SDL_UpdateRect(screen, 0, 0, 0 ,0);
}
SDL_Delay(40);
old_loc = loc;
SDL_UpdateRect(screen, 0, 0, 0 ,0);
}
SDL_Delay(40);
old_loc = loc;
}
/* --- clear graphics before leaving function --- */
for (i = 0; i<lists; i++)
for (i = 0; i < lists; i++)
{
SDL_FreeSurface(titles[i]);
SDL_FreeSurface(select[i]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment