Index: apps/settings.c
===================================================================
RCS file: /cvsroot/rockbox/apps/settings.c,v
retrieving revision 1.415
diff -u -r1.415 settings.c
--- apps/settings.c	10 Sep 2006 02:00:29 -0000	1.415
+++ apps/settings.c	14 Sep 2006 22:24:06 -0000
@@ -2016,6 +2058,86 @@
     }
     return false;
 }
+#ifdef HAVE_LCD_BITMAP
+#include "scrollbar.h"
+void draw_int_selection_screen(struct screen *display, 
+                               const unsigned char* string,
+                               const char* unit,
+                               int variable,
+                               int min_val,
+                               int max_val,
+                               void (*formatter)(char*, int, int, const char*) )
+{
+    int w,h;
+    struct {
+        char str[16];
+        int x;
+        int y;
+    } min, max, current;
+    if (display->nb_lines < 2 )
+        return;
+    display->clear_display();
+    if (formatter)
+    {
+        formatter(min.str, 16,min_val,unit);
+        formatter(max.str, 16,max_val,unit);
+        formatter(current.str, 16,variable,unit);
+    }
+    else
+    {
+        snprintf(min.str, 16,"%d %s",min_val, unit);
+        snprintf(max.str, 16,"%d %s",max_val, unit);
+        snprintf(current.str, 16,"%d %s",variable, unit);
+    }
+    
+    min.x = display->width/2 + display->char_width;
+    max.y = 1.5*display->char_height;
+    display->getstringsize(max.str,&w,&h);
+    max.x = display->width/2 + display->char_width;
+    min.y = display->height - 1.25*display->char_height;
+    
+    if (display->nb_lines <= 4)
+    {
+        
+        display->getstringsize(string,&w,&h);
+        display->putsxy((display->width-w)/2,0,string);
+        gui_scrollbar_draw(display, 
+	    display->char_width,
+	    display->char_height+2,
+            display->char_height/2, display->height - display->char_height - 4,
+            max_val-min_val,max_val-min_val,max_val-variable,VERTICAL);
+        
+        display->getstringsize(current.str,&w,&h);
+        current.x = 3*display->char_width;
+        current.y = display->height/2;
+	max.x = 3*display->char_width;
+	min.x = max.x;
+	max.y = display->char_height;
+	min.y = display->height - display->char_height;
+    }
+    else
+    {
+        
+        display->getstringsize(string,&w,&h);
+        display->putsxy((display->width-w)/2,0,string);
+        gui_scrollbar_draw(display, 
+	    (display->width)/2-display->char_height/4,
+	    (display->char_height) + (display->char_height/ 4),
+            display->char_height/2, display->height-(1.5*display->char_height),
+            max_val-min_val,max_val-min_val,max_val-variable,VERTICAL);
+        
+        display->getstringsize(current.str,&w,&h);
+        current.x = (display->width)/2 - w - display->char_width;
+        current.y = display->height/2 - display->char_height/2;
+    }
+    
+    
+    display->putsxy(min.x,min.y,min.str);
+    display->putsxy(max.x,max.y,max.str);
+    display->putsxy(current.x,current.y,current.str);
+    display->update();
+}
+#endif /* HAVE_LCD_BITMAP */
 bool set_int(const unsigned char* string,
              const char* unit,
              int voice_unit,
@@ -2026,10 +2148,79 @@
              int max,
              void (*formatter)(char*, int, int, const char*) )
 {
+#ifdef HAVE_LCD_BITMAP
+    int action;
+    bool done = false;
+    int temp = *variable;
+    int i;
+#if 0 /* eventually make this selectable */
+    if (global_settings.use_list_for_int_settings)
+    {
+        struct value_setting_data data = {
+            INT,max, step, voice_unit,unit,formatter,NULL };
+        return do_set_setting(string,variable,(max-min)/step + 1,
+                            (max-*variable)/step, &data,function);
+    }
+#endif
+    if (global_settings.talk_menu)
+    {
+        talk_unit(voice_unit, *variable);
+    }
+    while (!done)
+    {
+        if ( function )
+            function(temp);
+        FOR_NB_SCREENS(i)
+        {
+            draw_int_selection_screen(&screens[i],string,unit,temp,min,max,formatter);
+        }
+        action = get_action(CONTEXT_SETTINGS,TIMEOUT_BLOCK);
+        switch (action)
+        {
+            case ACTION_SETTINGS_INCREPEAT:
+                temp += (step*3);
+            case ACTION_SETTINGS_INC:
+                temp += step;
+                if (temp > max)
+                    temp = max;
+                if (global_settings.talk_menu)
+                {
+                    talk_unit(voice_unit, temp);
+                }
+                break;
+            case ACTION_SETTINGS_DECREPEAT:
+                temp -= (step*3);
+            case ACTION_SETTINGS_DEC:
+                temp -= step;
+                if (temp < min)
+                    temp = min;
+                if (global_settings.talk_menu)
+                {
+                    talk_unit(voice_unit, temp);
+                }
+                break;
+            case ACTION_STD_OK:
+                *variable = temp;
+                done = true;
+                break;
+            case ACTION_STD_CANCEL:
+                gui_syncsplash(HZ/2,true,str(LANG_MENU_SETTING_CANCEL));
+                done = true;
+                break;
+            default:
+                if(default_event_handler(action) == SYS_USB_CONNECTED)
+                    return true;
+        }
+    }
+    if ( function )
+        function(*variable);
+    return false;
+#else /* for char cell displays */
     struct value_setting_data data = {
-        INT,max, step, voice_unit,unit,formatter,NULL };
+    INT,max, step, voice_unit,unit,formatter,NULL };
     return do_set_setting(string,variable,(max-min)/step + 1,
                           (max-*variable)/step, &data,function);
+#endif /* HAVE_LCD_BITMAP */
 }
 
 /* NOTE: the 'type' parameter specifies the actual type of the variable
