Remove lcd configuration files, and add the lcd_hd44 configuration files.
[bertos.git] / bertos / gui / menu.c
index 146b3c1ffd0f6741d8a04bcb234db577aa71a8fc..6c3f8d0d8fef038c8980a521585c46efc65e2f30 100644 (file)
  * invalidate any other reasons why the executable file might be covered by
  * the GNU General Public License.
  *
- * Copyright 2003, 2004, 2006 Develer S.r.l. (http://www.develer.com/)
+ * Copyright 2003, 2004, 2006, 2010 Develer S.r.l. (http://www.develer.com/)
  * Copyright 2000 Bernie Innocenti <bernie@codewiz.org>
  *
  * -->
  *
- * \version $Id$
- *
  * \author Bernie Innocenti <bernie@codewiz.org>
  * \author Stefano Fedrigo <aleph@develer.com>
  *
@@ -42,6 +40,7 @@
 #include "menu.h"
 
 #include "cfg/cfg_gfx.h"
+#include "cfg/cfg_arch.h"
 #include <cfg/compiler.h>
 #include <cfg/debug.h>
 
@@ -168,9 +167,7 @@ static void menu_defaultRenderHook(struct Bitmap *bm, int ypos, bool selected, c
                }
        }
 
-#warning FIXME:REVISE this code!
-#if 0
-//#if CPU_HARVARD
+#if CPU_HARVARD
        ((item->flags & MIF_RAMLABEL) ? text_xyprintf : text_xyprintf_P)
 #else
        text_xyprintf
@@ -278,6 +275,9 @@ static void menu_layout(
                if (!(item->flags & MIF_HIDDEN))
                {
                        /* Check if a special render function is supplied, otherwise use defaults */
+                       #if (ARCH & ARCH_NIGHTTEST)
+                               #warning __FILTER_NEXT_WARNING__
+                       #endif
                        RenderHook renderhook = (item->flags & MIF_RENDERHOOK) ? (RenderHook)item->label : menu_defaultRenderHook;
 
                        /* Render menuitem */
@@ -293,7 +293,7 @@ static void menu_layout(
                /* Clear rest of area */
                gfx_rectClear(bm, bm->cr.xmin, ypos, bm->cr.xmax, bm->cr.ymax);
 
-               lcd_blitBitmap(&lcd_bitmap);
+               lcd_blitBitmap(bm);
        }
 
        /* Restore old cliprect */
@@ -440,7 +440,7 @@ iptr_t menu_handle(const struct Menu *menu)
 
 
        items_per_page =
-               (menu->bitmap->height / menu->bitmap->font->height)
+               (menu->bitmap->height / menu->bitmap->font->height - 1)
 #if CONFIG_MENU_MENUBAR
                - 1 /* menu bar labels */
 #endif
@@ -540,6 +540,9 @@ iptr_t menu_handle(const struct Menu *menu)
 
        /* Store currently selected item before leaving. */
        if (menu->flags & MF_SAVESEL)
+               #if (ARCH & ARCH_NIGHTTEST)
+                       #warning __FILTER_NEXT_WARNING__
+               #endif
                CONST_CAST(struct Menu *, menu)->selected = selected;
 
        return result;