Mouse scroll wheel now scrolls in Open dialog.

Cursor was disappearing if at far left scrolling up in Open dialog. Fixed.
This commit is contained in:
William Kendrick 2005-11-23 22:25:41 +00:00
parent 6c67a6e8da
commit 980715dea6
2 changed files with 41 additions and 2 deletions

View file

@ -7,7 +7,7 @@ bill@newbreedsoftware.com
http://www.newbreedsoftware.com/tuxpaint/ http://www.newbreedsoftware.com/tuxpaint/
2005.November.20 (0.9.15) 2005.November.23 (0.9.15)
* Speed improvements: * Speed improvements:
------------------- -------------------
@ -170,6 +170,8 @@ http://www.newbreedsoftware.com/tuxpaint/
by pressing the [Alt]+[S] keys. (Note: does not enable sounds if by pressing the [Alt]+[S] keys. (Note: does not enable sounds if
"nosound" is set in configuration file or via command-line.) "nosound" is set in configuration file or via command-line.)
* Scroll wheel can be used to scroll through thumbnails in Open dialog.
* Printing improvements: * Printing improvements:
---------------------- ----------------------
* Now printing directly via Postscript. * Now printing directly via Postscript.
@ -246,6 +248,11 @@ http://www.newbreedsoftware.com/tuxpaint/
* Failed to install default locale fonts. Fixed. * Failed to install default locale fonts. Fixed.
kyjo44 <kyjo44@users.sourceforge.net> kyjo44 <kyjo44@users.sourceforge.net>
* Scroll wheel motion was being perceived as clicks in Open dialog. Fixed.
* Thumbnail cursor could fall of screen when scrolling in Open dialog.
Fixed.
* Compiling, porting and packaging updates: * Compiling, porting and packaging updates:
----------------------------------------- -----------------------------------------
* Added support for system and user configuration files on Windows. * Added support for system and user configuration files on Windows.

View file

@ -14218,7 +14218,7 @@ void do_open(void)
do_setcursor(cursor_arrow); do_setcursor(cursor_arrow);
} }
if (which > cur + 16) if (which >= cur + 16)
which = which - 4; which = which - 4;
} }
else if (event.button.y >= (48 * 7 + 40 + HEIGHTOFFSET - 48) && else if (event.button.y >= (48 * 7 + 40 + HEIGHTOFFSET - 48) &&
@ -14271,6 +14271,38 @@ void do_open(void)
want_erase = 1; want_erase = 1;
} }
} }
else if (event.type == SDL_MOUSEBUTTONDOWN &&
event.button.button >= 4 &&
event.button.button <= 5 &&
wheely)
{
/* Scroll wheel! */
if (event.button.button == 4 && cur > 0)
{
cur = cur - 4;
update_list = 1;
playsound(1, SND_SCROLL, 1);
if (cur == 0)
do_setcursor(cursor_arrow);
if (which >= cur + 16)
which = which - 4;
}
else if (event.button.button == 5 && cur < num_files - 16)
{
cur = cur + 4;
update_list = 1;
playsound(1, SND_SCROLL, 1);
if (cur >= num_files - 16)
do_setcursor(cursor_arrow);
if (which < cur)
which = which + 4;
}
}
else if (event.type == SDL_MOUSEMOTION) else if (event.type == SDL_MOUSEMOTION)
{ {
/* Deal with mouse pointer shape! */ /* Deal with mouse pointer shape! */